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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 2AC86C433E0 for ; Thu, 21 Jan 2021 02:44:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 608B623884 for ; Thu, 21 Jan 2021 02:44:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 608B623884 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 795996B0005; Wed, 20 Jan 2021 21:44:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 744EA6B0007; Wed, 20 Jan 2021 21:44:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65AAE6B0008; Wed, 20 Jan 2021 21:44:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id 50B986B0005 for ; Wed, 20 Jan 2021 21:44:28 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 163241E01 for ; Thu, 21 Jan 2021 02:44:28 +0000 (UTC) X-FDA: 77728238616.22.ants03_2d1005a2755f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id CA1AE18038E60 for ; Thu, 21 Jan 2021 02:44:27 +0000 (UTC) X-HE-Tag: ants03_2d1005a2755f X-Filterd-Recvd-Size: 3584 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Jan 2021 02:44:26 +0000 (UTC) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DLmsZ1ZkPz15w7n; Thu, 21 Jan 2021 10:43:14 +0800 (CST) Received: from [10.174.177.2] (10.174.177.2) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Thu, 21 Jan 2021 10:44:21 +0800 Subject: Re: [PATCH] mm/vmalloc: Separate put pages and flush VM flags To: Rick Edgecombe CC: , , , , Andrew Morton References: <20210121014118.31922-1-rick.p.edgecombe@intel.com> From: Miaohe Lin Message-ID: <21e2ed55-90f5-3e26-06ff-e4fd81709ffd@huawei.com> Date: Thu, 21 Jan 2021 10:44:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210121014118.31922-1-rick.p.edgecombe@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.2] X-CFilter-Loop: Reflected 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: Hi: On 2021/1/21 9:41, 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 Good catch! > 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") Is this worth a Cc stable ? > Signed-off-by: Rick Edgecombe > --- > 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 */ > > Looks good to me. Reviewed-by: Miaohe Lin