From: Oleg Nesterov <oleg@tv-sign.ru>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/9] timer locking optimization
Date: Wed, 30 Nov 2005 21:17:29 +0300 [thread overview]
Message-ID: <438DECB9.10E846E0@tv-sign.ru> (raw)
In-Reply-To: <Pine.LNX.4.61.0511301436180.1609@scrub.home>
Roman Zippel wrote:
>
> Hi,
>
> On Wed, 30 Nov 2005, Oleg Nesterov wrote:
>
> > Still not correct, I beleive.
>
> Here is a new idea, what do you think about using spin_trylock(), e.g.
> something like:
>
> if (spin_trylock(&new_base->t_base.lock)) {
> timer->base = &new_base->t_base;
> spin_unlock(&base->lock);
> } else
> new_base = container_of(base, tvec_base_t, t_base);
>
> It's not like we must start the timer on the current cpu and this might
> even be faster. If the new base is busy on another cpu, it's possible we
> have to pull dirty cache lines from the other cpu, where we might already
> have the data from the current base already in the cache from the detach.
... and this will simplify the code! I think this is a nice idea.
Something like this:
if (base != &new_base->t_base) {
if (unlikely(base->running_timer == timer) ||
!spin_trylock(&new_base->t_base.lock)) {
/* The timer remains on a former base */
new_base = container_of(base, tvec_base_t, t_base);
} else {
timer->base = &new_base->t_base;
spin_unlock(&base->lock);
}
}
But please update comments too, and don't forget to cc Ingo and Andrew
at least. In my opinion this patch should go separately from other ptimer
patches.
Oleg.
next prev parent reply other threads:[~2005-11-30 17:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-29 12:57 Oleg Nesterov
2005-11-29 12:17 ` Roman Zippel
2005-11-30 2:32 ` Roman Zippel
2005-11-30 9:59 ` Oleg Nesterov
2005-11-30 15:07 ` Roman Zippel
2005-11-30 18:17 ` Oleg Nesterov [this message]
2005-11-30 11:23 ` Oleg Nesterov
2005-11-30 11:06 ` Roman Zippel
-- strict thread matches above, loose matches on Subject: below --
2005-11-29 1:34 Roman Zippel
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=438DECB9.10E846E0@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=zippel@linux-m68k.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®