lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Jul 2018 13:03:35 +0200
From:   Michal Hocko <mhocko@...nel.org>
To:     禹舟键 <ufo19890607@...il.com>
Cc:     akpm@...ux-foundation.org, rientjes@...gle.com,
        kirill.shutemov@...ux.intel.com, aarcange@...hat.com,
        penguin-kernel@...ove.sakura.ne.jp, guro@...com,
        yang.s@...baba-inc.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Wind Yu <yuzhoujian@...ichuxing.com>
Subject: Re: [PATCH v11 1/2] Refactor part of the oom report in dump_header

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(&current->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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ