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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 E6EC0C433E0 for ; Thu, 21 Jan 2021 13:20:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 587E6239FD for ; Thu, 21 Jan 2021 13:20:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 587E6239FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BF0446B000C; Thu, 21 Jan 2021 08:20:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA0266B000D; Thu, 21 Jan 2021 08:20:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8ECC6B000E; Thu, 21 Jan 2021 08:20:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0077.hostedemail.com [216.40.44.77]) by kanga.kvack.org (Postfix) with ESMTP id 95D726B000C for ; Thu, 21 Jan 2021 08:20:32 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5ADFD8249980 for ; Thu, 21 Jan 2021 13:20:32 +0000 (UTC) X-FDA: 77729841504.17.slip43_1006e9027563 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 40132180D0181 for ; Thu, 21 Jan 2021 13:20:32 +0000 (UTC) X-HE-Tag: slip43_1006e9027563 X-Filterd-Recvd-Size: 3473 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Jan 2021 13:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=63CLHf7zjvPRV1A3pYRsrLhDaACd8lpm/i6WY+5CgAk=; b=wVxb+uHqg27IQFOxXd2/qL+lRL vrrzxnk//dCzxGYMHb9nsLxsE8JSRqiIYje7uvBHmLVX3SWqZPJXughCuXIuOUfMcTqr/XURvpnQ+ rAgnmI+H0mxx8MJECTsHng1BctQsop1yNph0NiK/0mIIY70FAHWvv8bU2tGD9wVF29Nfym9RFNkZv ihyr00In6p2TvQKEqCtmDlUx1d1G+pARpKPTUZPTtDp3nSo0j3x8kCG8k/gI8WaVEsEeFA1XXZ2Vh t2G9J0//LsOAB+pESddolU1cb6SUzje4XaReU5mul96Zxu4P6J9vhh+p0pPhkfVC438qOxf7Rqxxo CK4uAVPQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l2Zs4-00H5CZ-Nf; Thu, 21 Jan 2021 13:19:47 +0000 Date: Thu, 21 Jan 2021 13:19:32 +0000 From: Matthew Wilcox To: Rick Edgecombe Cc: akpm@linux-foundation.org, hch@lst.de, dja@axtens.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmalloc: Separate put pages and flush VM flags Message-ID: <20210121131932.GO2260413@casper.infradead.org> References: <20210121014118.31922-1-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210121014118.31922-1-rick.p.edgecombe@intel.com> 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: On Wed, Jan 20, 2021 at 05:41:18PM -0800, Rick Edgecombe wrote: > 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. Er ... I think the problem was that VM_FLUSH_RESET_PERMS was put away from all the other flags! Why not this? diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 938eaf9517e26..458c41b99215e 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. cannot 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 */ /*