All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: lkp@lists.01.org
Subject: Re: [mm] c8c06efa8b5: -7.6% unixbench.score
Date: Thu, 08 Jan 2015 11:37:08 +0100	[thread overview]
Message-ID: <20150108103708.GE29390@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1420707599.12346.14.camel@stgolabs.net>

[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]

On Thu, Jan 08, 2015 at 12:59:59AM -0800, Davidlohr Bueso wrote:
> > > >     721721 ±  1%    +303.6%    2913110 ±  3%  unixbench.time.voluntary_context_switches
> > > >      11767 ±  0%      -7.6%      10867 ±  1%  unixbench.score

> heh I was actually looking at the reader code. We really do:
> 
> 	/* wait until we successfully acquire the lock */
> 	set_current_state(TASK_UNINTERRUPTIBLE);
> 	while (true) {
> 		if (rwsem_try_write_lock(count, sem))
> 			break;
> 		raw_spin_unlock_irq(&sem->wait_lock);
> 
> 		/* Block until there are no active lockers. */
> 		do {
> 			schedule();
> 			set_current_state(TASK_UNINTERRUPTIBLE);
> 		} while ((count = sem->count) & RWSEM_ACTIVE_MASK);
> 
> 		raw_spin_lock_irq(&sem->wait_lock);
> 	}
> 
> 
> Which still has similar issues with even two barriers, I guess for both
> the rwsem_try_write_lock call (less severe) and count checks. Anyway...

So its actually scheduling a lot more, this could also mean the opt
spinning thing isn't working as well (I've no real idea what the
workload is).

One thing I noticed is that we set sem->owner very late in comparison
with the mutex code, this could cause us to break out of the spin loop
prematurely.

WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Huang Ying <ying.huang@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>, LKP ML <lkp@01.org>
Subject: Re: [LKP] [mm] c8c06efa8b5: -7.6% unixbench.score
Date: Thu, 8 Jan 2015 11:37:08 +0100	[thread overview]
Message-ID: <20150108103708.GE29390@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1420707599.12346.14.camel@stgolabs.net>

On Thu, Jan 08, 2015 at 12:59:59AM -0800, Davidlohr Bueso wrote:
> > > >     721721 ±  1%    +303.6%    2913110 ±  3%  unixbench.time.voluntary_context_switches
> > > >      11767 ±  0%      -7.6%      10867 ±  1%  unixbench.score

> heh I was actually looking at the reader code. We really do:
> 
> 	/* wait until we successfully acquire the lock */
> 	set_current_state(TASK_UNINTERRUPTIBLE);
> 	while (true) {
> 		if (rwsem_try_write_lock(count, sem))
> 			break;
> 		raw_spin_unlock_irq(&sem->wait_lock);
> 
> 		/* Block until there are no active lockers. */
> 		do {
> 			schedule();
> 			set_current_state(TASK_UNINTERRUPTIBLE);
> 		} while ((count = sem->count) & RWSEM_ACTIVE_MASK);
> 
> 		raw_spin_lock_irq(&sem->wait_lock);
> 	}
> 
> 
> Which still has similar issues with even two barriers, I guess for both
> the rwsem_try_write_lock call (less severe) and count checks. Anyway...

So its actually scheduling a lot more, this could also mean the opt
spinning thing isn't working as well (I've no real idea what the
workload is).

One thing I noticed is that we set sem->owner very late in comparison
with the mutex code, this could cause us to break out of the spin loop
prematurely.

  reply	other threads:[~2015-01-08 10:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08  2:27 [mm] c8c06efa8b5: -7.6% unixbench.score Huang Ying
2015-01-08  2:27 ` [LKP] " Huang Ying
2015-01-08  7:45 ` Davidlohr Bueso
2015-01-08  7:45   ` [LKP] " Davidlohr Bueso
2015-01-08  7:50   ` Davidlohr Bueso
2015-01-08  7:50     ` [LKP] " Davidlohr Bueso
2015-01-08  8:59     ` Davidlohr Bueso
2015-01-08  8:59       ` [LKP] " Davidlohr Bueso
2015-01-08 10:37       ` Peter Zijlstra [this message]
2015-01-08 10:37         ` Peter Zijlstra
2015-01-08  8:24   ` Huang Ying
2015-01-08  8:24     ` [LKP] " Huang Ying
2015-01-09  2:47 ` Davidlohr Bueso
2015-01-09  2:47   ` [LKP] " Davidlohr Bueso
2015-01-09  3:03   ` Huang Ying
2015-01-09  3:03     ` [LKP] " Huang Ying
2015-01-09  4:02     ` Davidlohr Bueso
2015-01-09  4:02       ` [LKP] " Davidlohr Bueso
2015-01-09  5:41       ` Huang Ying
2015-01-09  5:41         ` [LKP] " Huang Ying
2015-01-10  2:18         ` Davidlohr Bueso
2015-01-10  2:18           ` [LKP] " Davidlohr Bueso
2015-01-27  7:45       ` Huang Ying
2015-01-27  7:45         ` [LKP] " Huang Ying
2015-01-27 20:43         ` Davidlohr Bueso
2015-01-27 20:43           ` [LKP] " Davidlohr Bueso

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=20150108103708.GE29390@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=lkp@lists.01.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 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.