All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
	Jan Kara <jack@suse.cz>, Song Liu <liu.song.a23@gmail.com>
Subject: Re: [PATCH v4] page cache: Store only head pages in i_pages
Date: Wed, 12 Jun 2019 08:42:05 +0100	[thread overview]
Message-ID: <156032532526.2193.13029744217391066047@skylake-alporthouse-com> (raw)
In-Reply-To: <20190612014634.f23fjumw666jj52s@box>

Quoting Kirill A. Shutemov (2019-06-12 02:46:34)
> On Sun, Jun 02, 2019 at 10:47:35PM +0100, Chris Wilson wrote:
> > Quoting Matthew Wilcox (2019-03-07 15:30:51)
> > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> > > index 404acdcd0455..aaf88f85d492 100644
> > > --- a/mm/huge_memory.c
> > > +++ b/mm/huge_memory.c
> > > @@ -2456,6 +2456,9 @@ static void __split_huge_page(struct page *page, struct list_head *list,
> > >                         if (IS_ENABLED(CONFIG_SHMEM) && PageSwapBacked(head))
> > >                                 shmem_uncharge(head->mapping->host, 1);
> > >                         put_page(head + i);
> > > +               } else if (!PageAnon(page)) {
> > > +                       __xa_store(&head->mapping->i_pages, head[i].index,
> > > +                                       head + i, 0);
> > 
> > Forgiving the ignorant copy'n'paste, this is required:
> > 
> > +               } else if (PageSwapCache(page)) {
> > +                       swp_entry_t entry = { .val = page_private(head + i) };
> > +                       __xa_store(&swap_address_space(entry)->i_pages,
> > +                                  swp_offset(entry),
> > +                                  head + i, 0);
> >                 }
> >         }
> >  
> > The locking is definitely wrong.
> 
> Does it help with the problem, or it's just a possible lead?

It definitely solves the problem we encountered of the bad VM_PAGE
leading to RCU stalls in khugepaged. The locking is definitely wrong
though :)
-Chris

  reply	other threads:[~2019-06-12  7:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 15:30 [PATCH v4] page cache: Store only head pages in i_pages Matthew Wilcox
2019-06-01  9:26 ` Chris Wilson
2019-06-01 11:44   ` Chris Wilson
2019-06-02 10:51     ` Matthew Wilcox
2019-06-02 13:11       ` Chris Wilson
2019-06-02 19:28       ` Chris Wilson
2019-06-02 21:47 ` Chris Wilson
2019-06-12  1:46   ` Kirill A. Shutemov
2019-06-12  7:42     ` Chris Wilson [this message]
2019-06-19 10:04       ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=156032532526.2193.13029744217391066047@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liu.song.a23@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.