linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	quic_stummala@quicinc.com, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, quic_pkondeti@quicinc.com,
	quic_sayalil@quicinc.com, quic_aiquny@quicinc.com,
	quic_zljing@quicinc.com, quic_blong@quicinc.com,
	quic_richardp@quicinc.com, quic_cdevired@quicinc.com,
	Pradeep P V K <quic_pragalla@quicinc.com>
Subject: Re: [PATCH V1] fuse: give wakeup hints to the scheduler
Date: Tue, 7 Dec 2021 11:20:59 +0100	[thread overview]
Message-ID: <CAJfpegsVg2K0CvrPvXGSu=Jz_R3VZZOy49Jw51rThQUJ1_9e6g@mail.gmail.com> (raw)
In-Reply-To: <Ya8ycLODlcvLx4xB@hirez.programming.kicks-ass.net>

On Tue, 7 Dec 2021 at 11:07, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Tue, Dec 07, 2021 at 10:07:45AM +0100, Miklos Szeredi wrote:
> > On Mon, 6 Dec 2021 at 09:47, Pradeep P V K <quic_pragalla@quicinc.com> wrote:
> > >
> > > The synchronous wakeup interface is available only for the
> > > interruptible wakeup. Add it for normal wakeup and use this
> > > synchronous wakeup interface to wakeup the userspace daemon.
> > > Scheduler can make use of this hint to find a better CPU for
> > > the waker task.
>
> That's a horrendoubly bad changelog :-/ Also, if you need it for
> UNINTERRUPTIBLE that's trivial to do ofc.
>
> > Ingo, Peter,
> >
> > What exactly does WF_SYNC do?   Does it try to give the waker's CPU
> > immediately to the waked?
> >
> > If that doesn't work (e.g. in this patch the wake up is done with a
> > spin lock held) does it do anything?
> >
> > Does it give a hint that the waked task should be scheduled on this
> > CPU at the next scheduling point?
>
> WF_SYNC is a hint to the scheduler that the waker is about to go sleep
> and as such it is reasonable to stack the woken thread on this CPU
> instead of going to find an idle CPU for it.
>
> Typically it also means that the waker and wakee share data, and thus
> having them share the CPU is beneficial for cache locality.

Okay, so it doesn't give up the CPU immediately to the woken task,
just marks the woken task as a "successor" when the current task goes
to sleep.  Right?

That may be good for fuse as the data is indeed shared.  It would be
even better if the woken task had already a known affinity to this
CPU, since that would mean thread local data wouldn't have to be
migrated each time...   So I'm not sure sync wakeup alone is worth it,
needs real life benchmarking.

Thanks,
Miklos

  reply	other threads:[~2021-12-07 10:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06  8:46 [PATCH V1] fuse: give wakeup hints to the scheduler Pradeep P V K
2021-12-07  9:07 ` Miklos Szeredi
2021-12-07 10:07   ` Peter Zijlstra
2021-12-07 10:20     ` Miklos Szeredi [this message]
2021-12-07 10:41       ` Peter Zijlstra
2021-12-07 12:44         ` Miklos Szeredi
2021-12-07 13:45           ` Peter Zijlstra
2021-12-07 13:51             ` Peter Zijlstra
2021-12-07 14:03               ` Miklos Szeredi
2021-12-07 14:25                 ` Peter Zijlstra
2021-12-08 15:46                   ` Miklos Szeredi
2021-12-09 13:23                     ` Shachar Sharon
2022-12-22  9:34 ` qixiaoyu

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='CAJfpegsVg2K0CvrPvXGSu=Jz_R3VZZOy49Jw51rThQUJ1_9e6g@mail.gmail.com' \
    --to=miklos@szeredi.hu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=quic_aiquny@quicinc.com \
    --cc=quic_blong@quicinc.com \
    --cc=quic_cdevired@quicinc.com \
    --cc=quic_pkondeti@quicinc.com \
    --cc=quic_pragalla@quicinc.com \
    --cc=quic_richardp@quicinc.com \
    --cc=quic_sayalil@quicinc.com \
    --cc=quic_stummala@quicinc.com \
    --cc=quic_zljing@quicinc.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 NNTP newsgroup(s).