From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 20193277029 for ; Tue, 7 Jul 2026 20:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783455493; cv=none; b=Egl6Vu+PeuYAgxrRpGZnL2XX+akGlU+1ilWY/JAIZjyVM49p0f6xl76duh4yu3OBzA1+A2++q3NshX2ZzTZ1/El4D3cfqKyYBwlpUXxoytZ+skOU0Zx3mPPA5TfUmriLnQGN1MhVTMnH1ytXTfR8ehjaFumwNhVBTaV6HStTgQg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783455493; c=relaxed/simple; bh=mzUpaaP9Urk/CP67T4cmXADNdqfjqMLeLygzvqX7fK0=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=hKlzf21oQlLcZC9+R8sxKo2OaZ2ObxUibu9obHwuBwrGzFRF7xE/5YzhE3jlg44fG+DmaSRIEHqr+0YEIFb7kZQruxiobBbX0HAkfeZd7H0nsV/NGh38bE/SqKGrh0VzQ+sM9wNs3paQfLavXEpYdseLny2ih36Mmn1wDiEiWdA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=xoKMZzuj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="xoKMZzuj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 063911F000E9; Tue, 7 Jul 2026 20:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783455491; bh=DGRBEgUXIEfD8dcevWghW75nycH77uwjkCcUHva9V7E=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=xoKMZzuj0I8JJZvIEyWy9EMohJxlbDU7BOafGQgQ+aeQ7NRZ8kZIETDvWSnIPCAbI nDkhHAKYR/ofR80su0ojMxOmY4XFt6zdYD1ASYs0OTNRCZPzB+61Ur34t5pMWf0yKY WY4PND6r+tbRW7v8HzA7RmR+PayCfiT1xrpI3t2g= Date: Tue, 7 Jul 2026 13:18:10 -0700 From: Andrew Morton To: Barry Song Cc: "David Hildenbrand (Arm)" , linux-mm@kvack.org, baoquan.he@linux.dev, chrisl@kernel.org, jp.kobryn@linux.dev, kasong@tencent.com, liam@infradead.org, linux-kernel@vger.kernel.org, ljs@kernel.org, mhocko@suse.com, nphamcs@gmail.com, rppt@kernel.org, shakeel.butt@linux.dev, shikemeng@huaweicloud.com, surenb@google.com, usama.arif@linux.dev, vbabka@kernel.org, youngjun.park@lge.com Subject: Re: [PATCH v3 2/4] mm: drop stale folio_ref_count()==1 check in do_swap_page reuse logic Message-Id: <20260707131810.96a4c1c56e00264b311133d8@linux-foundation.org> In-Reply-To: References: <20260701235955.36126-1-baohua@kernel.org> <20260701235955.36126-3-baohua@kernel.org> <3a185a5d-2f2c-4e9d-9cd9-8bdb236dfc5c@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 7 Jul 2026 19:08:13 +0800 Barry Song wrote: > > Sashiko points out two minor things (one flagged as medium, lol, sure sure). > > > > Here, you can clarify that folio_ref_count()==1 is true for freshly allocated > > pages (due to the KSM check) in which case exclusive=true already. > > Hi Andrew, > > I saw that you've queued this in mm-new. Thanks very much for that! > > Would you mind adding the following sentences to the end of the changelog? > > The ksm_might_need_to_copy() check may allocate a fresh folio with > folio_ref_count() == 1. Along that path, exclusive has already been > set to true, so the folio can still be reused correctly. Done, thanks.