Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1753155yba; Sun, 14 Apr 2019 19:50:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXiePgIKFztExkSxWycDwsKZ59eA7jgSXSg8GjK5qfJ3TH5YFR2SICVwi2nhHvIKsYKbO0 X-Received: by 2002:a63:2a8f:: with SMTP id q137mr66077138pgq.31.1555296613754; Sun, 14 Apr 2019 19:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555296613; cv=none; d=google.com; s=arc-20160816; b=cBxrE1vyMejpHoxvbl0ieqYF6ZV8VojNJF0ZZfX+FqdnZHdKvWapAkzeFvDZKKc+zp 5zx1hG9rwjXI65q2kqZ7XVM37GDaflJMoDxAOjUY8aPpT0tREy0oITs4Lqo35ETJgnVU EY7gaj5JC7mywPgTOwlQ+H+MqbufUloxnxviCHrfYeyqjMMHsjppGZvBHlRt85gpZpCG ILAsenICz6BpquKrMvJBfkzh3s37msy+vpR/LK7/DXkwUmBnynkSDEU07opTG0hOdlok gydTGVCFB+GDdUsl6GxoqMyF2+DujDNQjQtYNuN4DeVbVBiR2iOZU4gxHIM4RI8mQ86G kNUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ToA02dx3ht25pJHA8PBT/UuVIrfdjx8CtVztKUcUUQY=; b=IAJfv5UEMEqgNUwCtm7hxOVn51H3WmzyCX/CebKdrUxsBW/xOGQ7yWUNgxRhc2Gjey 0hnLqzwaC4Kgd4/AtkgV91bRDhdnBULruv33Y18PMC/cmPavkhYusQldMViBLFFYBttg uNmmIFAzy8l3n7HxjGdX/v4e9+IO+27eD8PK8cF2C4osKQc2PxwqbEeC69gpj+HSt8LF 5rLFijH/+0wqEd3b7+rpUCGL5NL2SbFa+PZUr/JT9U2DUMuQZLBwnwYEqv7EVaWtzFF9 YarBQ1muVAexGwvx3kxyk9KiPaViPUEbUnDlfGc/M8E0W7Kh3HWu6MvCPaV0m0CD4Z+u AI8A== 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 d30si11265652pld.342.2019.04.14.19.49.45; Sun, 14 Apr 2019 19:50:13 -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 S1726331AbfDOCqk (ORCPT + 99 others); Sun, 14 Apr 2019 22:46:40 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:56794 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbfDOCqj (ORCPT ); Sun, 14 Apr 2019 22:46:39 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hFrdU-0001NG-T0; Mon, 15 Apr 2019 10:46:21 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hFrdP-0003On-6f; Mon, 15 Apr 2019 10:46:15 +0800 Date: Mon, 15 Apr 2019 10:46:15 +0800 From: Herbert Xu To: Matthew Wilcox Cc: Kees Cook , Eric Biggers , Rik van Riel , linux-crypto , Dmitry Vyukov , Geert Uytterhoeven , linux-security-module , Linux ARM , Linux Kernel Mailing List , Laura Abbott , linux-mm@kvack.org Subject: Re: [PATCH] crypto: testmgr - allocate buffers with __GFP_COMP Message-ID: <20190415024615.f765e7oagw26ezam@gondor.apana.org.au> References: <20190411192607.GD225654@gmail.com> <20190411192827.72551-1-ebiggers@kernel.org> <20190415022412.GA29714@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190415022412.GA29714@bombadil.infradead.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 14, 2019 at 07:24:12PM -0700, Matthew Wilcox wrote: > On Thu, Apr 11, 2019 at 01:32:32PM -0700, Kees Cook wrote: > > > @@ -156,7 +156,8 @@ static int __testmgr_alloc_buf(char *buf[XBUFSIZE], int order) > > > int i; > > > > > > for (i = 0; i < XBUFSIZE; i++) { > > > - buf[i] = (char *)__get_free_pages(GFP_KERNEL, order); > > > + buf[i] = (char *)__get_free_pages(GFP_KERNEL | __GFP_COMP, > > > + order); > > > > Is there a reason __GFP_COMP isn't automatically included in all page > > allocations? (Or rather, it seems like the exception is when things > > should NOT be considered part of the same allocation, so something > > like __GFP_SINGLE should exist?.) > > The question is not whether or not things should be considered part of the > same allocation. The question is whether the allocation is of a compound > page or of N consecutive pages. Now you're asking what the difference is, > and it's whether you need to be able to be able to call compound_head(), > compound_order(), PageTail() or use a compound_dtor. If you don't, then > you can save some time at allocation & free by not specifying __GFP_COMP. Thanks for clarifying Matthew. Eric, this means that we should not use __GFP_COMP here just to silent what is clearly a broken warning. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt