linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thorsten Leemhuis <regressions@leemhuis.info>
Subject: Re: Hang with v4.15-rc trying to swap back in
Date: Thu, 28 Dec 2017 11:00:40 -0800	[thread overview]
Message-ID: <1514487640.3040.21.camel@HansenPartnership.com> (raw)
In-Reply-To: <1514482907.3040.15.camel@HansenPartnership.com>

On Thu, 2017-12-28 at 09:41 -0800, James Bottomley wrote:
> I'd guess that since they're both in io_schedule, the problem is that
> the io_scheduler is taking far too long servicing the requests due to
> some priority issue you've introduced.

OK, so after some analysis, that turned out to be incorrect. A The
problem seems to be that we're exiting do_swap_page() with locked pages
that have been read in from swap.

Your changelogs are entirely unclear on why you changed the swapcache
setting logic in this patch:

commit 0bcac06f27d7528591c27ac2b093ccd71c5d0168
Author: Minchan Kim <minchan@kernel.org>
Date:A A A Wed Nov 15 17:33:07 2017 -0800

A A A A mm, swap: skip swapcache for swapin of synchronous device

But I think you're using swapcache == NULL as a signal the page came
from a synchronous device. A In which case the bug is that you've
forgotten we may already have picked up a page in
swap_readahead_detect() which you're wrongly keeping swapcache == NULL
for and the fix is this (it works on my system, although I'm still
getting an unaccountable shutdown delay).

I still think we should revert this series, because this may not be the
only bug lurking in the code, so it should go through a lot more
rigorous testing than it has.

James

---

diff --git a/mm/memory.c b/mm/memory.c
index ca5674cbaff2..31f9845c340e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2847,7 +2847,7 @@ EXPORT_SYMBOL(unmap_mapping_range);
 int do_swap_page(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
-	struct page *page = NULL, *swapcache = NULL;
+	struct page *page = NULL, *swapcache;
 	struct mem_cgroup *memcg;
 	struct vma_swap_readahead swap_ra;
 	swp_entry_t entry;
@@ -2892,6 +2892,7 @@ int do_swap_page(struct vm_fault *vmf)
 	if (!page)
 		page = lookup_swap_cache(entry, vma_readahead ? vma : NULL,
 					 vmf->address);
+	swapcache = page;
 	if (!page) {
 		struct swap_info_struct *si = swp_swap_info(entry);
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-12-28 19:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1514398340.3986.10.camel@HansenPartnership.com>
2017-12-27 20:50 ` James Bottomley
2017-12-27 23:26   ` Minchan Kim
2017-12-27 23:34     ` James Bottomley
2017-12-27 23:56       ` Minchan Kim
2017-12-28 17:41         ` James Bottomley
2017-12-28 19:00           ` James Bottomley [this message]
2017-12-29  0:00             ` Minchan Kim
2017-12-29  0:45               ` Minchan Kim
2018-01-17 22:33             ` Hugh Dickins
2018-01-17 22:58               ` Andrew Morton
2018-01-17 23:15                 ` Hugh Dickins

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=1514487640.3040.21.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=regressions@leemhuis.info \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox