linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: xinhui <xinhui.pan@linux.vnet.ibm.com>
To: Boqun Feng <boqun.feng@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	paulmck@linux.vnet.ibm.com, peterz@infradead.org,
	mingo@redhat.com, mpe@ellerman.id.au, paulus@samba.org,
	benh@kernel.crashing.org, Waiman.Long@hpe.com,
	will.deacon@arm.com, dave@stgolabs.net
Subject: Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check
Date: Tue, 28 Jun 2016 13:38:19 +0800	[thread overview]
Message-ID: <57720D4B.8090406@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160628050356.GA25008@insomnia>



On 2016年06月28日 13:03, Boqun Feng wrote:
> On Tue, Jun 28, 2016 at 11:39:18AM +0800, xinhui wrote:
> [snip]
>>>> +{
>>>> +	struct lppaca *lp = &lppaca_of(cpu);
>>>> +
>>>> +	if (unlikely(!(lppaca_shared_proc(lp) ||
>>>> +			lppaca_dedicated_proc(lp))))
>>>
>>> Do you want to detect whether we are running in a guest(ie. pseries
>>> kernel) here? Then I wonder whether "machine_is(pseries)" works here.
>>>
>> I tried as you said yesterday. but .h file has dependencies.
>> As you said, if we add #ifdef PPC_PSERIES, this is not a big problem. only powernv will be affected as they are built into same kernel img.
>>
>
> I never said this it not a big problem ;-)
>
> The problem here is that we only need to detect the vcpu preemption in
> a guest, and there could be several ways we can detect whether the
> kernel is running in a guest. It's worthwhile to try find the best one
> for this. Besides, it's really better that you can make sure we are
> runing out of options before you introduce something like
> lppaca_dedicated_proc().
>
> I have a feeling that yield_count is non-zero only if we are running in
> a guest, if so, we can use this and save several loads. But surely we
> need the confirmation from ppc maintainers.
>
yes, on powernv, print the lppaca.yield_count and it is always zero. looks like only hypervisor and os can touch/modify it.


> Regards,
> Boqun
>

  reply	other threads:[~2016-06-28  5:39 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 [this message]
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

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=57720D4B.8090406@linux.vnet.ibm.com \
    --to=xinhui.pan@linux.vnet.ibm.com \
    --cc=Waiman.Long@hpe.com \
    --cc=benh@kernel.crashing.org \
    --cc=boqun.feng@gmail.com \
    --cc=dave@stgolabs.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=will.deacon@arm.com \
    /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 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).