From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 A47BC4A340F for ; Thu, 11 Jun 2026 18:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781201640; cv=none; b=QK7NbjYXrfzZgV/G/h+EksID1CzrIvFgK6XtobgXUKukWw+3aIij5KjnnrzAn03azbkKKRUL5KCu+seYj5DPXnTi7ujkUi+360LgHGf+pB1NotTCAS4vEcQj94QHyfg9XUoy7aqLwaBbc4e7RzNiqTzyMPBBBVhQD/xe43vZQhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781201640; c=relaxed/simple; bh=5t1oysWHztgg2HVnaaYpHJ19NQkm2cPM1B0uYUPNMwI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=baEX3LiNNccUK8RpTqE8m98pV/xpV+tsz3EID5UHPomvrWJO4fNgvxvMdjicFmqU40M48jXsfaYkBwP5KiTsPSeeQJ3M7iS7q5aCEjYKMAVHbGfNaIscG4NIKCafqioqfagF1iQlVDCmvf/5Oh/+cc7EpldR1No2UOTE2s88wzY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YtBujQXv; arc=none smtp.client-ip=95.215.58.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YtBujQXv" Date: Thu, 11 Jun 2026 11:12:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781201631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=I+NORQ2IRJIRisTTgzwSC0LkRdLJJYwziNqvDlRjm08=; b=YtBujQXvREAfYj88Bkz7J0KTKXdpb6DCTXgnZmaYWRSdEnNHuF1XQmRjKXVrhTo4NJ/uLN 52wXFWxEtZVVxD620XfeUWfRsBHum4RlikaxCX44LJ3zGkzklN0lxPmhD+PBN56CAxplxO rD3KRB0AR1mtZpIiKAIZ11HNLcCcG2s= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: "Barry Song (Xiaomi)" Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@kernel.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, chrisl@kernel.org, kasong@tencent.com, shikemeng@huaweicloud.com, nphamcs@gmail.com, baoquan.he@linux.dev, youngjun.park@lge.com, jp.kobryn@linux.dev, usama.arif@linux.dev Subject: Re: [RFC PATCH 2/3] mm: drop stale folio_ref_count()==1 check in do_swap_page reuse logic Message-ID: References: <20260611105124.98668-1-baohua@kernel.org> <20260611105124.98668-3-baohua@kernel.org> 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: <20260611105124.98668-3-baohua@kernel.org> X-Migadu-Flow: FLOW_OUT On Thu, Jun 11, 2026 at 06:51:23PM +0800, Barry Song (Xiaomi) wrote: > The "we just allocated them without exposing them to the swapcache" > case no longer exists, as Kairui has routed synchronous I/O through > the swapcache as well in his series "unify swapin use swap cache and > cleanup flags"[1]. As a result, folio_ref_count() should never be 1 > in this path, since at least two references are held (base ref plus > swapcache). Remove the folio_ref_count()==1 check and update the > comment accordingly. > > [1] https://lore.kernel.org/all/20251220-swap-table-p2-v5-0-8862a265a033@tencent.com/ > Signed-off-by: Barry Song (Xiaomi) Acked-by: Shakeel Butt