From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lgeamrelo07.lge.com (lgeamrelo07.lge.com [156.147.51.103]) (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 9BB541D5147 for ; Sat, 1 Nov 2025 09:08:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.147.51.103 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761988123; cv=none; b=mpyGjIMv3FidaJ8kmsUwURgAeKFnUr1gOGJkh7q458O4n+rmoSfgTtWYnGbVj6TYcTUu68VSQXzKDceiwMpnMm3JEiCOO0kfFwctfDpkQ1m9cVev+3h4EjdRMtmgHUQbHzkBAQ9dYwuOS1j/YL+cC6pfT4CZZoqAcKOFfAKWmtQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761988123; c=relaxed/simple; bh=+6dJDLZcTgjdYhpzK73Dcxd2EjK9ifpHcESZa7cBKG4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CVSS0fq1wGdJ92Tp62aZ0z/R0HED7Uf5CyOba8AkWxBoxrRMQyfQ5V8gas5T4STshIefzxPsnoj4o1A219AhG+taHhOKfoWN5L+TO5TnlBjD39hHdTXZJnHPJc/i4ZWsZ5qiO7w3Vd/vdmsInVeMKC8eCDLU0DAmd/QTv9LoNHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lge.com; spf=pass smtp.mailfrom=lge.com; arc=none smtp.client-ip=156.147.51.103 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lge.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lge.com Received: from unknown (HELO yjaykim-PowerEdge-T330) (10.177.112.156) by 156.147.51.103 with ESMTP; 1 Nov 2025 18:08:33 +0900 X-Original-SENDERIP: 10.177.112.156 X-Original-MAILFROM: youngjun.park@lge.com Date: Sat, 1 Nov 2025 18:08:33 +0900 From: YoungJun Park To: Kairui Song Cc: linux-mm@kvack.org, Andrew Morton , Baoquan He , Barry Song , Chris Li , Nhat Pham , Johannes Weiner , Yosry Ahmed , David Hildenbrand , Hugh Dickins , Baolin Wang , "Huang, Ying" , Kemeng Shi , Lorenzo Stoakes , "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 14/19] mm, swap: sanitize swap entry management workflow Message-ID: References: <20251029-swap-table-p2-v1-0-3d43f3b6ec32@tencent.com> <20251029-swap-table-p2-v1-14-3d43f3b6ec32@tencent.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, Nov 01, 2025 at 04:59:05PM +0800, Kairui Song wrote: > On Sat, Nov 1, 2025 at 12:51 PM YoungJun Park wrote: > > > > On Wed, Oct 29, 2025 at 11:58:40PM +0800, Kairui Song wrote: > > > From: Kairui Song > > During the code review, I found something to be verified. > > It is not directly releavant your patch, > > I send the email for checking it right and possible fix on this patch. > > > > on the swap_alloc_hibernation_slot function > > nr_swap_pages is decreased. but as I think it is decreased on swap_range_alloc. > > > > The nr_swap_pages are decremented as the callflow as like the below. > > > > cluster_alloc_swap_entry -> alloc_swap_scan_cluster > > -> closter_alloc_range -> swap_range_alloc > > > > Introduced on > > 4f78252da887ee7e9d1875dd6e07d9baa936c04f > > mm: swap: move nr_swap_pages counter decrement from folio_alloc_swap() to swap_range_alloc() > > > > Yeah, you are right, that's a bug introduced by 4f78252da887, will you > send a patch to fix that ? Or I can send one, just remove the > atomic_long_dec(&nr_swap_pages) in get_swap_page_of_type then we are > fine. Thank you for double check. I will send a patch soon. Regards, Youngjun Park