[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZfW9lVhnClqr9Han@nanopsycho>
Date: Sat, 16 Mar 2024 16:41:09 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: David Rientjes <rientjes@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, cl@...ux.com,
penberg@...nel.org, iamjoonsoo.kim@....com,
akpm@...ux-foundation.org, vbabka@...e.cz, roman.gushchin@...ux.dev,
42.hyeyoo@...il.com, peterz@...radead.org, mingo@...nel.org,
danielj@...dia.com
Subject: Re: [patch RFC] mm/slab: introduce KZALLOC_FREE() cleanup-ed
allocation macro
Fri, Mar 15, 2024 at 10:39:02PM CET, rientjes@...gle.com wrote:
>On Fri, 15 Mar 2024, Jiri Pirko wrote:
>
>> From: Jiri Pirko <jiri@...dia.com>
>>
>> With introduction of __free() macro using cleanup infrastructure, it
>> will very likely become quite common to see following pattern:
>> type *var __free(kfree) = kzalloc(sizeof(*var), GFP_KERNEL);
>>
>> To follow the CLASS() flow from cleanup.h, introduce a simple macro
>> KZALLOC_FREE() to wrap this over and allow the same flow.
>>
>> Show an example usage in gpio-sim driver.
>>
>
>Seems highly specialized especially for kzalloc specifically, so not sure
>this warrants its own macro.
Yeah, but having like 2-3 macro variants would probably cover vast
majority of usecases now. The rest could still do things manually.
Powered by blists - more mailing lists