On 6/8/26 15:09, Lorenzo Stoakes wrote:
> On Mon, Jun 08, 2026 at 02:04:28PM +0100, Matthew Wilcox wrote:
>> On Mon, Jun 08, 2026 at 12:06:35PM +0100, Lorenzo Stoakes wrote:
>>> But instead of overloading user_addr to indicate all kinds of things, 
>>> instead
>>> make life easier by actually breaking things out.
>>>
>>> Like:
>>>
>>> enum alloc_context_type {
>>>     KERNEL_ALLOCATION,
>>>     USER_MAPPED_ALLOCATION,
>>>     USER_UNMAPPED_ALLOCATION, // Maybe? Do we ever?
>>>     /* Perhaps some other states we want to encode? */
>>> };
>>>
>>> struct alloc_context {
>>>     ...
>>>
>>>     enum alloc_context_type type;
>>>     unsigned long user_addr; // Only set if type == USER_ALLOCATION
>>>
>>>     // Maybe something suggesting context or whether we init before in some
>>>     // cases?
>>> };
>>
>> Ugh, please, no.  As I suggested last time I commented on this
>> trainwreck of a series, lift the zeroing functionality from
>> alloc_frozen_pages() into its callers.
> 
> I've not looked at the callers closely enough to see the delta on that, but if
> it avoids this mess then also worth looking at yes...

If that means that we would handle __GFP_ZERO consistently in the callers of
alloc_frozen_pages(), that would also do I guess. We'd still have to pass the
user address down to some degree, through folio interfaces only at least.

-- 
Cheers,

David

Reply via email to