Linux-Fsdevel Archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Manish Varma <varmam@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@android.com, Kelly Rossmoyer <krossmo@google.com>
Subject: Re: [PATCH v2] fs: Improve eventpoll logging to stop indicting timerfd
Date: Thu, 1 Apr 2021 02:28:55 +0000	[thread overview]
Message-ID: <YGUv5yIBTFbwuTxB@zeniv-ca.linux.org.uk> (raw)
In-Reply-To: <20210401021645.2609047-1-varmam@google.com>

On Wed, Mar 31, 2021 at 07:16:45PM -0700, Manish Varma wrote:
> timerfd doesn't create any wakelocks, but eventpoll can.  When it does,
> it names them after the underlying file descriptor, and since all
> timerfd file descriptors are named "[timerfd]" (which saves memory on
> systems like desktops with potentially many timerfd instances), all
> wakesources created as a result of using the eventpoll-on-timerfd idiom
> are called... "[timerfd]".
> 
> However, it becomes impossible to tell which "[timerfd]" wakesource is
> affliated with which process and hence troubleshooting is difficult.
> 
> This change addresses this problem by changing the way eventpoll
> wakesources are named:
> 
> 1) the top-level per-process eventpoll wakesource is now named "epoll:P"
> (instead of just "eventpoll"), where P, is the PID of the creating
> process.
> 2) individual per-underlying-filedescriptor eventpoll wakesources are
> now named "epollitemN:P.F", where N is a unique ID token and P is PID
> of the creating process and F is the name of the underlying file
> descriptor.
> 
> All together that should be splitted up into a change to eventpoll and
> timerfd (or other file descriptors).

FWIW, it smells like a variant of wakeup_source_register() that would
take printf format + arguments would be a good idea.  I.e. something
like

> +		snprintf(buf, sizeof(buf), "epoll:%d", task_pid);
> +		epi->ep->ws = wakeup_source_register(NULL, buf);

		... = wakeup_source_register(NULL, "epoll:%d", task_pid);

etc.

  reply	other threads:[~2021-04-01  2:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  2:16 [PATCH v2] fs: Improve eventpoll logging to stop indicting timerfd Manish Varma
2021-04-01  2:28 ` Al Viro [this message]
2021-04-01 23:57   ` Manish Varma
2021-04-01  6:44 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YGUv5yIBTFbwuTxB@zeniv-ca.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=kernel-team@android.com \
    --cc=krossmo@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=varmam@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).