All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch added to mm-hotfixes-unstable branch
@ 2022-11-23 19:57 Andrew Morton
  2022-11-24  7:17 ` Michal Hocko
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2022-11-23 19:57 UTC (permalink / raw)
  To: mm-commits, zokeefe, mhocko, shy828301, akpm


The patch titled
     Subject: mm: replace VM_WARN_ON to pr_warn if the node is offline with __GFP_THISNODE
has been added to the -mm mm-hotfixes-unstable branch.  Its filename is
     mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch

This patch will later appear in the mm-hotfixes-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

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 via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Yang Shi <shy828301@gmail.com>
Subject: mm: replace VM_WARN_ON to pr_warn if the node is offline with __GFP_THISNODE
Date: Wed, 23 Nov 2022 11:30:14 -0800

renamed nid to this_node and gfp to warn_gfp to make the code more
readable per Michal.

Link: https://lkml.kernel.org/r/20221123193014.153983-1-shy828301@gmail.com
Reported-by: syzbot+0044b22d177870ee974f@syzkaller.appspotmail.com
Signed-off-by: Yang Shi <shy828301@gmail.com>
Suggested-by: Michal Hocko <mhocko@suse.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/gfp.h |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

--- a/include/linux/gfp.h~mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4
+++ a/include/linux/gfp.h
@@ -210,14 +210,18 @@ alloc_pages_bulk_array_node(gfp_t gfp, i
 	return __alloc_pages_bulk(gfp, nid, NULL, nr_pages, NULL, page_array);
 }
 
-static inline void warn_if_node_offline(int nid, gfp_t gfp_mask)
+static inline void warn_if_node_offline(int this_node, gfp_t gfp_mask)
 {
-	gfp_t gfp = gfp_mask & (__GFP_THISNODE|__GFP_NOWARN);
+	gfp_t warn_gfp = gfp_mask & (__GFP_THISNODE|__GFP_NOWARN);
 
-	if ((gfp == (__GFP_THISNODE|__GFP_NOWARN)) && !node_online(nid)) {
-		pr_warn("%pGg allocation from offline node %d\n", &gfp, nid);
-		dump_stack();
-	}
+	if (warn_gfp != (__GFP_THISNODE|__GFP_NOWARN))
+		return;
+
+	if(node_online(this_node))
+		return;
+
+	pr_warn("%pGg allocation from offline node %d\n", &warn_gfp, this_node);
+	dump_stack();
 }
 
 /*
_

Patches currently in -mm which might be from shy828301@gmail.com are

mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode.patch
mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch


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

* Re: + mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch added to mm-hotfixes-unstable branch
  2022-11-23 19:57 + mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch added to mm-hotfixes-unstable branch Andrew Morton
@ 2022-11-24  7:17 ` Michal Hocko
  2022-11-28 19:23   ` Yang Shi
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Hocko @ 2022-11-24  7:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, zokeefe, shy828301

On Wed 23-11-22 11:57:55, Andrew Morton wrote:
[...]
> -static inline void warn_if_node_offline(int nid, gfp_t gfp_mask)
> +static inline void warn_if_node_offline(int this_node, gfp_t gfp_mask)
>  {
> -	gfp_t gfp = gfp_mask & (__GFP_THISNODE|__GFP_NOWARN);
> +	gfp_t warn_gfp = gfp_mask & (__GFP_THISNODE|__GFP_NOWARN);
>  
> -	if ((gfp == (__GFP_THISNODE|__GFP_NOWARN)) && !node_online(nid)) {
> -		pr_warn("%pGg allocation from offline node %d\n", &gfp, nid);
> -		dump_stack();
> -	}
> +	if (warn_gfp != (__GFP_THISNODE|__GFP_NOWARN))
> +		return;
> +
> +	if(node_online(this_node))
> +		return;
> +
> +	pr_warn("%pGg allocation from offline node %d\n", &warn_gfp, this_node);

This should be gfp_mask printed, not the filtered part of it.

> +	dump_stack();
>  }
>  
>  /*
> _
> 
> Patches currently in -mm which might be from shy828301@gmail.com are
> 
> mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode.patch
> mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch

-- 
Michal Hocko
SUSE Labs

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

* Re: + mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch added to mm-hotfixes-unstable branch
  2022-11-24  7:17 ` Michal Hocko
@ 2022-11-28 19:23   ` Yang Shi
  0 siblings, 0 replies; 3+ messages in thread
From: Yang Shi @ 2022-11-28 19:23 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Andrew Morton, mm-commits, zokeefe

On Wed, Nov 23, 2022 at 11:17 PM Michal Hocko <mhocko@suse.com> wrote:
>
> On Wed 23-11-22 11:57:55, Andrew Morton wrote:
> [...]
> > -static inline void warn_if_node_offline(int nid, gfp_t gfp_mask)
> > +static inline void warn_if_node_offline(int this_node, gfp_t gfp_mask)
> >  {
> > -     gfp_t gfp = gfp_mask & (__GFP_THISNODE|__GFP_NOWARN);
> > +     gfp_t warn_gfp = gfp_mask & (__GFP_THISNODE|__GFP_NOWARN);
> >
> > -     if ((gfp == (__GFP_THISNODE|__GFP_NOWARN)) && !node_online(nid)) {
> > -             pr_warn("%pGg allocation from offline node %d\n", &gfp, nid);
> > -             dump_stack();
> > -     }
> > +     if (warn_gfp != (__GFP_THISNODE|__GFP_NOWARN))
> > +             return;
> > +
> > +     if(node_online(this_node))
> > +             return;
> > +
> > +     pr_warn("%pGg allocation from offline node %d\n", &warn_gfp, this_node);
>
> This should be gfp_mask printed, not the filtered part of it.

Aha, thanks for catching this. A little bit of rush to send out the
patch before holiday.

>
> > +     dump_stack();
> >  }
> >
> >  /*
> > _
> >
> > Patches currently in -mm which might be from shy828301@gmail.com are
> >
> > mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode.patch
> > mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch
>
> --
> Michal Hocko
> SUSE Labs

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

end of thread, other threads:[~2022-11-28 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 19:57 + mm-replace-vm_warn_on-to-pr_warn-if-the-node-is-offline-with-__gfp_thisnode-v4.patch added to mm-hotfixes-unstable branch Andrew Morton
2022-11-24  7:17 ` Michal Hocko
2022-11-28 19:23   ` Yang Shi

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.