From patchwork Thu Jan 21 01:41:18 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: 12034103 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 66E57C433E0 for ; Thu, 21 Jan 2021 01:42:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C393223730 for ; Thu, 21 Jan 2021 01:42:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C393223730 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 CD3CC6B0005; Wed, 20 Jan 2021 20:42:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C5D4D6B0007; Wed, 20 Jan 2021 20:42:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B73276B0008; Wed, 20 Jan 2021 20:42:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id 9D6DA6B0005 for ; Wed, 20 Jan 2021 20:42:21 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5DEBB8249980 for ; Thu, 21 Jan 2021 01:42:21 +0000 (UTC) X-FDA: 77728082082.11.fruit12_1308d6d2755f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 39310180F8B81 for ; Thu, 21 Jan 2021 01:42:21 +0000 (UTC) X-HE-Tag: fruit12_1308d6d2755f X-Filterd-Recvd-Size: 3432 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Jan 2021 01:42:19 +0000 (UTC) IronPort-SDR: JWG8YHFEiWfxGRr8cPIHqreXLVt7N3mPseeQunPFlXpvnwy3UOSLRYWaPLify7HxXfrNxI2aCD 6/80u1xNqboA== X-IronPort-AV: E=McAfee;i="6000,8403,9870"; a="240744464" X-IronPort-AV: E=Sophos;i="5.79,362,1602572400"; d="scan'208";a="240744464" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2021 17:42:16 -0800 IronPort-SDR: 1OihG1Kgjr1KhWtwdRu0DPbq77xHsbumzcNymwn3HECK9ZEZsaqd9WQWTDJVl5CROmi2MZwWa+ CaEp/RkGxJKA== X-IronPort-AV: E=Sophos;i="5.79,362,1602572400"; d="scan'208";a="351295429" Received: from rpedgeco-mobl3.amr.corp.intel.com (HELO localhost.intel.com) ([10.212.106.147]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2021 17:42:16 -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, Rick Edgecombe Subject: [PATCH] mm/vmalloc: Separate put pages and flush VM flags Date: Wed, 20 Jan 2021 17:41:18 -0800 Message-Id: <20210121014118.31922-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, move the comment and remove whitespace for VM_KASAN such that the flags lower down are less likely to be missed in the future. Fixes: b944afc9d64d ("mm: add a VM_MAP_PUT_PAGES flag for vmap") Signed-off-by: Rick Edgecombe Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig --- include/linux/vmalloc.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 80c0181c411d..0b3dd135aa5d 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -23,9 +23,6 @@ struct notifier_block; /* in notifier.h */ #define VM_DMA_COHERENT 0x00000010 /* dma_alloc_coherent */ #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 */ - /* * VM_KASAN is used slighly differently depending on CONFIG_KASAN_VMALLOC. * @@ -36,12 +33,13 @@ struct notifier_block; /* in notifier.h */ * Otherwise, VM_KASAN is set for kasan_module_alloc() allocations and used to * determine which allocations need the module shadow freed. */ - +#define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */ /* * 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 */ +#define VM_MAP_PUT_PAGES 0x00000200 /* put pages and free array in vfree */ /* bits [20..32] reserved for arch specific ioremap internals */