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]
Message-ID: <YEjPsfAApvVmO4Jb@dhcp22.suse.cz>
Date:   Wed, 10 Mar 2021 14:54:57 +0100
From:   Michal Hocko <mhocko@...e.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Minchan Kim <minchan@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-mm <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        John Dias <joaodias@...gle.com>,
        David Hildenbrand <david@...hat.com>,
        Jason Baron <jbaron@...mai.com>
Subject: Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

On Wed 10-03-21 13:26:23, Matthew Wilcox wrote:
> On Tue, Mar 09, 2021 at 10:32:51AM +0100, Michal Hocko wrote:
> > Apart from the above, do we have to warn for something that is a
> > debugging aid? A similar concern wrt dump_page which uses pr_warn and
> > page owner is using even pr_alert.
> > Would it make sense to add a loglevel parameter both into __dump_page
> > and dump_page_owner?
> 
> No.  What would make sense is turning __dump_page() inside-out.
> Something like printk("%pP\n");
> 
> In lib/vsprintf.c, there's a big switch statement in the function
> pointer() that handles printing things like IPv6 addresses, dentries,
> and function symbols.
> 
> Then we can do whatever we want around the new %pP, including choosing
> the log level, adding additional information, choosing to dump the page
> to a sysfs file, etc, etc.

Hmm, __dump_page has grown quite some heavy lifting over time and I am
not sure this is a good candidate to put into printk proper (e.g. is it
safe/reasonable to call get_kernel_nofault from printk - aka arbitrary
context)?.

But you've got a point that such a printk format wouldn't need to be 1:1
with the existing __dump_page. There is quite a lot to infer from page
count, map count, flags, page type already. Then a question would be
what is an actual advantage of %pP over dump_page_info(loglvl, p). One I
can see is that %pP would allow to dump the state into a string and so
it would be more versatile but I am not aware of a usecase for that
(maybe tracing?).
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ