From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90252C10F13 for ; Mon, 15 Apr 2019 02:24:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 54BDE20880 for ; Mon, 15 Apr 2019 02:24:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QgcX7lFB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54BDE20880 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/6puZbpMOCpknEHSk4wvHmtVz00c9i72WN5j5hHqfGw=; b=QgcX7lFBj1tqqG bT5vj+vr1DKV6NOYqoYsLerAVVAnn9WI5uYJuBwCM91/2b8g+rjuY4/2YpYfbK1Bolc1+WDxF58ON 1cLUDamiC4tE66bxULNCyflg+Y4OxQJRQZpQCrL2cTFfVXKMbffGV3o2XdE9hxdsi0UE9hKePBosE RJcGq9REv/Yzh81v3+Wcb8UEANUjta/DzvOdvRWsP/owr6eSIV1aIEUpzMC8khdhtP8fT5UuG0zPT LKCYWhmdPZSmZbtIdcUHh96KIeZYVNnC/rbZ1DgYNIU/REnatp3ZtUUSBVcEIlmrm8WbueKofjMrA LYCchjtVqne7CJ4K7j9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFrI7-0005Pu-T8; Mon, 15 Apr 2019 02:24:15 +0000 Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFrI4-0005Pf-K4; Mon, 15 Apr 2019 02:24:12 +0000 Date: Sun, 14 Apr 2019 19:24:12 -0700 From: Matthew Wilcox To: Kees Cook Subject: Re: [PATCH] crypto: testmgr - allocate buffers with __GFP_COMP Message-ID: <20190415022412.GA29714@bombadil.infradead.org> References: <20190411192607.GD225654@gmail.com> <20190411192827.72551-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux ARM , Herbert Xu , Rik van Riel , Linux Kernel Mailing List , Eric Biggers , linux-mm@kvack.org, linux-security-module , Geert Uytterhoeven , linux-crypto , Laura Abbott , Dmitry Vyukov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. I'll agree this is not documented well, and maybe most multi-page allocations do want __GFP_COMP and we should invert that bit, but __GFP_SINGLE doesn't seem like the right antonym to __GFP_COMP to me. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel