All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* + mm-move-helper-to-check-slub_debug_enabled.patch added to -mm tree
@ 2021-07-06 20:42 akpm
  2021-07-15  1:24 ` Yee Lee
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2021-07-06 20:42 UTC (permalink / raw
  To: mm-commits, yee.lee, willy, ryabinin.a.a, nicholas.tang,
	Kuan-Ying.Lee, glider, dvyukov, chinwen.chang, andreyknvl, elver


The patch titled
     Subject: mm: move helper to check slub_debug_enabled
has been added to the -mm tree.  Its filename is
     mm-move-helper-to-check-slub_debug_enabled.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-move-helper-to-check-slub_debug_enabled.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-move-helper-to-check-slub_debug_enabled.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Marco Elver <elver@google.com>
Subject: mm: move helper to check slub_debug_enabled

Move the helper to check slub_debug_enabled, so that we can confine the
use of #ifdef outside slub.c as well.

Link: https://lkml.kernel.org/r/20210705103229.8505-2-yee.lee@mediatek.com
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Yee Lee <yee.lee@mediatek.com>
Suggested-by: Matthew Wilcox <willy@infradead.org>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Cc: Nicholas Tang <nicholas.tang@mediatek.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/slab.h |   15 +++++++++++----
 mm/slub.c |   14 --------------
 2 files changed, 11 insertions(+), 18 deletions(-)

--- a/mm/slab.h~mm-move-helper-to-check-slub_debug_enabled
+++ a/mm/slab.h
@@ -216,10 +216,18 @@ DECLARE_STATIC_KEY_FALSE(slub_debug_enab
 #endif
 extern void print_tracking(struct kmem_cache *s, void *object);
 long validate_slab_cache(struct kmem_cache *s);
+static inline bool __slub_debug_enabled(void)
+{
+	return static_branch_unlikely(&slub_debug_enabled);
+}
 #else
 static inline void print_tracking(struct kmem_cache *s, void *object)
 {
 }
+static inline bool __slub_debug_enabled(void)
+{
+	return false;
+}
 #endif
 
 /*
@@ -229,11 +237,10 @@ static inline void print_tracking(struct
  */
 static inline bool kmem_cache_debug_flags(struct kmem_cache *s, slab_flags_t flags)
 {
-#ifdef CONFIG_SLUB_DEBUG
-	VM_WARN_ON_ONCE(!(flags & SLAB_DEBUG_FLAGS));
-	if (static_branch_unlikely(&slub_debug_enabled))
+	if (IS_ENABLED(CONFIG_SLUB_DEBUG))
+		VM_WARN_ON_ONCE(!(flags & SLAB_DEBUG_FLAGS));
+	if (__slub_debug_enabled())
 		return s->flags & flags;
-#endif
 	return false;
 }
 
--- a/mm/slub.c~mm-move-helper-to-check-slub_debug_enabled
+++ a/mm/slub.c
@@ -119,25 +119,11 @@
  */
 
 #ifdef CONFIG_SLUB_DEBUG
-
 #ifdef CONFIG_SLUB_DEBUG_ON
 DEFINE_STATIC_KEY_TRUE(slub_debug_enabled);
 #else
 DEFINE_STATIC_KEY_FALSE(slub_debug_enabled);
 #endif
-
-static inline bool __slub_debug_enabled(void)
-{
-	return static_branch_unlikely(&slub_debug_enabled);
-}
-
-#else		/* CONFIG_SLUB_DEBUG */
-
-static inline bool __slub_debug_enabled(void)
-{
-	return false;
-}
-
 #endif		/* CONFIG_SLUB_DEBUG */
 
 static inline bool kmem_cache_debug(struct kmem_cache *s)
_

Patches currently in -mm which might be from elver@google.com are

mm-move-helper-to-check-slub_debug_enabled.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: + mm-move-helper-to-check-slub_debug_enabled.patch added to -mm tree
  2021-07-06 20:42 + mm-move-helper-to-check-slub_debug_enabled.patch added to -mm tree akpm
@ 2021-07-15  1:24 ` Yee Lee
  0 siblings, 0 replies; 2+ messages in thread
From: Yee Lee @ 2021-07-15  1:24 UTC (permalink / raw
  To: akpm, mm-commits, willy, ryabinin.a.a, nicholas.tang,
	Kuan-Ying.Lee, glider, dvyukov, chinwen.chang, andreyknvl, elver
  Cc: surenb


Hi Andrew,

Not yet seen the patches in mm tree.
Could you help to check the two patches?


https://lore.kernel.org/lkml/20210705103229.8505-2-yee.lee@mediatek.com/
https://lore.kernel.org/lkml/20210705103229.8505-3-yee.lee@mediatek.com/

Thanks,

BR,
Yee

On Tue, 2021-07-06 at 13:42 -0700, akpm@linux-foundation.org wrote:
> The patch titled
>      Subject: mm: move helper to check slub_debug_enabled
> has been added to the -mm tree.  Its filename is
>      mm-move-helper-to-check-slub_debug_enabled.patch
> 
> This patch should soon appear at
>     
> https://urldefense.com/v3/__https://ozlabs.org/*akpm/mmots/broken-out/mm-move-helper-to-check-slub_debug_enabled.patch__;fg!!CTRNKA9wMg0ARbw!1fBPodTcBW_dgU-wGXIj5tctPWpUbKNtoT2VjaoMpSJNxExhcHKTWi0AslyxKZQ$
>  
> and later at
>     
> https://urldefense.com/v3/__https://ozlabs.org/*akpm/mmotm/broken-out/mm-move-helper-to-check-slub_debug_enabled.patch__;fg!!CTRNKA9wMg0ARbw!1fBPodTcBW_dgU-wGXIj5tctPWpUbKNtoT2VjaoMpSJNxExhcHKTWi0A0Aqk9qo$
>  
> 
> Before you just go and hit "reply", please:
>    a) Consider who else should be cc'ed
>    b) Prefer to cc a suitable mailing list as well
>    c) Ideally: find the original patch on the mailing list and do a
>       reply-to-all to that, adding suitable additional cc's
> 
> *** Remember to use Documentation/process/submit-checklist.rst when
> testing your code ***
> 
> The -mm tree is included into linux-next and is updated
> there every 3-4 working days
> 
> ------------------------------------------------------
> From: Marco Elver <elver@google.com>
> Subject: mm: move helper to check slub_debug_enabled
> 
> Move the helper to check slub_debug_enabled, so that we can confine
> the
> use of #ifdef outside slub.c as well.
> 
> Link: 
> https://urldefense.com/v3/__https://lkml.kernel.org/r/20210705103229.8505-2-yee.lee@mediatek.com__;!!CTRNKA9wMg0ARbw!1fBPodTcBW_dgU-wGXIj5tctPWpUbKNtoT2VjaoMpSJNxExhcHKTWi0AbWxImQs$
>  
> Signed-off-by: Marco Elver <elver@google.com>
> Signed-off-by: Yee Lee <yee.lee@mediatek.com>
> Suggested-by: Matthew Wilcox <willy@infradead.org>
> Cc: Alexander Potapenko <glider@google.com>
> Cc: Andrey Konovalov <andreyknvl@gmail.com>
> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
> Cc: Chinwen Chang <chinwen.chang@mediatek.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> Cc: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
> Cc: Nicholas Tang <nicholas.tang@mediatek.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  mm/slab.h |   15 +++++++++++----
>  mm/slub.c |   14 --------------
>  2 files changed, 11 insertions(+), 18 deletions(-)
> 
> --- a/mm/slab.h~mm-move-helper-to-check-slub_debug_enabled
> +++ a/mm/slab.h
> @@ -216,10 +216,18 @@ DECLARE_STATIC_KEY_FALSE(slub_debug_enab
>  #endif
>  extern void print_tracking(struct kmem_cache *s, void *object);
>  long validate_slab_cache(struct kmem_cache *s);
> +static inline bool __slub_debug_enabled(void)
> +{
> +	return static_branch_unlikely(&slub_debug_enabled);
> +}
>  #else
>  static inline void print_tracking(struct kmem_cache *s, void
> *object)
>  {
>  }
> +static inline bool __slub_debug_enabled(void)
> +{
> +	return false;
> +}
>  #endif
>  
>  /*
> @@ -229,11 +237,10 @@ static inline void print_tracking(struct
>   */
>  static inline bool kmem_cache_debug_flags(struct kmem_cache *s,
> slab_flags_t flags)
>  {
> -#ifdef CONFIG_SLUB_DEBUG
> -	VM_WARN_ON_ONCE(!(flags & SLAB_DEBUG_FLAGS));
> -	if (static_branch_unlikely(&slub_debug_enabled))
> +	if (IS_ENABLED(CONFIG_SLUB_DEBUG))
> +		VM_WARN_ON_ONCE(!(flags & SLAB_DEBUG_FLAGS));
> +	if (__slub_debug_enabled())
>  		return s->flags & flags;
> -#endif
>  	return false;
>  }
>  
> --- a/mm/slub.c~mm-move-helper-to-check-slub_debug_enabled
> +++ a/mm/slub.c
> @@ -119,25 +119,11 @@
>   */
>  
>  #ifdef CONFIG_SLUB_DEBUG
> -
>  #ifdef CONFIG_SLUB_DEBUG_ON
>  DEFINE_STATIC_KEY_TRUE(slub_debug_enabled);
>  #else
>  DEFINE_STATIC_KEY_FALSE(slub_debug_enabled);
>  #endif
> -
> -static inline bool __slub_debug_enabled(void)
> -{
> -	return static_branch_unlikely(&slub_debug_enabled);
> -}
> -
> -#else		/* CONFIG_SLUB_DEBUG */
> -
> -static inline bool __slub_debug_enabled(void)
> -{
> -	return false;
> -}
> -
>  #endif		/* CONFIG_SLUB_DEBUG */
>  
>  static inline bool kmem_cache_debug(struct kmem_cache *s)
> _
> 
> Patches currently in -mm which might be from elver@google.com are
> 
> mm-move-helper-to-check-slub_debug_enabled.patch
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-15  1:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-06 20:42 + mm-move-helper-to-check-slub_debug_enabled.patch added to -mm tree akpm
2021-07-15  1:24 ` Yee Lee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.