From: Christoph Lameter <christoph@lameter.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@osdl.org>,
roland@redhat.com, shai@scalex86.org,
linux-kernel@vger.kernel.org
Subject: Re: [patch] del_timer_sync scalability patch
Date: Tue, 8 Mar 2005 11:44:19 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.58.0503081132210.2571@server.graphe.net> (raw)
In-Reply-To: <20050308081921.GA25679@elte.hu>
On Tue, 8 Mar 2005, Ingo Molnar wrote:
> > > The following patch makes the timer remember where the timer was last
> > > started. It is then possible to only wait for the completion of the timer
> > > on that specific cpu.
>
> i'm not sure about this. The patch adds one more pointer to a very
> frequently used and frequently embedded data structure (struct
> timer_list), for the benefit of a rarely used API variant
> (timer_del_sync()).
Without that pointer there is no information in the timer_list struct as
to where the timer is/was running since base is set to NULL when the timer
function is executed.
> Furthermore, timer->base itself is affine too, a timer always runs on
> the CPU belonging to timer->base. So a more scalable variant of
> del_timer_sync() would perhaps be possible by carefully deleting the
> timer and only going into the full loop if the timer was deleted before.
> (and in which case semantics require us to synchronize on timer
> execution.) Or we could skip the full loop altogether and just
> synchronize with timer execution if _we_ deleted the timer. This should
> work fine as far as itimers are concerned.
There is no easy way to distinguish the case that a timer was deleted
from the case that the timer function is running (which may reschedule
the periodic timer). A scan over all the bases is required to insure that
the timer function is not being executed right now.
If we only would sync when we deleted the timer (meaning timer->base was
!= NULL) then we would not synchronize when the timer function
is executing (and therefore timer->base == NULL). However, we need to sync
exactly in that case because a periodic timer may set timer->base again
when scheduling the next event. That is the main stated purpose of
del_timer_sync.
next prev parent reply other threads:[~2005-03-08 20:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-08 6:47 Christoph Lameter
2005-03-08 7:32 ` Andrew Morton
2005-03-08 8:19 ` Ingo Molnar
2005-03-08 8:33 ` Andrew Morton
2005-03-08 20:05 ` Christoph Lameter
2005-03-08 19:44 ` Christoph Lameter [this message]
2005-03-11 18:54 Oleg Nesterov
2005-03-11 20:57 ` Christoph Lameter
2005-03-13 13:13 ` Oleg Nesterov
2005-03-14 19:40 ` Christoph Lameter
2005-03-15 9:12 ` Oleg Nesterov
2005-03-15 8:06 ` Christoph Lameter
2005-03-15 9:28 ` Ingo Molnar
2005-03-15 10:28 ` Oleg Nesterov
2005-03-20 23:19 Chen, Kenneth W
2005-03-20 23:34 ` Andrew Morton
2005-03-21 0:47 ` Christoph Lameter
2005-03-21 1:00 ` Andrew Morton
2005-03-21 0:54 ` Christoph Lameter
2005-03-21 1:17 ` Andrew Morton
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=Pine.LNX.4.58.0503081132210.2571@server.graphe.net \
--to=christoph@lameter.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
--cc=shai@scalex86.org \
/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®