diff mbox series

[mm,v4,07/39] mm: clarify __GFP_ZEROTAGS comment

Message ID 92f3029f3647ab355450ed5c8252bad8cfae1e09.1640036051.git.andreyknvl@google.com (mailing list archive)
State New
Headers show
Series kasan, vmalloc, arm64: add vmalloc tagging support for SW/HW_TAGS | expand

Commit Message

andrey.konovalov@linux.dev Dec. 20, 2021, 9:58 p.m. UTC
From: Andrey Konovalov <andreyknvl@google.com>

__GFP_ZEROTAGS is intended as an optimization: if memory is zeroed during
allocation, it's possible to set memory tags at the same time with little
performance impact.

Clarify this intention of __GFP_ZEROTAGS in the comment.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
---
 include/linux/gfp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alexander Potapenko Dec. 21, 2021, 9:16 a.m. UTC | #1
On Mon, Dec 20, 2021 at 10:59 PM <andrey.konovalov@linux.dev> wrote:
>
> From: Andrey Konovalov <andreyknvl@google.com>

Reviewed-by: Alexander Potapenko <glider@google.com>

>
> __GFP_ZEROTAGS is intended as an optimization: if memory is zeroed during
> allocation, it's possible to set memory tags at the same time with little
> performance impact.
Perhaps you could mention this intention explicitly in the comment?
Right now it still doesn't reference performance.

>
> Clarify this intention of __GFP_ZEROTAGS in the comment.
>
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  include/linux/gfp.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> index 0b2d2a636164..d6a184523ca2 100644
> --- a/include/linux/gfp.h
> +++ b/include/linux/gfp.h
> @@ -228,8 +228,8 @@ struct vm_area_struct;
>   *
>   * %__GFP_ZERO returns a zeroed page on success.
>   *
> - * %__GFP_ZEROTAGS returns a page with zeroed memory tags on success, if
> - * __GFP_ZERO is set.
> + * %__GFP_ZEROTAGS zeroes memory tags at allocation time if the memory itself
> + * is being zeroed (either via __GFP_ZERO or via init_on_alloc).
>   *
>   * %__GFP_SKIP_KASAN_POISON returns a page which does not need to be poisoned
>   * on deallocation. Typically used for userspace pages. Currently only has an
> --
> 2.25.1
>
> --
> You received this message because you are subscribed to the Google Groups "kasan-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/92f3029f3647ab355450ed5c8252bad8cfae1e09.1640036051.git.andreyknvl%40google.com.
Andrey Konovalov Dec. 30, 2021, 7:11 p.m. UTC | #2
On Tue, Dec 21, 2021 at 10:17 AM Alexander Potapenko <glider@google.com> wrote:
>
> On Mon, Dec 20, 2021 at 10:59 PM <andrey.konovalov@linux.dev> wrote:
> >
> > From: Andrey Konovalov <andreyknvl@google.com>
>
> Reviewed-by: Alexander Potapenko <glider@google.com>
>
> >
> > __GFP_ZEROTAGS is intended as an optimization: if memory is zeroed during
> > allocation, it's possible to set memory tags at the same time with little
> > performance impact.
> Perhaps you could mention this intention explicitly in the comment?
> Right now it still doesn't reference performance.

Sure, will do in v5. Thanks!
diff mbox series

Patch

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 0b2d2a636164..d6a184523ca2 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -228,8 +228,8 @@  struct vm_area_struct;
  *
  * %__GFP_ZERO returns a zeroed page on success.
  *
- * %__GFP_ZEROTAGS returns a page with zeroed memory tags on success, if
- * __GFP_ZERO is set.
+ * %__GFP_ZEROTAGS zeroes memory tags at allocation time if the memory itself
+ * is being zeroed (either via __GFP_ZERO or via init_on_alloc).
  *
  * %__GFP_SKIP_KASAN_POISON returns a page which does not need to be poisoned
  * on deallocation. Typically used for userspace pages. Currently only has an