Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932140AbbHLQFV (ORCPT ); Wed, 12 Aug 2015 12:05:21 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:36290 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753745AbbHLQFR (ORCPT ); Wed, 12 Aug 2015 12:05:17 -0400 MIME-Version: 1.0 In-Reply-To: <1439363150-8661-32-git-send-email-hch@lst.de> References: <1439363150-8661-1-git-send-email-hch@lst.de> <1439363150-8661-32-git-send-email-hch@lst.de> Date: Wed, 12 Aug 2015 09:05:15 -0700 X-Google-Sender-Auth: 1lgZvIhI2y3w_A-MYzUfqFXbHCI Message-ID: Subject: Re: [PATCH 31/31] dma-mapping-common: skip kmemleak checks for page-less SG entries From: Linus Torvalds To: Christoph Hellwig Cc: Jens Axboe , Dan Williams , Vineet Gupta , =?UTF-8?Q?H=C3=A5vard_Skinnemoen?= , Hans-Christian Egtvedt , Miao Steven , David Howells , Michal Simek , "the arch/x86 maintainers" , David Woodhouse , Alex Williamson , grundler@parisc-linux.org, Linux Kernel Mailing List , "linux-arch@vger.kernel.org" , linux-alpha@vger.kernel.org, "linux-ia64@vger.kernel.org" , linux-metag@vger.kernel.org, linux-mips , Parisc List , ppc-dev , linux-s390 , sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, "linux-nvdimm@lists.01.org" , Linux Media Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 987 Lines: 27 On Wed, Aug 12, 2015 at 12:05 AM, Christoph Hellwig 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/