Re: [PATCH v5] fs: Improve eventpoll logging to stop indicting timerfd

From: Isaac Manjarres
Date: Wed Jul 03 2024 - 17:37:29 EST


On Tue, Jun 25, 2024 at 07:58:43PM +0200, Mateusz Guzik wrote:
> On Thu, Jun 06, 2024 at 10:28:11AM -0700, Isaac J. Manjarres wrote:
> > +static atomic_t wakesource_create_id = ATOMIC_INIT(0);
> > static const struct file_operations eventpoll_fops;
> >
> > static inline int is_file_epoll(struct file *f)
> > @@ -1545,15 +1546,21 @@ static int ep_create_wakeup_source(struct epitem *epi)
> > {
> > struct name_snapshot n;
> > struct wakeup_source *ws;
> > + pid_t task_pid;
> > + int id;
> > +
> > + task_pid = task_pid_nr(current);
> >
> > if (!epi->ep->ws) {
> > - epi->ep->ws = wakeup_source_register(NULL, "eventpoll");
> > + id = atomic_inc_return(&wakesource_create_id);
> > + epi->ep->ws = wakeup_source_register(NULL, "epoll:%d:%d", id, task_pid);
>
> How often does this execute? Is it at most once per task lifespan?
Thank you for your feedback! This can execute multiple times throughout
a task's lifespan. However, I haven't seen it execute that often.

> The var probably wants to be annotated with ____cacheline_aligned_in_smp
> so that it does not accidentally mess with other stuff.
>
> I am assuming there is no constant traffic on it.
Right, I don't see much traffic on it. Can you please elaborate a bit
more on what interaction you're concerned with here? If it's a
concern about false sharing, I'm worried that we may be prematurely
optimizing this.

--Isaac