Re: [PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

From: Tejun Heo
Date: Wed Mar 21 2018 - 12:40:15 EST


Hey, Oleg.

On Wed, Mar 21, 2018 at 04:58:13PM +0100, Oleg Nesterov wrote:
> > - struct rcu_head free_rcu;
> > - struct work_struct free_work; /* see free_ioctx() */
> > + struct rcu_work free_rwork; /* see free_ioctx() */
>
> IIUC, you can't easily share rcu_work's, thus every kioctx needs its own
> ->free_rwork and this looks sub-optimal.
>
> What do you think about the (untested) patch below?
>
> Oleg.
>
>
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -115,8 +115,10 @@ struct kioctx {
> struct page **ring_pages;
> long nr_pages;
>
> - struct rcu_head free_rcu;
> - struct work_struct free_work; /* see free_ioctx() */
> + union {
> + struct rcu_head free_rcu;
> + struct llist_node free_llist;
> + };

It really depends on how much we want to optimize. Do you think it
matters enough?

Thanks.

--
tejun