From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBCFE386567 for ; Mon, 23 Mar 2026 09:15:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774257359; cv=none; b=LeK+U43sKHnW+kERNKG0DzItqZdz+RTd65qQLmzFy8DtMxksvlsQaR7dAuyU3HamZuKbVp0SOTEQp4odFt1mZ6qx7LRezUizipMTuyRomfKzdCVWFPbHE3tPt0jvUd7AM5JcBd+TcvQm296Axv83uZ+Pn2KWmKytDc9eFo48gbA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774257359; c=relaxed/simple; bh=j4oYL6qJr519y4GMgxzzl1Iz0AsfhhSjwBXRqi9M9rg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YRScxgkwseCc8VQzYKD9g4/NAWOtUEHL96bByg4iguv2vVIBVQoYvTLtBQglmT2jrzym2F1F1ixfwCj+QyMgE7G9aVac6RhB1UhdOfu8IDKwbwvsR0wuKnlpPitkawDZ947bRgZdGzEzrtTplI+uEHBqGieU+PyNvamnfzU7dWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CJtMXh/5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CJtMXh/5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E088C4CEF7; Mon, 23 Mar 2026 09:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774257358; bh=j4oYL6qJr519y4GMgxzzl1Iz0AsfhhSjwBXRqi9M9rg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CJtMXh/5mFNiFj4N7gljp79UzC7Wpd5PCIO2sVXOs96THnKETVMu9Lk7GYiT1Oe89 QYKlimeGSQI7cU22q9Lo9Xj4FqZG59zTvU1V0lScbAzodg3fMhlKlU9Yy4U5US6Xsx cCrxEUYN6Dm7A0kQIMG5gxV2UaHBJnibkBMCSmgwFFqqcoZ6xsZaKVuG0w8qntu6eC 7I1h40xtlN9afAJiWZgOmZ5ExJzeia7CQ+4jelBczCbubPRmvTrnCN7OENAquYNuEl RqxMVsNUbw2bB+jM4oowzF8+AViqDmHUGCcAWX/vV4lKK0rJk6wo2Kf3tT8F89Au3Q jyTDe5OsPgVBw== Date: Mon, 23 Mar 2026 09:15:56 +0000 From: "Lorenzo Stoakes (Oracle)" To: Kexin Sun Cc: akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com, shikemeng@huaweicloud.com, nphamcs@gmail.com, bhe@redhat.com, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, hannes@cmpxchg.org, david@kernel.org, mhocko@kernel.org, zhengqi.arch@bytedance.com, shakeel.butt@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, julia.lawall@inria.fr, xutong.ma@inria.fr, yunbolyu@smu.edu.sg, ratnadiraw@smu.edu.sg Subject: Re: [PATCH] mm: update outdated comments for removed scan_swap_map_slots() Message-ID: <5ce23372-c179-4b98-b338-fb6bd807a207@lucifer.local> References: <20260321105814.7053-1-kexinsun@smail.nju.edu.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260321105814.7053-1-kexinsun@smail.nju.edu.cn> -cc old email address +cc new (Gentle hint to send new mail to ljs@kernel.org :) On Sat, Mar 21, 2026 at 06:58:14PM +0800, Kexin Sun wrote: > The function scan_swap_map_slots() was removed in commit > 0ff67f990bd4 ("mm, swap: remove swap slot cache"). > > The three comments referencing it simply noted that ->flags can be > updated non-atomically by scan_swap_map_slots() to justify a > data_race() annotation. Since the function no longer exists, drop > the parenthetical reference while keeping the data_race() > justification intact: ->flags can still be updated non-atomically > by other paths (e.g., swapoff clearing SWP_WRITEOK). > > Assisted-by: unnamed:deepseek-v3.2 coccinelle > Signed-off-by: Kexin Sun LGTM, so: Reviewed-by: Lorenzo Stoakes (Oracle) > --- > mm/page_io.c | 4 ++-- > mm/vmscan.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/mm/page_io.c b/mm/page_io.c > index a2c034660c80..330abc5ab7b4 100644 > --- a/mm/page_io.c > +++ b/mm/page_io.c > @@ -450,14 +450,14 @@ void __swap_writepage(struct folio *folio, struct swap_iocb **swap_plug) > > VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio); > /* > - * ->flags can be updated non-atomically (scan_swap_map_slots), > + * ->flags can be updated non-atomically, > * but that will never affect SWP_FS_OPS, so the data_race > * is safe. > */ > if (data_race(sis->flags & SWP_FS_OPS)) > swap_writepage_fs(folio, swap_plug); > /* > - * ->flags can be updated non-atomically (scan_swap_map_slots), > + * ->flags can be updated non-atomically, > * but that will never affect SWP_SYNCHRONOUS_IO, so the data_race > * is safe. > */ > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 0fc9373e8251..0758ef3b100b 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1070,7 +1070,7 @@ static bool may_enter_fs(struct folio *folio, gfp_t gfp_mask) > /* > * We can "enter_fs" for swap-cache with only __GFP_IO > * providing this isn't SWP_FS_OPS. > - * ->flags can be updated non-atomically (scan_swap_map_slots), > + * ->flags can be updated non-atomically, > * but that will never affect SWP_FS_OPS, so the data_race > * is safe. > */ > -- > 2.25.1 >