Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9109163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:58:39+00:00 2026-06-17T02:58:39+00:00

The book ldd says for the function blk_queue_segment_boundary() like this: Some devices cannot handle

  • 0

The book ldd says for the function blk_queue_segment_boundary() like this:

Some devices cannot handle requests that cross a particular size
memory bound- ary; if your device is one of those, use this function
to tell the kernel about that boundary. For example, if your device
has trouble with requests that cross a 4- MB boundary, pass in a mask
of 0x3fffff. The default mask is 0xffffffff.

I don’t quite understand what the boundary means here, for example, I have a virtual block device, which are made of indeed 4MB files, so I want a request not exceed 4MB boundary,

unsigned long sector = blk_rq_pos(req);
unsigned long offset = sector << 9;
unsigned long nbytes = blk_rq_bytes(req);

int file_offset = offset % (1 << 22);

What I want is that (file_offset + nbytes) not greater than 4M, but indeed sometimes it exceeds 4M,
so, is there any misunderstanding of blk_queue_segment_boundary() ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:58:40+00:00Added an answer on June 17, 2026 at 2:58 am

    Some controllers (particulary IDE) can not handle DMA requests that cross memory regions at 4MB. Think of it as segment:index addressing where index can not be larger that the set boundary.

    There is also a blk_queue_max_segment_size. Both are used to construct correct requests to the device – requests get reordered and merged.

    There are other uses. For example, from xen-blkfront.c:

    /* Each segment in a request is up to an aligned page in size. */
    blk_queue_segment_boundary(rq, PAGE_SIZE - 1);
    blk_queue_max_segment_size(rq, PAGE_SIZE);
    

    Requests are limited to PAGE_SIZE for better performance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The book I'm reading says that this function has a local variable. It also
My book says this: Lambdas with function bodies that contain anything other than a
A) Book I’m learning from says that if we handle Login.Authenticate event, then we
The book I am reading says that after allocating an object I need to
One Book(Object Oriented Programming with C++ by E.Balagurusamy) says that const size = 10;
My book says that - 1- Ranking functions (such as RANK(), DENSE_RANK(), ROW_NUMBER() etc.)
The book Pro Git says that the staging area is just a list, or
Google Book Search Give Output Something like this Introducing Little Simon&#39;s new Baby Snoopy
In book Head First C , it says that the computer does not allocate
The book I am reading says that SQL Server supports two kinds of character

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.