From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout10.his.huawei.com (canpmsgout10.his.huawei.com [113.46.200.225]) (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 31823217736 for ; Tue, 25 Nov 2025 09:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.225 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764061825; cv=none; b=eUWXUDBb3QqEidGF3EWIyk39TGOH8Xc8htr4kiVzKvSQjrtKa4OI4/TsX12bVxVbV99mPbKTlHeRMo+1oFzf/YhkeRwPbCvGAxfME6uraMaMOwGo6mR+Tk1gSIzTRXlTTff1kTZBfdF6eomssDFzsDE+B1AYjal8KPOFA+fwyZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764061825; c=relaxed/simple; bh=BAXb9mSv7gOhKIIm0fW3RAG+LY5DgiKXku7qT1RWjH0=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=q1z0xY7/3/J6ylu8lOZRq28KIQJX0+UdHwpPgunytp1Ux85y9trCME7B8NPp0HGa8lePyYEb9QbtyWFJaqT4Dt57b7msBNBQmPAyduLmkjtCrP5LzBSGut4N6oos6o0DjniskpKuRCKO1S5PFjj/vIXsXOELfKEi4reGSlMw+z4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=r7dexYiF; arc=none smtp.client-ip=113.46.200.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="r7dexYiF" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=fkPO+JMkDG1D42iF1klXuu9GSgaYKiSAv7mDALfM48U=; b=r7dexYiFIm2hCk7dul94a1FjT4HB7yfQvfavfRvzS8+KcaZ/CZdxOqCGrQx/m1leD0JKmpN68 l0h/1XbGYPCbUYTqNPijWgfObmPF85SKSVv765bINaHz+4ZTQReSV1mL3/FUhsiVwnUsitXkBIs QfrseM6JUXhcJhyIVmQFp+4= Received: from mail.maildlp.com (unknown [172.19.88.234]) by canpmsgout10.his.huawei.com (SkyGuard) with ESMTPS id 4dFxgk0CHFz1K97x; Tue, 25 Nov 2025 17:08:34 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id BAB161401E0; Tue, 25 Nov 2025 17:10:19 +0800 (CST) Received: from kwepemq500010.china.huawei.com (7.202.194.235) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 25 Nov 2025 17:10:19 +0800 Received: from [10.173.125.37] (10.173.125.37) by kwepemq500010.china.huawei.com (7.202.194.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 25 Nov 2025 17:10:18 +0800 Subject: Re: [PATCH v2 2/4] mm/huge_memory: replace can_split_folio() with direct refcount calculation To: Zi Yan , "David Hildenbrand (Red Hat)" CC: Lorenzo Stoakes , Andrew Morton , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Naoya Horiguchi , Wei Yang , Balbir Singh , , References: <20251122025529.1562592-1-ziy@nvidia.com> <20251122025529.1562592-3-ziy@nvidia.com> <33A929D1-7438-43C1-AA4A-398183976F8F@nvidia.com> <34bafd06-250a-4019-8b34-5ddeedea1cb3@kernel.org> <66C159D8-D267-4B3B-9384-1CE94533990E@nvidia.com> From: Miaohe Lin Message-ID: <6cce0756-cfe1-7b39-d81a-ba1b2cb32fb5@huawei.com> Date: Tue, 25 Nov 2025 17:10:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <66C159D8-D267-4B3B-9384-1CE94533990E@nvidia.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems200002.china.huawei.com (7.221.188.68) To kwepemq500010.china.huawei.com (7.202.194.235) On 2025/11/25 5:08, Zi Yan wrote: > On 24 Nov 2025, at 14:22, David Hildenbrand (Red Hat) wrote: > > > BTW, this page flag reuse is really confusing. I see PG_checked is > PG_owner_priv_1 too and __folio_migrate_mapping() uses folio_test_swapcache() > to decide the number of i_pages entries. Wouldn’t that cause any issue? > ext4 does not release_folio() for migration when PG_checked is set, > ubifs clears PG_checked in release_folio(). I have not checked all other FS > yet. Maybe later. folio_test_swapbacked() is also checked in folio_test_swapcache: static __always_inline bool folio_test_swapcache(struct folio *folio) { return folio_test_swapbacked(folio) && test_bit(PG_swapcache, folio_flags(folio, 0)); } So IMHO the reuse of this page flag should work fine. Thanks. .