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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no 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 8FE27C432C2 for ; Wed, 25 Sep 2019 14:03:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F75E21D7F for ; Wed, 25 Sep 2019 14:03:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="MoYk9zg8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="X+uzUSLd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406387AbfIYODv (ORCPT ); Wed, 25 Sep 2019 10:03:51 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:59952 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405102AbfIYODv (ORCPT ); Wed, 25 Sep 2019 10:03:51 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 56AE38EE175; Wed, 25 Sep 2019 07:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1569420230; bh=wgQLAhQ0gpMYuJqIxafxVyPJc5xPW8c1DYEePcqkeJU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=MoYk9zg8Do4chGVdWYcE0CzTP4WxSWWl2MmooufUyNgrNOggM6gv8+5ym91rluB01 T9zP9EU/8mHdQL7K0Yaubf5zjl97Mnl6uxrU2SiOCil4kfpDfsBjsnePZHqaXjHKmR abdVTqnGv4Bzttn3OX7EPkAg2DkpyBAYnW/hSS1A= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bz3oqnN4PUpl; Wed, 25 Sep 2019 07:03:49 -0700 (PDT) Received: from [9.232.197.57] (unknown [129.33.253.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 462748EE0E9; Wed, 25 Sep 2019 07:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1569420229; bh=wgQLAhQ0gpMYuJqIxafxVyPJc5xPW8c1DYEePcqkeJU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=X+uzUSLdrthDd94MjAzzF/mQ+tu0lWcZNyf+zUIDja9t9EKsDz6oiJ/ZNG2gvKiEa yfskMWikzGLvJpq0Z7unefkclRQmKdUr8VxwuFWgizbKwabVGz66yaXjpvy2PbbRDR NAD/asi2+/1w5ZWBs/mGZPl6OIj7w1j2DytR14BI= Message-ID: <1569420226.3642.24.camel@HansenPartnership.com> Subject: Re: [PATCH] tpm: Detach page allocation from tpm_buf From: James Bottomley To: Jarkko Sakkinen , linux-integrity@vger.kernel.org Cc: Mimi Zohar , Jerry Snitselaar , Sumit Garg , Stefan Berger , Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , open list Date: Wed, 25 Sep 2019 10:03:46 -0400 In-Reply-To: <20190925134842.19305-1-jarkko.sakkinen@linux.intel.com> References: <20190925134842.19305-1-jarkko.sakkinen@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Wed, 2019-09-25 at 16:48 +0300, Jarkko Sakkinen wrote: [...] > + data_page = alloc_page(GFP_HIGHUSER); > + if (!data_page) > + return -ENOMEM; > + > + data_ptr = kmap(data_page); I don't think this is such a good idea. On 64 bit it's no different from GFP_KERNEL and on 32 bit where we do have highmem, kmap space is at a premium, so doing a highmem allocation + kmap is more wasteful of resources than simply doing GFP_KERNEL. In general, you should only do GFP_HIGHMEM if the page is going to be mostly used by userspace, which really isn't the case here. James