[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190316082354.GF15672@dhcp22.suse.cz>
Date: Sat, 16 Mar 2019 09:23:54 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Oscar Salvador <osalvador@...e.de>
Cc: akpm@...ux-foundation.org, anshuman.khandual@....com,
william.kucharski@...cle.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Jan Kara <jack@...e.cz>,
Hugh Dickins <hughd@...gle.com>
Subject: Re: [PATCH] mm: Fix __dump_page when mapping->host is not set
On Fri 15-03-19 15:33:07, Oscar Salvador wrote:
> On Fri, Mar 15, 2019 at 01:47:33PM +0100, Michal Hocko wrote:
> > diff --git a/mm/debug.c b/mm/debug.c
> > index 1611cf00a137..499c26d5ebe5 100644
> > --- a/mm/debug.c
> > +++ b/mm/debug.c
> > @@ -78,6 +78,9 @@ void __dump_page(struct page *page, const char *reason)
> > else if (PageKsm(page))
> > pr_warn("ksm ");
> > else if (mapping) {
> > + if (PageSwapCache(page))
> > + mapping = page_swap_info(page)->swap_file->f_mapping;
> > +
> > pr_warn("%ps ", mapping->a_ops);
> > if (mapping->host->i_dentry.first) {
> > struct dentry *dentry;
>
> This looks like a much nicer fix, indeed.
If we go this way then we should swap the order and print the mapping
before we alter it.
> I gave it a spin and it works.
Thanks for testing!
> Since the mapping is set during the swapon, I would assume that this should
> always work for swap.
> Although I am not sure if once you start playing with e.g zswap the picture can
> change.
>
> Let us wait for Hugh and Jan.
Yes, I really cannot tell this is really safe. Maybe we want to do the
check for host anyway. Just to be sure.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists