From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from outbound.st.icloud.com (p-east2-cluster6-host11-snip4-10.eps.apple.com [57.103.76.241]) (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 C4D26CA4E for ; Sun, 28 Jun 2026 16:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.76.241 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782663014; cv=none; b=ZstutnWEzylsH9kBxZSbLh8X0PQI2fvSwXTT54xN1RCwmzcEraoJEYuW9Qf31KZcXT2lgjjaL6aMijDf/j5QZ9+X7YT37JGV5vLVY77ovLRvskbLkrFdkC6xnZIvIojtmQgi7huVnX+u1L2jxi+AKEb54Am1oMlQUXF+IxXbGLM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782663014; c=relaxed/simple; bh=GaBNDeR2xfrwSpodfoIAyoWtjJIBJ4SFFIvZEX+sTsM=; h=Message-ID:Date:MIME-Version:To:Cc:References:Subject:From: In-Reply-To:Content-Type; b=tKFsqlLj/X5rImCC7x9nM8mb0OsFYMtb8BsVTsQFGpsuUQXiH4KEwthWxDNr5SFhiyp5dYe57C5m0I9ZvIf6bH2WMY37wMa8dJBAgTr8kBsvCkbqNe77TInAsgkJBQcAuRKLnjY3J6pBzCHYzbckNHUi/WyaRxG7Xlulx3ITkcY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=sr3e2g9F; arc=none smtp.client-ip=57.103.76.241 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="sr3e2g9F" Received: from outbound.st.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-1a-100-percent-10 (Postfix) with ESMTPS id 73C491800377; Sun, 28 Jun 2026 16:10:10 +0000 (UTC) X-ICL-RepId: 019f0efe-d85c-7b15-90b6-30e986067b6c X-ICL-Out-Info: HUtFAUMEWwJACUgATUQeDx5WFlZNRAJCTQhKB0MGWQReCEsLQwZcBlBcHA4XXhtCFUsVXANcDkswUBtfAkIPHBNWFRMLU1ZbE1UXRgkZCF0dGQpQUAVaEhhcFFxQWB5GElYNXQkZGEZeUBtfAkIPHBNWFRMdQxkPKwhKBEMHRQJeCyUTCVNWWxNVF0YJGQhdHRkVWgkKV1FFXxoGWgZTH0BfSwFAA1wKRxRABQwGRgFJWB4DCw9cUUUOTHMEVAddBV1WUAJaVRIEQAhWUF4IXh9MHA== Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1782663012; x=1785255012; bh=GaBNDeR2xfrwSpodfoIAyoWtjJIBJ4SFFIvZEX+sTsM=; h=Message-ID:Date:MIME-Version:To:Subject:From:Content-Type:x-icloud-hme; b=sr3e2g9FhA9S9fg6JXADqte276Zg6oprY2kmpQI32kgEA3C/ekmvaiarOHTZNVGXyUkmLzqrQg2G7V+FGT1J1xh2Ll4thyuR0HSfX+PqsIOZ5KqLgtN7WicLDib+5dbRXZ1xC5R9Tm1QW9Imfq1ZVoGULK6mSv4ssIZMbAP48PT6NYOK1JSWi4DWTDhWvVTtBJHGEDe5nOI2uwbUQlsQnfmRCMYCVA0P/+jyYU0tXMP1HxkNbP9/cR+DZPkUS8FYBwjxAr28M8VQEE1G26iEOEZtd2/WO4DdyxznVRxOCNnst/oW1o76oL8cb28YHsAvBfEeZoaWvLMQ/PmL33CEfA== Received: from [192.168.255.10] (unknown [17.42.251.67]) by p00-icloudmta-asmtp-us-east-1a-100-percent-10 (Postfix) with ESMTPSA id 378D01800105; Sun, 28 Jun 2026 16:10:01 +0000 (UTC) Message-ID: Date: Mon, 29 Jun 2026 00:09:55 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: david@kernel.org Cc: akpm@linux-foundation.org, axelrasmussen@google.com, baohua@kernel.org, bruzzhang@tencent.com, hannes@cmpxchg.org, kasong@tencent.com, liam@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ljs@kernel.org, mhocko@kernel.org, mhocko@suse.com, qi.zheng@linux.dev, rppt@kernel.org, shakeel.butt@linux.dev, surenb@google.com, vbabka@kernel.org, weixugc@google.com, yuanchu@google.com, zippermonkey@icloud.com References: Subject: Re: [PATCH v4 2/5] mm/vmscan: extract folio_free() from shrink_folio_list() From: Zhang Peng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjI4MDE0NCBTYWx0ZWRfX5CSM3oh0hUoy RuDw3kshCgBSe48wJ4S5LKw3ulTRgkpS96dQ2gCevoTjosZEZwd0RFzrXkEAu4k7vs75+3KYuJT 5huOCGXSeM96jGWgH6pa1ov9pIKy6S5Rb/mwd7qb354DA6t4Xe1rb38wBv6TWg/0kz3aW/TeaDy 1RxiSmRTGH2ziyHll1vtk38jhF6Hi0irDG8bo2xqaz4UP50qSrnIXlIlCgKd6LRa+4ZkpGEOy+s eM9qL6XnsSW3K+jGSnWUR1p1qonhpXvtEhUJpIsgkrQsB+a7L3p78sZcsy4CH78Of9ltglmVtjS oIL+dc0Eg7pAw1hSMCI X-Proofpoint-ORIG-GUID: -OBesckUmrxjzLRpCYceLOHYbKCzqiKE X-Proofpoint-GUID: -OBesckUmrxjzLRpCYceLOHYbKCzqiKE On Wed, Jun 17, 2026 at 02:17:53PM +0200, David Hildenbrand wrote: > I don't quite like the function name, as it sounds like something very > generic, when it's really specific to memory reclaim code ... On Wed, Jun 17, 2026 at 02:24:24PM +0200, David Hildenbrand wrote: > Stumbling over patch #4, I think if we call this something with a > "try", a bool would be fine. Right, renamed to folio_try_reclaim_free().  try_ + bool reads naturally, and the name makes it obvious this isn't a generic free. > You can just drop the "else", no? > VM_WARN_ON_FOLIO_ONCE(folio_ref_count(folio), folio); > Likely can shorten ... Or just drop the comment completely All done — dropped the else, added the refcount assert at free_it, removed the stale "swapped out as a whole" comment.  Also made nr_pages const and reflowed the buffer-release comment to use the extra columns.