* [PATCH] Documentation: RCU: adopt new coding style of type-aware kmalloc-family - part 2/2
@ 2026-06-27 9:06 Manuel Ebner
2026-06-28 16:13 ` Paul E. McKenney
0 siblings, 1 reply; 2+ messages in thread
From: Manuel Ebner @ 2026-06-27 9:06 UTC (permalink / raw)
To: Paul E . McKenney, Frederic Weisbecker, Neeraj Upadhyay,
Joel Fernandes, Josh Triplett, Boqun Feng, Uladzislau Rezki,
Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan, Zqiang,
Jonathan Corbet, Shuah Khan, open list:DOCUMENTATION, open list,
Kees Cook
Cc: Manuel Ebner
Update Documentation/RCU/* to reflect new type-aware kmalloc-family
as suggested in commit 2932ba8d9c99 ("slab: Introduce kmalloc_obj()
and family")
p = kmalloc(...);
-> p = kmalloc_obj(...);
Signed-off-by: Manuel Ebner <manuelebner@mailbox.org>
---
A similar patch sent by me has been applied. Back then I wasn't familiar
enough to convert all *alloc(*. That's why this is " - part 2/2".
Part 1: f61bf5fdf77d ("Documentation: RCU: adopt new coding style of
type-aware kmalloc-family")
---
Documentation/RCU/rcu_dereference.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/RCU/rcu_dereference.rst b/Documentation/RCU/rcu_dereference.rst
index 2524dcdadde2..5bc3785ebfc2 100644
--- a/Documentation/RCU/rcu_dereference.rst
+++ b/Documentation/RCU/rcu_dereference.rst
@@ -236,7 +236,7 @@ precautions. To see this, consider the following code fragment::
{
struct foo *p;
- p = kmalloc(...);
+ p = kmalloc_obj(*p);
if (p == NULL)
deal_with_it();
p->a = 42; /* Each field in its own cache line. */
@@ -293,7 +293,7 @@ Then one approach is to use locking, for example, as follows::
{
struct foo *p;
- p = kmalloc(...);
+ p = kmalloc_obj(*p);
if (p == NULL)
deal_with_it();
spin_lock(&p->lock);
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Documentation: RCU: adopt new coding style of type-aware kmalloc-family - part 2/2
2026-06-27 9:06 [PATCH] Documentation: RCU: adopt new coding style of type-aware kmalloc-family - part 2/2 Manuel Ebner
@ 2026-06-28 16:13 ` Paul E. McKenney
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2026-06-28 16:13 UTC (permalink / raw)
To: Manuel Ebner
Cc: Frederic Weisbecker, Neeraj Upadhyay, Joel Fernandes,
Josh Triplett, Boqun Feng, Uladzislau Rezki, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, Zqiang, Jonathan Corbet,
Shuah Khan, open list:DOCUMENTATION, open list, Kees Cook
On Sat, Jun 27, 2026 at 11:06:06AM +0200, Manuel Ebner wrote:
> Update Documentation/RCU/* to reflect new type-aware kmalloc-family
> as suggested in commit 2932ba8d9c99 ("slab: Introduce kmalloc_obj()
> and family")
>
> p = kmalloc(...);
> -> p = kmalloc_obj(...);
>
> Signed-off-by: Manuel Ebner <manuelebner@mailbox.org>
Queued for further review, thank you!!!
Thanx, Paul
> ---
> A similar patch sent by me has been applied. Back then I wasn't familiar
> enough to convert all *alloc(*. That's why this is " - part 2/2".
> Part 1: f61bf5fdf77d ("Documentation: RCU: adopt new coding style of
> type-aware kmalloc-family")
> ---
> Documentation/RCU/rcu_dereference.rst | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/RCU/rcu_dereference.rst b/Documentation/RCU/rcu_dereference.rst
> index 2524dcdadde2..5bc3785ebfc2 100644
> --- a/Documentation/RCU/rcu_dereference.rst
> +++ b/Documentation/RCU/rcu_dereference.rst
> @@ -236,7 +236,7 @@ precautions. To see this, consider the following code fragment::
> {
> struct foo *p;
>
> - p = kmalloc(...);
> + p = kmalloc_obj(*p);
> if (p == NULL)
> deal_with_it();
> p->a = 42; /* Each field in its own cache line. */
> @@ -293,7 +293,7 @@ Then one approach is to use locking, for example, as follows::
> {
> struct foo *p;
>
> - p = kmalloc(...);
> + p = kmalloc_obj(*p);
> if (p == NULL)
> deal_with_it();
> spin_lock(&p->lock);
> --
> 2.54.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-28 16:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-27 9:06 [PATCH] Documentation: RCU: adopt new coding style of type-aware kmalloc-family - part 2/2 Manuel Ebner
2026-06-28 16:13 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox