On Tue 03-07-18 18:57:14, 禹舟键 wrote: > Hi Michal > cpuset_print_current_mems_allowed is also invoked by > warn_alloc(page_alloc.c). So, can I remove the current->comm output in > the pr_info ? > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index d8b12e0d39cd..09b8ef6186c6 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -2666,9 +2666,9 @@ void cpuset_print_current_mems_allowed(void) > rcu_read_lock(); > > cgrp = task_cs(current)->css.cgroup; > - pr_info("%s cpuset=", current->comm); > + pr_info(",cpuset="); > pr_cont_cgroup_name(cgrp); > - pr_cont(" mems_allowed=%*pbl\n", > + pr_cont(",mems_allowed=%*pbl", > nodemask_pr_args(¤t->mems_allowed)); Yes, I think so. Just jam the cpuset info to the allocation context warning like this diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1521100f1e63..6bc7d5d4007a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3416,12 +3416,13 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...) va_start(args, fmt); vaf.fmt = fmt; vaf.va = &args; - pr_warn("%s: %pV, mode:%#x(%pGg), nodemask=%*pbl\n", + pr_warn("%s: %pV, mode:%#x(%pGg), nodemask=%*pbl", current->comm, &vaf, gfp_mask, &gfp_mask, nodemask_pr_args(nodemask)); va_end(args); cpuset_print_current_mems_allowed(); + pr_cont("\n"); dump_stack(); warn_alloc_show_mem(gfp_mask, nodemask); -- Michal Hocko SUSE Labs