mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: john stultz <johnstul@us.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Torben Hohn <torbenh@gmx.de>,
	linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@tglx.de>
Subject: Re: [PATCH] RFC: abstract access to xtime_lock into a set of inline functions
Date: Fri, 21 Jan 2011 14:57:46 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1101211445170.2971@localhost6.localdomain6> (raw)
In-Reply-To: <AANLkTikS0WAUngUXVx3uCynXt07-1L+=aR5A09XOMtK9@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1612 bytes --]

On Thu, 20 Jan 2011, john stultz wrote:

> On Thu, Jan 20, 2011 at 9:30 AM, Christoph Hellwig <hch@infradead.org> wrote:
> > On Thu, Jan 20, 2011 at 06:14:08PM +0100, Torben Hohn wrote:
> >> the -rt patches change the xtime_lock to a raw_seqlock_t
> >> so a pretty huge portion of the patch deals with changing
> >> the locking functions.
> >>
> >> this commit uses inline functions, to hide the type
> >> of the lock.
> >
> > That's not how kernel code usually works.
> 
> Yea, I'm not a fan of this patch either.
> 
> 
> >> -     write_seqlock(&xtime_lock);
> >> +     xtime_write_seqlock();
> >>       do_timer(1);
> >> -     write_sequnlock(&xtime_lock);
> >> +     xtime_write_sequnlock();
> >
> > However there's a pretty clear pattern of taking xtime_lock, calling
> > do_timer and then releasing.  A useful thing you could do is to rename
> > do_timer to do_timer_locked and make do_timer take and release
> > xtime_lock in one place.
> 
> Seems like a reasonable suggestion.  I suspect there's still quite a
> bit of stuff done under the same lock right around do_timer on a

I looked through the few remaining usage sites in arch/ and there is
really no code inside the locked region which relies on xtime_lock,
AFAICT.

> number of arches, but  having a locked call would cut down on how
> widely xtime is used.

I'd suggest to move do_timer() to kernel/time/timekeeping.c, then add
xtime_update() which takes xtime_lock and calls do_timer(). After that
convert each arch with a separate patch. The last step makes
xtime_lock and do_timer() local to the timekeeping / clockevents code.

Thanks,

	tglx

  parent reply	other threads:[~2011-01-21 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 17:14 Torben Hohn
2011-01-20 17:30 ` Christoph Hellwig
2011-01-20 19:37   ` john stultz
2011-01-21 13:38     ` [PATCH] RFC: change do_timer() to take xtime lock, and provide do_timer_locked() Torben Hohn
2011-01-21 13:59       ` Thomas Gleixner
2011-01-21 13:57     ` Thomas Gleixner [this message]
2011-01-21 13:23   ` [PATCH] RFC: abstract access to xtime_lock into a set of inline functions Yong Zhang

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=alpine.LFD.2.00.1101211445170.2971@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=hch@infradead.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@tglx.de \
    --cc=torbenh@gmx.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®