Received: by 10.213.65.68 with SMTP id h4csp3982226imn; Tue, 10 Apr 2018 07:32:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JnBPwoP29jv2k1AP0nkcqpidQTu65sNQ/yQH7UGfm35m4R63kkfIEhyNYulMnvEUJdSEO X-Received: by 10.98.147.135 with SMTP id r7mr587031pfk.31.1523370761987; Tue, 10 Apr 2018 07:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523370761; cv=none; d=google.com; s=arc-20160816; b=YFGlaHYgsrQ3e3FEdQFCxr7WZAIE/se4Ccaod1NF2QIqC5LrmY2+Ikg2S1Khyx3c7e tuWukofgKbtP0vBBcZn0rTjoELASAGmxvrQRnmEQmFJYh/YBBBGvw1LGYtKRP826sJNh U4IPaUG/hvn2nMCcLiD2R2YZL1Rpj+69gkqxxFfmvBYqr7Lsy5a++u68pGULNwZ7aB26 Kib0Rrjhw7nJQKPLjXOgYb+0SMo/XibhV1KyoQYvsLPzaiyRF9uG0zhuk1HIgdE1H8es cJXrJUE+NUsSflTX8akXYEcO20E906LzNQDHMa7uIbmMz3YI7422pr5SyIAl/4/UN2G4 Btmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=9ymNhfC54K43E1+feDzWeAsPnoWxqiqeHcKBHrRakFU=; b=0rmHsApQ0PqtlQ/fQDCJx/LDpl+N+TmfiINposddk2XXCHetKe0yhwRbwBrNAvXDIW VeEL+17tiVGw0cCf5S/fstZLkhNjXGNZhfQlm8mhpjDE/TsVWcyJI2qu6V1XivHShVcJ PingKqAqnQeKQXs/lK2bX32PeBYHnT0bIyIpyVpj+x75SchJ30DZgPB0u8F1MWMhD8GI b8z+WwOB3JaGnLw98GwHj5HXMTlWC4dmWDmF8NnOpyTcsrcqRyIye9gg8iWhG9ChwUu9 yO29QEm978XDuBbBINoHqskVeQZELPLzdJ6fkiG9TMiLXfbzv7q37MSKsqt1/JEMxzUP q5mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1-v6si2737683plb.745.2018.04.10.07.32.03; Tue, 10 Apr 2018 07:32:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbeDJO0W (ORCPT + 99 others); Tue, 10 Apr 2018 10:26:22 -0400 Received: from resqmta-ch2-08v.sys.comcast.net ([69.252.207.40]:35050 "EHLO resqmta-ch2-08v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752845AbeDJO0V (ORCPT ); Tue, 10 Apr 2018 10:26:21 -0400 Received: from resomta-ch2-02v.sys.comcast.net ([69.252.207.98]) by resqmta-ch2-08v.sys.comcast.net with ESMTP id 5uDWf049Pe4dn5uE0f9FeZ; Tue, 10 Apr 2018 14:26:20 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-02v.sys.comcast.net with SMTP id 5uDzfs2sTtHiS5uDzf1CNd; Tue, 10 Apr 2018 14:26:20 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 0FFD51160B41; Tue, 10 Apr 2018 09:26:19 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 0D82611600FD; Tue, 10 Apr 2018 09:26:19 -0500 (CDT) Date: Tue, 10 Apr 2018 09:26:19 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Matthew Wilcox cc: linux-mm@kvack.org, Matthew Wilcox , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org, Jan Kara , Jeff Layton , Mel Gorman , stable@vger.kernel.org Subject: Re: [PATCH 1/2] slab: __GFP_ZERO is incompatible with a constructor In-Reply-To: Message-ID: References: <20180410125351.15837-1-willy@infradead.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfEoSLJu4PEigK+VC8JBxRPvaQKIrS4szM3RGwOKicFCKKWnBZwmdSF65G4d6YKrdlBZ6k23iycY4eJSkftjo3FZRiXDaGO8C6JXcnbHQFcJt9j0ABPaI 7J2LF3TMYAzBAexY+NJtTJORESpH4KChhfGZuyqioEVpFE9eqZQX40njvAkviMkskFG/r2a3UYIGvWgJJXuI9fFZru/GLtRzR354FZY45VpKTwtUPLWlVcaA PzCLzG0qDLdasbC1Pec/Xbar/7lCKqYVbK6CwPBIwVFj9RRWkjoTNIlXNPZrle9PW1JR8i4Q2u+VtDEFpyqx5geBOBbgzHgjnDw717Qo1COHryFUkxzG5SpB EQnmNhyWw2aZyPb14UoGt6sfOEtOGpFAZ563yRFFI2L8S6PXh9aiB0VubacSwY6amMQHBE5ofAo6vJnO+yzMGissa8/vy6SDDx7HMJqGzMFuwixtdRGLTmuM mt9BgtCCdD4fkvgdeowyJ2+ibsYHNOii8ROfX78SBKpEAgr/9V0LBpPtYGo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Apr 2018, Christopher Lameter wrote: > On Tue, 10 Apr 2018, Matthew Wilcox wrote: > > > __GFP_ZERO requests that the object be initialised to all-zeroes, > > while the purpose of a constructor is to initialise an object to a > > particular pattern. We cannot do both. Add a warning to catch any > > users who mistakenly pass a __GFP_ZERO flag when allocating a slab with > > a constructor. > > Can we move this check out of the critical paths and check for > a ctor and GFP_ZERO when calling the page allocator? F.e. in > allocate_slab()? The ctor's are run at that point from setup_object() so it makes sense.