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

From: Linus Torvalds
Date: Wed Aug 12 2015 - 12:05:26 EST


On Wed, Aug 12, 2015 at 12:05 AM, Christoph Hellwig <hch@xxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/