From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8C45D31A546 for ; Thu, 13 Nov 2025 19:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763060852; cv=none; b=pwWztCq2cBSPbOdaNsa1tIq7C+/J8myOxPpSKvGrdjDpAAJOA4TF7/B+8Miv3Ac9AIOa/zDKUfC0aQpAlKr6YcDiOLdyS5QB1+lgglk1mP7AdBIcURAXLpP2lQ7gMr77JjuMMdkjEj9mrAD+fQzlOkOhDoogkJHhL7CmTin/lHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763060852; c=relaxed/simple; bh=Pl20MoOorbHpmnhcuREwk6NlJ3n1QYtDiM7bqFcyN4g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=A3YinksBAzcK2QDkKa8ZtQx7oMIz0axD2edXNj87Z9I4co+/le7KktO3/5sCVH+nTn4HN+w63XU1QNnFEI/N9dJpKEUv3XhfwTuavSm7o0lbxkPnTGEjLMacrQhWUOFp8HDBDb0ZnM/DnSHibt7OFQr9ItAWOpCb98nJMaljXPM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FP8Qapek; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FP8Qapek" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CB7AC4CEF8; Thu, 13 Nov 2025 19:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763060852; bh=Pl20MoOorbHpmnhcuREwk6NlJ3n1QYtDiM7bqFcyN4g=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FP8QapeksEoDY29Z9X3Ik52OE7/7p/1qL57UQpNU4d24lahTRqcfuVqoIjmsWt7Ba IRfGKYdS8pIA2Mi2ppXxC+R4LEu6vzhPGwmKGuCCJjLq9G3A8EKCMgX48/f7IwkEv4 bsKVeR7qQgx8KOv3JNNRNqxbOC8r+HpKzwQcl+14Bhd1B8hV5fKhQ1BKtKWHp9b71A bk3v5ziNmRLCuRHLIdYZH9bqGxfeilZw4aJBcuNy6HHSFOD8Xif9Jv2UBm7GtWi6V+ zdYK2aNupbePP1GYauWi3fno0QKOKk47tDL12kSAVETC0fjPO9lbyxIEXj4SjIMhAv y3zPTSTvhf5GQ== Message-ID: <75d2254e-51ea-4e59-b706-86664e6c4bab@kernel.org> Date: Thu, 13 Nov 2025 20:07:24 +0100 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] mm/huge_memory.c: introduce split_unmapped_folio_to_order To: Zi Yan , Francois Dugast Cc: Lorenzo Stoakes , Balbir Singh , linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Oscar Salvador , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lyude Paul , Danilo Krummrich , David Airlie , Simona Vetter , Ralph Campbell , =?UTF-8?Q?Mika_Penttil=C3=A4?= , Matthew Brost References: <20251112044634.963360-1-balbirs@nvidia.com> <8ffcbd7a-511e-499b-919d-0c56ccc3c63b@lucifer.local> <389A23ED-106B-413C-B13F-BB0F1E90B6C8@nvidia.com> From: "David Hildenbrand (Red Hat)" Content-Language: en-US In-Reply-To: <389A23ED-106B-413C-B13F-BB0F1E90B6C8@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 13.11.25 17:24, Zi Yan wrote: > On 13 Nov 2025, at 11:02, Lorenzo Stoakes wrote: > >> On Thu, Nov 13, 2025 at 04:36:01PM +0100, Francois Dugast wrote: >>> Hi Balbir, >>> >>> On Wed, Nov 12, 2025 at 03:46:33PM +1100, Balbir Singh wrote: >>>> Unmapped was added as a parameter to __folio_split() and related >>>> call sites to support splitting of folios already in the midst >>>> of a migration. This special case arose for device private folio >>>> migration since during migration there could be a disconnect between >>>> source and destination on the folio size. >>>> >>>> Introduce split_unmapped_folio_to_order() to handle this special case. >>>> This in turn removes the special casing introduced by the unmapped >>>> parameter in __folio_split(). >>> >>> Such a helper would be needed in drm_pagemap_migrate_to_devmem when >>> reallocating a device folio to smaller pages. >>> >>> Could we export it (EXPORT_SYMBOL)? > > drm_pagemap_migrate_to_devmem() is a function defined in tree, you > just need to include huge_mm.h to use split_unmapped_folio_to_order(). > Why do you need to export split_unmapped_folio_to_order()? I guess because DRM_GPUSVM is tristate, so can be built as a module. IIUC, that's where drm_pagemap_migrate_to_devmem() ends up. > >> >> As a rule we don't export things from core mm. And certainly not to non-GPL >> modules. >> >> Unless David feels very differently or there's some enormously compelling >> reason for it I'd really rather we didn't. We'd need a pretty good reason to go down that path indeed :) -- Cheers David