From: Peter Xu <peterx@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
Marcelo Tosatti <mtosatti@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [PATCH v2] timer: document TIMER_PINNED
Date: Fri, 28 Jun 2019 18:55:13 +0800 [thread overview]
Message-ID: <20190628105513.GA10844@xz-x1> (raw)
In-Reply-To: <alpine.DEB.2.21.1906272304480.32342@nanos.tec.linutronix.de>
On Thu, Jun 27, 2019 at 11:10:08PM +0200, Thomas Gleixner wrote:
> On Thu, 27 Jun 2019, Peter Xu wrote:
> > + * @TIMER_PINNED: A pinned timer will not be affected by any timer
> > + * placement heuristics (like, NOHZ) and will always be run on the CPU
> > + * when the timer was enqueued.
>
> s/when/on which/
Fixed.
>
> > + *
> > + * Note: Because enqueuing of timers can actually migrate the timer
> > + * from one CPU to another, pinned timers are not guaranteed to stay
> > + * on the initialy selected CPU. They move to the CPU on which the
> > + * enqueue function is invoked via mod_timer() or add_timer(). If the
> > + * timer should be placed on a particular CPU, then add_timer_on() has
> > + * to be used. It is also suggested that the user should always use
> > + * add_timer_on() explicitly for pinned timers.
>
> That last sentence is not correct. add_timer_on() has limitations over
> mod_timer(). As pinned prevents the timer from being queued on a remote CPU
> mod timer is perfectly fine for many cases.
>
> add_timer_on() is really about queueing a timer on a dedicated CPU, which
> is often enough a remote CPU.
Frankly speaking I still think add_timer_on() is preferred here
because mod_timer() users will really need to be careful to make sure
they'll pin the timers correctly all the time, and I assume that's why
we've tried to find all the TIMER_PINNED users and tried to make sure
there's nothing wrong on using them during previous discussion (and
more than half of them do use add_timer_on() which seems to be good).
In all cases, I'll take your suggestion to drop the last sentence.
Thanks for reviewing this document patch. I'll repost.
--
Peter Xu
prev parent reply other threads:[~2019-06-28 10:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 1:50 Peter Xu
2019-06-27 21:10 ` Thomas Gleixner
2019-06-28 10:55 ` Peter Xu [this message]
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=20190628105513.GA10844@xz-x1 \
--to=peterx@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®