Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432489

Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check

From xinhui <xinhui.pan@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check
Date 2016-06-28 07:40 +0200
Message-ID <rOTUB-2AT-9@gated-at.bofh.it> (permalink)
References <rOF5f-Uh-5@gated-at.bofh.it> <rOF5f-Uh-13@gated-at.bofh.it> <rOGaZ-1Du-19@gated-at.bofh.it> <rOSc9-1mH-1@gated-at.bofh.it> <rOTrz-2pg-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] implement vcpu preempted check Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-27 15:50 +0200
  [PATCH 2/3] powerpc/spinlock: support vcpu preempted check Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-27 15:50 +0200
    Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-06-27 16:20 +0200
      Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 05:30 +0200
    Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check Boqun Feng <boqun.feng@gmail.com> - 2016-06-27 17:00 +0200
      Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 05:50 +0200
        Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check Boqun Feng <boqun.feng@gmail.com> - 2016-06-28 07:10 +0200
          Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 07:40 +0200
  [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-27 15:50 +0200
    Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check  interface Peter Zijlstra <peterz@infradead.org> - 2016-06-27 16:10 +0200
      Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check  interface Peter Zijlstra <peterz@infradead.org> - 2016-06-27 16:10 +0200
        Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 05:20 +0200
      Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check  interface Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-06-28 09:10 +0200
        Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 11:50 +0200
    Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check  interface Boqun Feng <boqun.feng@gmail.com> - 2016-06-27 16:10 +0200
      Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 05:20 +0200

csiph-web