LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Petr Tesarik <ptesarik@suse.cz>
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
	tee@sgi.com, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 1/2] Allow rwlocks to re-enable interrupts
Date: Wed, 22 Oct 2008 19:24:31 +0200	[thread overview]
Message-ID: <1224696271.20069.8.camel@twins> (raw)
In-Reply-To: <1224665899.4430.48.camel@elijah.suse.cz>

On Wed, 2008-10-22 at 10:58 +0200, Petr Tesarik wrote:
> On Wed, 2008-10-22 at 10:45 +0200, Peter Zijlstra wrote:
> > On Wed, 2008-10-22 at 10:34 +0200, Petr Tesarik wrote:
> > > c b/kernel/spinlock.c
> > > index 29ab207..f769d8a 100644
> > > --- a/kernel/spinlock.c
> > > +++ b/kernel/spinlock.c
> > > @@ -121,7 +121,11 @@ unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
> > >  	local_irq_save(flags);
> > >  	preempt_disable();
> > >  	rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
> > > +#ifdef CONFIG_LOCKDEP
> > >  	LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock);
> > > +#else
> > > +	_raw_read_lock_flags(lock, &flags);
> > > +#endif
> > >  	return flags;
> > >  }
> > 
> > That should be CONFIG_LOCK_STAT.
> 
> Ugh. Fine with me, but is CONFIG_LOCKDEP correct in _spin_lock_irqsave,
> or should it also read CONFIG_LOCK_STAT?

Yep.

> > But aside from that, I really don't like this change, I'd rather you'd
> > create a LOCK_CONTENDED_FLAGS() that can deal with this.
> 
> No problem. I could then also use it for _spin_lock_irqsave, if the
> answer to the above question is use CONFIG_LOCK_STAT there as well.

If you create LOCK_CONTEDED_FLAGS() the whole issue goes away nicely.

  reply	other threads:[~2008-10-22 17:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-22  8:33 [PATCH 0/2] enable irqs when waiting for rwlocks Petr Tesarik
2008-10-22  8:34 ` [PATCH 1/2] Allow rwlocks to re-enable interrupts Petr Tesarik
2008-10-22  8:45   ` Peter Zijlstra
2008-10-22  8:58     ` Petr Tesarik
2008-10-22 17:24       ` Peter Zijlstra [this message]
2008-10-22 19:05         ` Matthew Wilcox
2008-10-22 19:19           ` Peter Zijlstra
2008-10-22 17:31 ` [PATCH 0/2] enable irqs when waiting for rwlocks Rick Jones
2008-10-23 14:12   ` Robin Holt

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=1224696271.20069.8.camel@twins \
    --to=peterz@infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=ptesarik@suse.cz \
    --cc=tee@sgi.com \
    --subject='Re: [PATCH 1/2] Allow rwlocks to re-enable interrupts' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).