linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	 Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Hugh Dickins <hughd@google.com>,
	"Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>,
	 Vineeth Pillai <vpillai@digitalocean.com>,
	 Kelley Nielsen <kelleynnn@gmail.com>,
	Rik van Riel <riel@surriel.com>,
	 Huang Ying <ying.huang@intel.com>,
	linux-kernel@vger.kernel.org,  linux-mm@kvack.org
Subject: Re: [PATCH 4/4] mm: swapoff: shmem_unuse() stop eviction without igrab()
Date: Tue, 9 Apr 2019 11:43:30 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LSU.2.11.1904091133570.1898@eggly.anvils> (raw)
In-Reply-To: <84d74937-30ed-d0fe-c7cd-a813f61cbb96@yandex-team.ru>

On Tue, 9 Apr 2019, Konstantin Khlebnikov wrote:
> On 08.04.2019 23:01, Hugh Dickins wrote:
> > -		if (!list_empty(&info->swaplist)) {
> > +		while (!list_empty(&info->swaplist)) {
> > +			/* Wait while shmem_unuse() is scanning this inode...
> > */
> > +			wait_var_event(&info->stop_eviction,
> > +				       !atomic_read(&info->stop_eviction));
> >   			mutex_lock(&shmem_swaplist_mutex);
> >   			list_del_init(&info->swaplist);
> 
> Obviously, line above should be deleted.

Definitely. Worryingly stupid. I guess I left it behind while translating
from an earlier tree.  Many thanks for catching that in time, Konstantin.
I've rechecked the rest of this patch, and the others, and didn't find
anything else as stupid.

Andrew, please add this fixup for folding in - thanks:

[PATCH] mm: swapoff: shmem_unuse() stop eviction without igrab() fix

Fix my stupidity, thankfully caught by Konstantin.

Signed-off-by: Hugh Dickins <hughd@google.com>
---
Fix to fold into mm-swapoff-shmem_unuse-stop-eviction-without-igrab.patch

 mm/shmem.c |    1 -
 1 file changed, 1 deletion(-)

--- patch4/mm/shmem.c	2019-04-07 19:18:43.248639711 -0700
+++ patch5/mm/shmem.c	2019-04-09 11:24:32.745337734 -0700
@@ -1086,7 +1086,6 @@ static void shmem_evict_inode(struct ino
 			wait_var_event(&info->stop_eviction,
 				       !atomic_read(&info->stop_eviction));
 			mutex_lock(&shmem_swaplist_mutex);
-			list_del_init(&info->swaplist);
 			/* ...but beware of the race if we peeked too early */
 			if (!atomic_read(&info->stop_eviction))
 				list_del_init(&info->swaplist);


      reply	other threads:[~2019-04-09 18:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 19:53 [PATCH 0/4] mm: swapoff: fixes for 5.1-rc Hugh Dickins
2019-04-08 19:56 ` [PATCH 1/4] mm: swapoff: shmem_find_swap_entries() filter out other types Hugh Dickins
2019-04-08 19:58 ` [PATCH 2/4] mm: swapoff: remove too limiting SWAP_UNUSE_MAX_TRIES Hugh Dickins
2019-04-08 19:59 ` [PATCH 3/4] mm: swapoff: take notice of completion sooner Hugh Dickins
2019-04-08 20:01 ` [PATCH 4/4] mm: swapoff: shmem_unuse() stop eviction without igrab() Hugh Dickins
2019-04-09  7:50   ` Konstantin Khlebnikov
2019-04-09 18:43     ` Hugh Dickins [this message]

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=alpine.LSU.2.11.1904091133570.1898@eggly.anvils \
    --to=hughd@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex_y_xu@yahoo.ca \
    --cc=kelleynnn@gmail.com \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=riel@surriel.com \
    --cc=vpillai@digitalocean.com \
    --cc=ying.huang@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).