mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: loody <miloody@gmail.com>
Cc: kernelnewbies@kernelnewbies.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: some questions about block and scatterlist
Date: Tue, 1 Nov 2011 08:26:53 -0600	[thread overview]
Message-ID: <20111101082653.4fa844e4@bike.lwn.net> (raw)
In-Reply-To: <CANudz+unARaENw50p2iL_Ur1YQj0f=9Ndev0OyZ=790xDjbTCw@mail.gmail.com>

On Tue, 1 Nov 2011 19:32:38 +0900
loody <miloody@gmail.com> wrote:

> My questions are below:

As are some answers :)

> 1. Are all struct page 32-bit aligned?

Certainly, I would expect any structures found in the system memory map to
be so aligned, yes.  If you've created an arbitrary one elsewhere I'm only
99% sure it would be.

> If so, where is this part of code for handleing struct page be 32-bits aligned?

Note that the size of struct page is carefully considered, and that they
are packed as densely as possible, both externally and internally.  No
lesser alignment would make sense.

> 2. if the page of scatterlist is located at high mem, how does
> dma_map_sg mapping the virtual address?

That depends on a vast array of things.  What are the addressing
capabilities of the target device?  Is there an IOMMU involved?

> 3. in blk_rq_map_sg, it seems we only copy bvec->bv_page to sg->page_link
>    why don't we add dma_address in bvec and send the bio directly to
> the lower level driver?

That would be a bit of a mixing of the layers, if nothing else.

> 4. if I plug a USB HD with 3 partitions, will there be 3 request_queues?

No, there is one request queue for the underlying device.

That's an interesting mix of questions.  If you have more in the future,
you'll likely get more (and more clueful) responses if they're accompanied
by the code you're working on.

Thanks,

jon

  reply	other threads:[~2011-11-01 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 10:32 loody
2011-11-01 14:26 ` Jonathan Corbet [this message]
2011-11-07 13:16   ` loody
2011-11-07 17:08     ` Dave Hylands

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111101082653.4fa844e4@bike.lwn.net \
    --to=corbet@lwn.net \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miloody@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®