From: Jiri Pirko <jiri@resnulli.us>
To: David Rientjes <rientjes@google.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, cl@linux.com,
penberg@kernel.org, iamjoonsoo.kim@lge.com,
akpm@linux-foundation.org, vbabka@suse.cz,
roman.gushchin@linux.dev, 42.hyeyoo@gmail.com,
peterz@infradead.org, mingo@kernel.org, danielj@nvidia.com
Subject: Re: [patch RFC] mm/slab: introduce KZALLOC_FREE() cleanup-ed allocation macro
Date: Sat, 16 Mar 2024 16:41:09 +0100 [thread overview]
Message-ID: <ZfW9lVhnClqr9Han@nanopsycho> (raw)
In-Reply-To: <171412ef-1a93-3e56-2b7b-3baf83233eb2@google.com>
Fri, Mar 15, 2024 at 10:39:02PM CET, rientjes@google.com wrote:
>On Fri, 15 Mar 2024, Jiri Pirko wrote:
>
>> From: Jiri Pirko <jiri@nvidia.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.
next prev parent reply other threads:[~2024-03-16 15:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-15 13:22 Jiri Pirko
2024-03-15 21:39 ` David Rientjes
2024-03-16 15:41 ` Jiri Pirko [this message]
2024-03-21 16:26 ` Re " Przemek Kitszel
2024-03-25 19:00 ` Dan Williams
2024-03-27 7:23 ` Przemek Kitszel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZfW9lVhnClqr9Han@nanopsycho \
--to=jiri@resnulli.us \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=danielj@nvidia.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=penberg@kernel.org \
--cc=peterz@infradead.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox