All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yong Zhang <yong.zhang0@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: 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 21:23:49 +0800	[thread overview]
Message-ID: <20110121132349.GB6051@zhy> (raw)
In-Reply-To: <20110120173029.GA26121@infradead.org>

On Thu, Jan 20, 2011 at 12:30:29PM -0500, Christoph Hellwig 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.
> 
> > -	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.

How about adding raw_seqlock just like what we have done for
spinlock? Thus xtime_lock can be defined to raw_seqlock and
others can also benefit from the raw_seqlock like xtime_lock.

Thanks,
Yong

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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 17:14 [PATCH] RFC: abstract access to xtime_lock into a set of inline functions 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     ` [PATCH] RFC: abstract access to xtime_lock into a set of inline functions Thomas Gleixner
2011-01-21 13:23   ` Yong Zhang [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=20110121132349.GB6051@zhy \
    --to=yong.zhang0@gmail.com \
    --cc=hch@infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.