|
|
Subscribe / Log in / New account

ZONE_DEVICE and the future of struct page

ZONE_DEVICE and the future of struct page

Posted Mar 21, 2017 15:34 UTC (Tue) by willy (subscriber, #9762)
Parent article: ZONE_DEVICE and the future of struct page

Hi Jon; thanks for the write-up as always!

There was a certain amount of cross-talk and mis-speaking; drivers that need to reach into the scatterlist to manipulate the data need a kernel address. What we said yesterday was "They should be using kmap_pfn()", which is actually a gross oversimplification. For the benefit of our audience, on a 32-bit machine, the physical address may not be in lowmem, so you can't just do pfn_to_virt() or page_to_virt().

What I now believe is that we need a kmap_sg() and then drivers don't need to care whether there's a PFN or a struct page in the scatterlist; they're getting the virtual address that they need. I'm not sure whether we want a kmap_sg_atomic(). A quick grep tells me we already have scsi_kmap_atomic_sg() which looks ideal other than the "scsi_" prefix. We also have bvec_kmap_irq(), bio_kmap_irqj() and __bio_kmap_atomic().


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds