From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (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 989E223EAB3 for ; Fri, 20 Mar 2026 03:27:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773977255; cv=none; b=dsHw0H1DfvHD2OXoYjrpb7WdilHxn5XPwjvgHM3ov+Z1S6oMqKDLakHY/OUBVCRGpDStCydQ7aR1YjDcxM0WXZ6crxEZRHtXn44HNHd4+Dm1YIwNHWjNUZ5ngyy2QtfCN91HUviap/7POAFQlRFH4GhaySC24UtjC+/O2UDPUhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773977255; c=relaxed/simple; bh=fIcVpVah7LyCkvcAkZ0WDyewgkYMqrRbH6/CGjnigHk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uc4qvkBHaRyTSNQTwWzvZNRw3dH+abO7co8uuYRrW84erLNqfb9ub6fNC0+bYajg0NWkCMoepjkqBnYD7t2zPFB6WIfEkC9kKCbV2OImmZTgFwNmnfRX1/PnRBX8fSy4IQpVjhYOJUT20dofgwZtZwTQvdXGzHLGKvXv+2eRRMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=AYRAGxI5; arc=none smtp.client-ip=115.124.30.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="AYRAGxI5" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1773977251; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=Josyn2zVO9ro+7tAnU82a7XOF9i0y5Y582jYl2b2RDk=; b=AYRAGxI5kgdugu+WSD2neITsIuYHsBJy2Tc+XiUBJgJycqMEtRs+1XT72FJddpLw/YGyEDdY8/01j1VZepcJwfp7BIwApeSHkIJ42pRwi8UMBX8v6tI0+XDH/3u7U2ZXPEQTiGBFZeLJT2PTrtS5hpeap61TeocY0BJLLkRuvr0= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045133197;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0X.K7pvd_1773977248; Received: from 30.74.144.136(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X.K7pvd_1773977248 cluster:ay36) by smtp.aliyun-inc.com; Fri, 20 Mar 2026 11:27:29 +0800 Message-ID: <655fbfa3-5358-4290-b12e-f20cad2c87b2@linux.alibaba.com> Date: Fri, 20 Mar 2026 11:27:28 +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 Subject: Re: [PATCH v2 5/9] mm/huge_memory: add a common exit path to zap_huge_pmd() To: "Lorenzo Stoakes (Oracle)" , Andrew Morton Cc: David Hildenbrand , Zi Yan , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/19/26 9:00 PM, Lorenzo Stoakes (Oracle) wrote: > Other than when we acquire the PTL, we always need to unlock the PTL, and > optionally need to flush on exit. > > The code is currently very duplicated in this respect, so default > flush_needed to false, set it true in the case in which it's required, then > share the same logic for all exit paths. > > This also makes flush_needed make more sense as a function-scope value (we > don't need to flush for the PFN map/mixed map, zero huge, error cases for > instance). > > Signed-off-by: Lorenzo Stoakes (Oracle) > --- LGTM. Reviewed-by: Baolin Wang