linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: <hch@lst.de>, <dja@axtens.net>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/vmalloc: Separate put pages and flush VM flags
Date: Thu, 21 Jan 2021 10:44:20 +0800	[thread overview]
Message-ID: <21e2ed55-90f5-3e26-06ff-e4fd81709ffd@huawei.com> (raw)
In-Reply-To: <20210121014118.31922-1-rick.p.edgecombe@intel.com>

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 <rick.p.edgecombe@intel.com>
> ---
>  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 <linmiaohe@huawei.com>

  reply	other threads:[~2021-01-21  3:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  1:41 [PATCH] mm/vmalloc: Separate put pages and flush VM flags Rick Edgecombe
2021-01-21  2:44 ` Miaohe Lin [this message]
2021-01-21  7:08 ` Christoph Hellwig
2021-01-21 13:19 ` Matthew Wilcox
2021-01-21 23:57   ` Edgecombe, Rick P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21e2ed55-90f5-3e26-06ff-e4fd81709ffd@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=dja@axtens.net \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rick.p.edgecombe@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).