Received: by 10.213.65.68 with SMTP id h4csp3973518imn; Tue, 10 Apr 2018 07:24:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx49YSghgplNxt9+TbXUjmNbadH/4sJKuC6He+Cpc/y4GnuBQFlug8xgm1i2SV4aRL+V2uyIl X-Received: by 10.167.129.10 with SMTP id b10mr574660pfi.186.1523370298778; Tue, 10 Apr 2018 07:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523370298; cv=none; d=google.com; s=arc-20160816; b=ZN+pGczAOBYYIuLFDFxsAL/ZvOizPD2KCMlOD/943ui/TGqDXu2lk3/g1h2afilVHl bGUX+lACfXPtfxDOLrA3OI+sDBdDWphxKsY8cQghC9aLVqi155i/5HAmmdZFk84wDXxy 1TWy1dA6s7mC7E5chKhUAqO0yDDjWjWUa6Vlpev5QvgBhUXGNnATHbbL0t31eix+qt1f aJxNH+CCFPMa1caDnawdTywlK6+ku4MyRzXQLOZRCpuhJySN4q0G14UxC+vkun5TvG1L Fkx3pNmMw1Mf3oP0O93XoYaEuR6mQyYXVef9WVxrdQtuTb5ZWyl/zguqRRg02BSicCPY lQJQ== 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=kV+72ihtaYDJO2J5e9LRtp3hBiPu3Ipbe+XKztJGgtA=; b=TNjewI3Zxjjyxc1iV2QSaIRVkF4RyOBwaBXgl8hNffpM1NP647R6KglAxiFnK9WRGF EWXOEiQJNHZ8Xroc0NTMv1ur9vJWoofF0CGuQ8RgiEvjNEuGh6Dpt3mSO6if89jylh3e kWNPB0VVJgbWuD7NQQBnS0Cb6KtieMGWvaUTkM3nMAEdMMI11UIve5aUYfFKckIMeENJ s6SmFnxd+Eg4BvSMY5DHP5sHLDMkPoPhOwUuKDUnw4Hw/6sXbSR6blLk2ZhGH+c+Sbi3 ooPeqavGMXBJjX1L954LfEQZYKXc69Xqp+q/+iut3PwnkXcHnf+Mgx6t5qQqojLVdMGs /eNQ== 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 y14-v6si2784453plr.314.2018.04.10.07.24.21; Tue, 10 Apr 2018 07:24:58 -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 S1753520AbeDJOVX (ORCPT + 99 others); Tue, 10 Apr 2018 10:21:23 -0400 Received: from resqmta-po-09v.sys.comcast.net ([96.114.154.168]:40416 "EHLO resqmta-po-09v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753001AbeDJOVW (ORCPT ); Tue, 10 Apr 2018 10:21:22 -0400 Received: from resomta-po-16v.sys.comcast.net ([96.114.154.240]) by resqmta-po-09v.sys.comcast.net with ESMTP id 5u8IfTAvJoJ4w5u9CfumBX; Tue, 10 Apr 2018 14:21:22 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-po-16v.sys.comcast.net with SMTP id 5u9AfnPzdbzDk5u9Bfw43N; Tue, 10 Apr 2018 14:21:22 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 84F8D1160B41; Tue, 10 Apr 2018 09:21:20 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 8333811600FD; Tue, 10 Apr 2018 09:21:20 -0500 (CDT) Date: Tue, 10 Apr 2018 09:21:20 -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: <20180410125351.15837-1-willy@infradead.org> 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: MS4wfBkChvRlASOl+lo9K+AwiU6LxkT8MbEcaHqvHcSIW4dO/VptPDF7J9sHRIyTUWWHUETTjtDuFNkXwwvAMK1QDOqYpzVk14uB37kYHnMz2p3jPzJcqkWg PqSMokymvRECmGJdXFVP0nTFDpDQPugXonVf/3wYct1hC/1Olyq/0fFhLZJs6we8gC4S+l4JcJETSr1LhWgQsgu3XDJ/HOBdslJRU9kfYcvXQdHN9+7nf089 cWhIf9a2163BPdA1BX3/UBqgTEuoF8AbgCepkUs5UQQs0fnJV4EZKc9d1l3BZiYdn2abjeJQkSJagKZM1x5j63LZkdoQe684gUI7M0Z4/67z5lRD/OxD9E3J bgQ+LxOVmB/UwkGERNMsSFvfcWinUXaht+o3F8Syb5jPscbCw3lWlYaVwlNI0twXiwbyHBvkRJmwXOK5AJ+RpQGXp7DKpCMdkzqg6g6mHzLVQpQLSXO27eCD AYDTRmlWZyYwwj1guyKRmqqMGrd1EBdTIB1aid830uCVSnjgTsoK8zoOcvs= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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()?