From: Peter Zijlstra <peterz@infradead•org>
To: Pan Xinhui <xinhui.pan@linux•vnet.ibm.com>
Cc: linuxppc-dev@lists•ozlabs.org, linux-kernel@vger•kernel.org,
paulmck@linux•vnet.ibm.com, mingo@redhat•com, mpe@ellerman•id.au,
paulus@samba•org, benh@kernel•crashing.org, Waiman.Long@hpe•com,
boqun.feng@gmail•com, will.deacon@arm•com, dave@stgolabs•net
Subject: Re: [PATCH 3/3] locking/osq: Drop the overload of osq_lock()
Date: Mon, 27 Jun 2016 16:21:55 +0200 [thread overview]
Message-ID: <20160627142155.GP30921@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1467049290-32359-4-git-send-email-xinhui.pan@linux.vnet.ibm.com>
On Mon, Jun 27, 2016 at 01:41:30PM -0400, Pan Xinhui wrote:
> @@ -118,8 +123,17 @@ bool osq_lock(struct optimistic_spin_queue *lock)
> while (!READ_ONCE(node->locked)) {
> /*
> * If we need to reschedule bail... so we can block.
> + * An over-committed guest with more vCPUs than pCPUs
> + * might fall in this loop and cause a huge overload.
> + * This is because vCPU A(prev) hold the osq lock and yield out
> + * vCPU B(node) wait ->locked to be set, IOW, it wait utill
> + * vCPU A run and unlock the osq lock. Such spin is meaningless
> + * use vcpu_is_preempted to detech such case. IF arch does not
> + * support vcpu preempted check, vcpu_is_preempted is a macro
> + * defined by false.
Or you could mention lock holder preemption and everybody will know what
you're talking about.
> */
> - if (need_resched())
> + if (need_resched() ||
> + vcpu_is_preempted(node_cpu(node->prev)))
Did you really need that linebreak?
> goto unqueue;
>
> cpu_relax_lowlatency();
> --
> 2.4.11
>
prev parent reply other threads:[~2016-06-27 14:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-27 17:41 [PATCH 0/3] implement vcpu preempted check Pan Xinhui
2016-06-27 17:41 ` [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface Pan Xinhui
2016-06-27 14:00 ` Peter Zijlstra
2016-06-27 14:02 ` Peter Zijlstra
2016-06-28 3:14 ` xinhui
2016-06-28 7:00 ` Heiko Carstens
2016-06-28 9:47 ` xinhui
2016-06-27 14:05 ` Boqun Feng
2016-06-28 3:15 ` xinhui
2016-06-27 17:41 ` [PATCH 2/3] powerpc/spinlock: support vcpu preempted check Pan Xinhui
2016-06-27 14:17 ` Peter Zijlstra
2016-06-28 3:23 ` xinhui
2016-06-27 14:58 ` Boqun Feng
2016-06-28 3:39 ` xinhui
2016-06-28 5:03 ` Boqun Feng
2016-06-28 5:38 ` xinhui
2016-06-27 17:41 ` [PATCH 3/3] locking/osq: Drop the overload of osq_lock() Pan Xinhui
2016-06-27 14:21 ` Peter Zijlstra [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=20160627142155.GP30921@twins.programming.kicks-ass.net \
--to=peterz@infradead$(echo .)org \
--cc=Waiman.Long@hpe$(echo .)com \
--cc=benh@kernel$(echo .)crashing.org \
--cc=boqun.feng@gmail$(echo .)com \
--cc=dave@stgolabs$(echo .)net \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mingo@redhat$(echo .)com \
--cc=mpe@ellerman$(echo .)id.au \
--cc=paulmck@linux$(echo .)vnet.ibm.com \
--cc=paulus@samba$(echo .)org \
--cc=will.deacon@arm$(echo .)com \
--cc=xinhui.pan@linux$(echo .)vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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