[openib-general] [PATCH 1/7] IB/core - Add DMA mapping functions to allow device drivers to interpose

Christoph Hellwig hch at lst.de
Thu Nov 9 15:50:09 PST 2006


On Sun, Nov 05, 2006 at 11:25:27PM +0200, Or Gerlitz wrote:
> On 11/5/06, Roland Dreier <rdreier at cisco.com> wrote:
> > > I have mentioned this to Ralph in the past, just want to get ack/nak
> > > on that from you: also on 64bit arch a block driver (eg SCSI LLD eg
> > > SRP/iSER/etc) might get from higher level an SG whose pages are
> > > **not** mapped into the kernel virtual address space. For example this
> > > can happen with Direct I/O.
> >
> >No, I don't see how that could happen.  Aren't all pages always mapped
> >by the the kernel direct mapping on 64-bit architectures?
> 
> I don't know exactly how this happens, but one of the comments i've
> got from Christoph
> on the iser code, is that one can't assume page_address(sg[i].page)
> will not be NULL for SG passed to a SCSI LLD, i think Direct I/O is
> one flow where this might happen.

That statement is indeed true.  Only for GFP_KERNEL allocations you
can assume page_address is valid, and the scatterlist passed to a SCSI
LLDD can contain any type of pages.  Currently on all 64bit
architectures page_address works on all pages, but that's an
implementation detail that could change any time and that you should
not rely on.




More information about the general mailing list