From patchwork Fri Jan 22 23:37:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgecombe, Rick P" X-Patchwork-Id: 12040895 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 458B9C433DB for ; Fri, 22 Jan 2021 23:46:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D42DD23B31 for ; Fri, 22 Jan 2021 23:46:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D42DD23B31 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 21F936B0005; Fri, 22 Jan 2021 18:46:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D01F6B0007; Fri, 22 Jan 2021 18:46:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F1426B0008; Fri, 22 Jan 2021 18:46:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id E84D76B0005 for ; Fri, 22 Jan 2021 18:46:33 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9B36B98B3 for ; Fri, 22 Jan 2021 23:46:33 +0000 (UTC) X-FDA: 77735047866.17.lake49_1b04a042756f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 82D9B1801FC25 for ; Fri, 22 Jan 2021 23:46:33 +0000 (UTC) X-HE-Tag: lake49_1b04a042756f X-Filterd-Recvd-Size: 3541 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Jan 2021 23:46:31 +0000 (UTC) IronPort-SDR: WN4cHf2xJFqp799xA/+yiq4H9kX+P2Ltte0SS93KgA/0Ez9dWvINsYRgccg0D8+hYSkqrIpLq/ pa2rTi5cdS+Q== X-IronPort-AV: E=McAfee;i="6000,8403,9872"; a="176016035" X-IronPort-AV: E=Sophos;i="5.79,368,1602572400"; d="scan'208";a="176016035" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 15:46:29 -0800 IronPort-SDR: 2+eePPLZ2snFipedv5SjeCegN51ErgC+iQKh1xPp9pxaDUCOXm0NlgOKNwBxHP2n9hAB5/5Ev7 dIpBsJeatnDg== X-IronPort-AV: E=Sophos;i="5.79,368,1602572400"; d="scan'208";a="367627950" Received: from rpedgeco-mobl3.amr.corp.intel.com (HELO localhost.intel.com) ([10.212.122.167]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 15:46:28 -0800 From: Rick Edgecombe To: akpm@linux-foundation.org Cc: hch@lst.de, dja@axtens.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org, willy@infradead.org, linmiaohe@huawei.com, Rick Edgecombe Subject: [PATCH v2] mm/vmalloc: Separate put pages and flush VM flags Date: Fri, 22 Jan 2021 15:37:06 -0800 Message-Id: <20210122233706.9304-1-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When VM_MAP_PUT_PAGES was added, it was defined with the same value as VM_FLUSH_RESET_PERMS. This doesn't seem like it will cause any big functional problems other than some excess flushing for VM_MAP_PUT_PAGES allocations. Redefine VM_MAP_PUT_PAGES to have its own value. Also, rearrange things so flags are less likely to be missed in the future. Fixes: b944afc9d64d ("mm: add a VM_MAP_PUT_PAGES flag for vmap") Suggested-by: Matthew Wilcox Signed-off-by: Rick Edgecombe --- [v2] Changed comment format like suggested by Matthew and listed him as Suggested-by. Dropped Reviewed-bys because all of the comment changes are different. include/linux/vmalloc.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 80c0181c411d..cedcda6593f6 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -24,7 +24,8 @@ struct notifier_block; /* in notifier.h */ #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */ #define VM_NO_GUARD 0x00000040 /* don't add guard page */ #define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */ -#define VM_MAP_PUT_PAGES 0x00000100 /* put pages and free array in vfree */ +#define VM_FLUSH_RESET_PERMS 0x00000100 /* reset direct map and flush TLB on unmap, can't be freed in atomic context */ +#define VM_MAP_PUT_PAGES 0x00000200 /* put pages and free array in vfree */ /* * VM_KASAN is used slighly differently depending on CONFIG_KASAN_VMALLOC. @@ -37,12 +38,6 @@ struct notifier_block; /* in notifier.h */ * determine which allocations need the module shadow freed. */ -/* - * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with - * vfree_atomic(). - */ -#define VM_FLUSH_RESET_PERMS 0x00000100 /* Reset direct map and flush TLB on unmap */ - /* bits [20..32] reserved for arch specific ioremap internals */ /*