[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1239296031.21985.28.camel@twins>
Date: Thu, 09 Apr 2009 18:53:51 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Heiko Carstens <heiko.carstens@...ibm.com>
Cc: Ingo Molnar <mingo@...e.hu>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mutex: have non-spinning mutexes on s390 by default
On Thu, 2009-04-09 at 18:48 +0200, Heiko Carstens wrote:
> Updated Patch below:
>
> Subject: [PATCH] mutex: have non-spinning mutexes on s390 by default
>
> From: Heiko Carstens <heiko.carstens@...ibm.com>
>
> The adaptive spinning mutexes will not always do what one would expect on
> virtualized architectures like s390. Especially the cpu_relax() loop in
> mutex_spin_on_owner might hurt if the mutex holding cpu has been scheduled
> away by the hypervisor.
> We would end up in a cpu_relax() loop when there is no chance that the
> state of the mutex changes until the target cpu has been scheduled again by
> the hypervisor.
> For that reason we should change the default behaviour to no-spin on s390.
>
> We do have an instruction which allows to yield the current cpu in favour of
> a different target cpu. Also we have an instruction which allows us to figure
> out if the target cpu is physically backed.
>
> However we need to do some performance tests until we can come up with
> a solution that will do the right thing on s390.
>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Acked-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
I was looking at how an monitor-wait could be used here, but that
appears non-trivial, there's two variables we're watching, lock->owner
and rq->curr, either could change.
Reducing that to 1 seems an interesting problem :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists