[PATCH 31/31] dma-mapping-common: skip kmemleak checks for page-less SG entries

Linus Torvalds torvalds at linux-foundation.org
Thu Aug 13 02:05:15 AEST 2015


On Wed, Aug 12, 2015 at 12:05 AM, Christoph Hellwig <hch at 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


More information about the Linuxppc-dev mailing list