lkml.org 
[lkml]   [2020]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH tip/core/rcu 1/2] rcu: Support kfree_bulk() interface in kfree_rcu()
> > 
> > +/*
> > + * This macro defines how many entries the "records" array
> > + * will contain. It is based on the fact that the size of
> > + * kfree_rcu_bulk_data structure becomes exactly one page.
> > + */
> > +#define KFREE_BULK_MAX_ENTR ((PAGE_SIZE / sizeof(void *)) - 3)
> > +
>
> Why use the "magic" number "3" here? Could we just define struct
> kfree_rcu_bulk_data as:
>
> struct kfree_rcu_bulk_data {
> struct kfree_rcu_bulk_data *next;
> struct rcu_head *head_free_debug;
> unsigned long nr_records;
> void *records[];
> }
>
> ?
>
> And the the above macro becomes:
>
> #define KFREE_BULK_MAX_ENTR ((PAGE_SIZE - sizeof(struct kfree_rcu_bulk_data)) / sizeof(void *))
>
That should work. I agree that looks better :)

We can fix that by submitting a separate patch.

Thank you!

--
Vlad Rezki

\
 
 \ /
  Last update: 2020-02-24 17:12    [W:0.046 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site