* Re: [PATCH 29/31] parisc: handle page-less SG entries [not found] ` <1439363150-8661-30-git-send-email-hch@lst.de> @ 2015-08-12 16:01 ` Linus Torvalds 2015-08-13 14:31 ` Christoph Hellwig 0 siblings, 1 reply; 6+ messages in thread From: Linus Torvalds @ 2015-08-12 16:01 UTC (permalink / raw) To: Christoph Hellwig Cc: Jens Axboe, Dan Williams, Vineet Gupta, Håvard Skinnemoen, Hans-Christian Egtvedt, Miao Steven, David Howells, Michal Simek, the arch/x86 maintainers, David Woodhouse, Alex Williamson, grundler, Linux Kernel Mailing List, linux-arch@vger.kernel.org, linux-alpha, linux-ia64@vger.kernel.org, linux-metag, linux-mips, Parisc List, ppc-dev, linux-s390, sparclinux, linux-xtensa, linux-nvdimm@lists.01.org, Linux Media Mailing List On Wed, Aug 12, 2015 at 12:05 AM, Christoph Hellwig <hch@lst.de> wrote: > Make all cache invalidation conditional on sg_has_page() and use > sg_phys to get the physical address directly. So this worries me a bit (I'm just reacting to one random patch in the series). The reason? I think this wants a big honking comment somewhere saying "non-sg_page accesses are not necessarily cache coherent"). Now, I don't think that's _wrong_, but it's an important distinction: if you look up pages in the page tables directly, there's a very subtle difference between then saving just the pfn and saving the "struct page" of the result. On sane architectures, this whole cache flushing thing doesn't matter. Which just means that it's going to be even more subtle on the odd broken ones.. I'm assuming that anybody who wants to use the page-less scatter-gather lists always does so on memory that isn't actually virtually mapped at all, or only does so on sane architectures that are cache coherent at a physical level, but I'd like that assumption *documented* somewhere. (And maybe it is, and I just didn't get to that patch yet) Linus ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 29/31] parisc: handle page-less SG entries 2015-08-12 16:01 ` [PATCH 29/31] parisc: handle page-less SG entries Linus Torvalds @ 2015-08-13 14:31 ` Christoph Hellwig 2015-08-14 3:30 ` Dan Williams 0 siblings, 1 reply; 6+ messages in thread From: Christoph Hellwig @ 2015-08-13 14:31 UTC (permalink / raw) To: Linus Torvalds Cc: Jens Axboe, Dan Williams, Vineet Gupta, Håvard Skinnemoen, Hans-Christian Egtvedt, Miao Steven, David Howells, Michal Simek, the arch/x86 maintainers, David Woodhouse, Alex Williamson, grundler, Linux Kernel Mailing List, linux-arch@vger.kernel.org, linux-alpha, linux-ia64@vger.kernel.org, linux-metag, linux-mips, Parisc List, ppc-dev, linux-s390, sparclinux, linux-xtensa, linux-nvdimm@lists.01.org, Linux Media Mailing List On Wed, Aug 12, 2015 at 09:01:02AM -0700, Linus Torvalds wrote: > I'm assuming that anybody who wants to use the page-less > scatter-gather lists always does so on memory that isn't actually > virtually mapped at all, or only does so on sane architectures that > are cache coherent at a physical level, but I'd like that assumption > *documented* somewhere. It's temporarily mapped by kmap-like helpers. That code isn't in this series. The most recent version of it is here: https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/commit/?h=pfn&id=de8237c99fdb4352be2193f3a7610e902b9bb2f0 note that it's not doing the cache flushing it would have to do yet, but it's also only enabled for x86 at the moment. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 29/31] parisc: handle page-less SG entries 2015-08-13 14:31 ` Christoph Hellwig @ 2015-08-14 3:30 ` Dan Williams 2015-08-14 3:59 ` James Bottomley 0 siblings, 1 reply; 6+ messages in thread From: Dan Williams @ 2015-08-14 3:30 UTC (permalink / raw) To: Christoph Hellwig Cc: Linus Torvalds, linux-mips, linux-ia64@vger.kernel.org, linux-nvdimm@lists.01.org, David Howells, sparclinux, Hans-Christian Egtvedt, linux-arch@vger.kernel.org, linux-s390, the arch/x86 maintainers, David Woodhouse, Håvard Skinnemoen, linux-xtensa, grundler, Miao Steven, Alex Williamson, linux-metag, Jens Axboe, Michal Simek, Parisc List, Vineet Gupta, Linux Kernel Mailing List, linux-alpha, Linux Media Mailing List, ppc-dev On Thu, Aug 13, 2015 at 7:31 AM, Christoph Hellwig <hch@lst.de> wrote: > On Wed, Aug 12, 2015 at 09:01:02AM -0700, Linus Torvalds wrote: >> I'm assuming that anybody who wants to use the page-less >> scatter-gather lists always does so on memory that isn't actually >> virtually mapped at all, or only does so on sane architectures that >> are cache coherent at a physical level, but I'd like that assumption >> *documented* somewhere. > > It's temporarily mapped by kmap-like helpers. That code isn't in > this series. The most recent version of it is here: > > https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/commit/?h=pfn&id=de8237c99fdb4352be2193f3a7610e902b9bb2f0 > > note that it's not doing the cache flushing it would have to do yet, but > it's also only enabled for x86 at the moment. For virtually tagged caches I assume we would temporarily map with kmap_atomic_pfn_t(), similar to how drm_clflush_pages() implements powerpc support. However with DAX we could end up with multiple virtual aliases for a page-less pfn. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 29/31] parisc: handle page-less SG entries 2015-08-14 3:30 ` Dan Williams @ 2015-08-14 3:59 ` James Bottomley 0 siblings, 0 replies; 6+ messages in thread From: James Bottomley @ 2015-08-14 3:59 UTC (permalink / raw) To: Dan Williams Cc: Christoph Hellwig, Linus Torvalds, linux-mips, linux-ia64@vger.kernel.org, linux-nvdimm@lists.01.org, David Howells, sparclinux, Hans-Christian Egtvedt, linux-arch@vger.kernel.org, linux-s390, the arch/x86 maintainers, David Woodhouse, Håvard Skinnemoen, linux-xtensa, grundler, Miao Steven, Alex Williamson, linux-metag, Jens Axboe, Michal Simek, Parisc List, Vineet Gupta, Linux Kernel Mailing List, linux-alpha, Linux Media Mailing List, ppc-dev On Thu, 2015-08-13 at 20:30 -0700, Dan Williams wrote: > On Thu, Aug 13, 2015 at 7:31 AM, Christoph Hellwig <hch@lst.de> wrote: > > On Wed, Aug 12, 2015 at 09:01:02AM -0700, Linus Torvalds wrote: > >> I'm assuming that anybody who wants to use the page-less > >> scatter-gather lists always does so on memory that isn't actually > >> virtually mapped at all, or only does so on sane architectures that > >> are cache coherent at a physical level, but I'd like that assumption > >> *documented* somewhere. > > > > It's temporarily mapped by kmap-like helpers. That code isn't in > > this series. The most recent version of it is here: > > > > https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/commit/?h=pfn&id=de8237c99fdb4352be2193f3a7610e902b9bb2f0 > > > > note that it's not doing the cache flushing it would have to do yet, but > > it's also only enabled for x86 at the moment. > > For virtually tagged caches I assume we would temporarily map with > kmap_atomic_pfn_t(), similar to how drm_clflush_pages() implements > powerpc support. However with DAX we could end up with multiple > virtual aliases for a page-less pfn. At least on some PA architectures, you have to be very careful. Improperly managed, multiple aliases will cause the system to crash (actually a machine check in the cache chequerboard). For the most temperamental systems, we need the cache line flushed and the alias mapping ejected from the TLB cache before we access the same page at an inequivalent alias. James ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <1439363150-8661-32-git-send-email-hch@lst.de>]
* Re: [PATCH 31/31] dma-mapping-common: skip kmemleak checks for page-less SG entries [not found] ` <1439363150-8661-32-git-send-email-hch@lst.de> @ 2015-08-12 16:05 ` Linus Torvalds 2015-08-13 14:33 ` Christoph Hellwig 0 siblings, 1 reply; 6+ messages in thread From: Linus Torvalds @ 2015-08-12 16:05 UTC (permalink / raw) To: Christoph Hellwig Cc: Jens Axboe, Dan Williams, Vineet Gupta, Håvard Skinnemoen, Hans-Christian Egtvedt, Miao Steven, David Howells, Michal Simek, the arch/x86 maintainers, David Woodhouse, Alex Williamson, grundler, Linux Kernel Mailing List, linux-arch@vger.kernel.org, linux-alpha, linux-ia64@vger.kernel.org, linux-metag, linux-mips, Parisc List, ppc-dev, linux-s390, sparclinux, linux-xtensa, linux-nvdimm@lists.01.org, Linux Media Mailing List On Wed, Aug 12, 2015 at 12:05 AM, Christoph Hellwig <hch@lst.de> wrote: > + for_each_sg(sg, s, nents, i) { > + if (sg_has_page(s)) > + kmemcheck_mark_initialized(sg_virt(s), s->length); > + } [ Again, I'm responding to one random patch - this pattern was in other patches too. ] A question: do we actually expect to mix page-less and pageful SG entries in the same SG list? How does that happen? (I'm not saying it can't, I'm just wondering where people expect this to happen). IOW, maybe it would be valid to have a rule saying "a SG list is either all pageful or pageless, never mixed", and then have the "if" statement outside the loop rather than inside. Linus ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 31/31] dma-mapping-common: skip kmemleak checks for page-less SG entries 2015-08-12 16:05 ` [PATCH 31/31] dma-mapping-common: skip kmemleak checks for " Linus Torvalds @ 2015-08-13 14:33 ` Christoph Hellwig 0 siblings, 0 replies; 6+ messages in thread From: Christoph Hellwig @ 2015-08-13 14:33 UTC (permalink / raw) To: Linus Torvalds Cc: Christoph Hellwig, Jens Axboe, Dan Williams, Vineet Gupta, Håvard Skinnemoen, Hans-Christian Egtvedt, Miao Steven, David Howells, Michal Simek, the arch/x86 maintainers, David Woodhouse, Alex Williamson, grundler, Linux Kernel Mailing List, linux-arch@vger.kernel.org, linux-alpha, linux-ia64@vger.kernel.org, linux-metag, linux-mips, Parisc List, ppc-dev, linux-s390, sparclinux, linux-xtensa, linux-nvdimm@lists.01.org, Linux Media Mailing List On Wed, Aug 12, 2015 at 09:05:15AM -0700, Linus Torvalds wrote: > [ Again, I'm responding to one random patch - this pattern was in > other patches too. ] > > A question: do we actually expect to mix page-less and pageful SG > entries in the same SG list? > > How does that happen? Both for DAX and the video buffer case people could do direct I/O spanning the boundary between such a VMA and a normal one unless we add special code to prevent that. Right now I don't think it's all that useful, but then again it doesn't seem harmful either and adding those checks might add up. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-14 3:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1439363150-8661-1-git-send-email-hch@lst.de>
[not found] ` <1439363150-8661-30-git-send-email-hch@lst.de>
2015-08-12 16:01 ` [PATCH 29/31] parisc: handle page-less SG entries Linus Torvalds
2015-08-13 14:31 ` Christoph Hellwig
2015-08-14 3:30 ` Dan Williams
2015-08-14 3:59 ` James Bottomley
[not found] ` <1439363150-8661-32-git-send-email-hch@lst.de>
2015-08-12 16:05 ` [PATCH 31/31] dma-mapping-common: skip kmemleak checks for " Linus Torvalds
2015-08-13 14:33 ` Christoph Hellwig
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox