Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4127845yba; Tue, 9 Apr 2019 11:45:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCSG2b0fWLqNifoPVv4Cxv8uIVHlFz3kRd+uTSirkGGqGooyBptcZDwBQyu3nfOFFLHWw+ X-Received: by 2002:a17:902:442:: with SMTP id 60mr39183101ple.107.1554835505252; Tue, 09 Apr 2019 11:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554835505; cv=none; d=google.com; s=arc-20160816; b=jd0A6N6+Upto7KGX4/9D02vG+UNy12keltZgQULG6tiYp0yrvHkhRkj6b9J6Yfmj29 CkEzLfmYOn3kOJXIM5CMwe3scMGZDz4CWzFj5N4rzVzlNgwpfn77qwOjYKebEIAn6jMp iIFMhbsQYA2L291dzO/N4AHFdTjyNN+Pl7VOV56xumaYtl4e7J0Og1vaaFP4ne/ce4up /xr1+ohrIzXUN0bKz9sqQMo0vy60WJHpDk0iW6bvOiFcRyM2hUJ6xGjTShK9E2KC6bM4 8eMC8bikg/Mgnhcyapp6CuV0obPevZp43xvQfNOQVRc68rZr7IpVC1wQfJGKCXkaG68W metQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=VQum5xkYgWrLXwSjhxQf413Vq4UHlR9jwivyiD7Y/bg=; b=N/GsLWriq0ZGmZwfRca/9uWcnXxXgyxNzT9kfe6dkaIND3GRs/9XEd4cQkbCgd4Rwy O5v/VPFgHHh2U/YoTWF5I35BzEsgU6OR3q8LeX8D9tBgpORfjTfkHiaR9VTqOxAiAWEB dsjyGVMP/pJeCNdj6xzUMbMNUipdABeDrrQWGyOfsJ06ukdueR1YmmQ4GQkOlvgFeHec lGC/kaIjXAagQl4S4T5HrzDwqpXPMhW4tljvlSo04LXd+TGudJQvo1fhIPnylgolH9/d IbMpsxkqYAGhFjABfEFh84YfPkgdLKj4eiZxgp9gxF5V9rOUr+M5US653qXx9zhJtC6j afCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=kXiGqdmh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si20774250plz.403.2019.04.09.11.44.49; Tue, 09 Apr 2019 11:45:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=kXiGqdmh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbfDISn5 (ORCPT + 99 others); Tue, 9 Apr 2019 14:43:57 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46793 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbfDISn5 (ORCPT ); Tue, 9 Apr 2019 14:43:57 -0400 Received: by mail-pg1-f193.google.com with SMTP id q1so9805038pgv.13 for ; Tue, 09 Apr 2019 11:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=VQum5xkYgWrLXwSjhxQf413Vq4UHlR9jwivyiD7Y/bg=; b=kXiGqdmhzGJFnZefmVu8+1fsPksdI4g02LjE7x28Geuj4AKDMzgJRrYp32h3ms6d3g 0N49bR9pRDi/Lv0oFonXcgnyf1Jd7Zl+nBo1jWAzsHpyaKXvkHiVAfMd/WeSFAcNyNIg z646DH2Q9kIK4yvL5mpT4iN6IZ3O8IxA0+nt/PSkXPCAZXivhq16YB5hgNn2buWD71e3 epQyVuKRsZpBixpARJt9lSF5qlj02PLMwJgtI7X5U+960mesQJkFOsiOKSUWDzO9BfwL 8vlRAE8FlS2xgPx7Gag/erQ4VlWUYInzpcwNueaGDbfu8zb3OiikTHCZELb6/od9IpXk dqug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=VQum5xkYgWrLXwSjhxQf413Vq4UHlR9jwivyiD7Y/bg=; b=J1i3MIU+392XLYHnXjMaYLLM3ewkR+vClUtnkMRgF7LdIptNvC0wcGTOu4pqURlmLO AtKlNTe8HJ0O5j5bkVa1TlKqxKKQIVxKFvgE3sNH8UwircxYQbVnIngA6kEP9fGLtUz4 cRGkVdqnfBLJLi3P8s8HUxXpnsQMtNYQ9syT7P3gSA5HvtuhZ6vIvbjSkMcpTUMKVElw fc5uKynAhFhH2tDFsz8PgcxwhMC2MI05ChsuBZxs/tBGZCC9MZHAwQ7ALR77upTA8D5X gcPTQwmu5OQR3/KDhw+Qf/qbcmNJ/m1yamv5mSLHtnNGrm/JDTdCysghQIfG2bN3k1lm UZgQ== X-Gm-Message-State: APjAAAWvbWE0gg5d0up7R91SqvTzbcMLhFPK0Eai/8+Of/UknBEA8BOx JrWp15Y8oRrYZw3m+8Xov/eeKA== X-Received: by 2002:aa7:8453:: with SMTP id r19mr39172856pfn.44.1554835435382; Tue, 09 Apr 2019 11:43:55 -0700 (PDT) Received: from [100.112.89.103] ([104.133.8.103]) by smtp.gmail.com with ESMTPSA id v15sm48210009pff.105.2019.04.09.11.43.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Apr 2019 11:43:54 -0700 (PDT) Date: Tue, 9 Apr 2019 11:43:30 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton , Konstantin Khlebnikov cc: Hugh Dickins , "Alex Xu (Hello71)" , Vineeth Pillai , Kelley Nielsen , Rik van Riel , Huang Ying , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 4/4] mm: swapoff: shmem_unuse() stop eviction without igrab() In-Reply-To: <84d74937-30ed-d0fe-c7cd-a813f61cbb96@yandex-team.ru> Message-ID: References: <84d74937-30ed-d0fe-c7cd-a813f61cbb96@yandex-team.ru> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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);