On Sun, Aug 18, 2024 at 09:40:27PM GMT, Paul E. McKenney wrote: > On Mon, Aug 19, 2024 at 12:16:42AM -0400, Kent Overstreet wrote: > > You can't use a fixed number of callback heads if there's going to be an > > unbounded number of callback heads outstanding. > > The number of rcu_head structures is your choice, based on your choice > of data structure. You can for example link together data elements that > have the same value of get_state_synchronize_rcu() cookie, and use a > single rcu_head structure for that group. You could then do whatever > you want for the linking. > > But even if you do choose to have a large number of rcu_head structures, > perhaps one per data element, there is no law saying that each and every > one of them needs to be passed to call_rcu(). For example, kfree_rcu() > requires an rcu_head structure in the objects passed to it, but in the > common (non-OOM) case, those structures go unused in favor of pages > of pointers. > > So what were you really trying to get across to me here?
Like I said, this needs to run in a fixed amount of memory, so your proposed algorithm doesn't work for having one rcu_head per seq with pending objects.