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


Groups > linux.kernel > #1437408

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

From xinhui <xinhui.pan@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check
Date 2016-07-06 07:00 +0200
Message-ID <rRN6m-4B7-3@gated-at.bofh.it> (permalink)
References <rOYKC-5Nk-11@gated-at.bofh.it> <rOYKD-5Nk-61@gated-at.bofh.it> <rRvj3-16J-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi, wanpeng

On 2016年07月05日 17:57, Wanpeng Li wrote:
> Hi Xinhui,
> 2016-06-28 22:43 GMT+08:00 Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>:
>> This is to fix some lock holder preemption issues. Some other locks
>> implementation do a spin loop before acquiring the lock itself. Currently
>> kernel has an interface of bool vcpu_is_preempted(int cpu). It take the cpu
>> as parameter and return true if the cpu is preempted. Then kernel can break
>> the spin loops upon on the retval of vcpu_is_preempted.
>>
>> As kernel has used this interface, So lets support it.
>>
>> Only pSeries need supoort it. And the fact is powerNV are built into same
>> kernel image with pSeries. So we need return false if we are runnig as
>> powerNV. The another fact is that lppaca->yiled_count keeps zero on
>> powerNV. So we can just skip the machine type.
>
> Lock holder vCPU preemption can be detected by hardware pSeries or
> paravirt method?
>
There is one shard struct between kernel and powerVM/KVM. And we read the yield_count of this struct to detect if one vcpu is running or not.
SO it's easy for ppc to implement such interface. Note that yield_count is set by powerVM/KVM.
and only pSeries can run a guest for now. :)

I also review x86 related code, looks like we need add one hyer-call to get such vcpu preemption info?

thanks
xinui
> Regards,
> Wanpeng Li
>

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


Thread

[PATCH v2 0/4] implement vcpu preempted check Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 12:50 +0200
  [PATCH v2 1/4] kernel/sched: introduce vcpu preempted check interface Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 12:50 +0200
  [PATCH v2 3/4] locking/osq: Drop the overload of osq_lock() Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 12:50 +0200
  [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 12:50 +0200
    Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check Wanpeng Li <kernellwp@gmail.com> - 2016-07-05 12:00 +0200
      Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-07-06 07:00 +0200
        Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check Wanpeng Li <kernellwp@gmail.com> - 2016-07-06 08:50 +0200
          Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-06 10:00 +0200
            Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check Wanpeng Li <kernellwp@gmail.com> - 2016-07-06 10:40 +0200
              Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-07-06 12:20 +0200
    Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check Balbir Singh <bsingharora@gmail.com> - 2016-07-06 13:00 +0200
  [PATCH v2 4/4] kernel/locking: Drop the overload of {mutex,rwsem}_spin_on_owner Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-28 12:50 +0200
  Re: [PATCH v2 0/4] implement vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-06 09:00 +0200
    Re: [PATCH v2 0/4] implement vcpu preempted check Juergen Gross <jgross@suse.com> - 2016-07-06 09:50 +0200
      Re: [PATCH v2 0/4] implement vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-06 10:20 +0200
        Re: [PATCH v2 0/4] implement vcpu preempted check Juergen Gross <jgross@suse.com> - 2016-07-06 10:40 +0200
        Re: [PATCH v2 0/4] implement vcpu preempted check Paolo Bonzini <pbonzini@redhat.com> - 2016-07-06 14:50 +0200
        Re: [PATCH v2 0/4] implement vcpu preempted check Christian Borntraeger <borntraeger@de.ibm.com> - 2016-07-06 19:00 +0200
    Re: [PATCH v2 0/4] implement vcpu preempted check xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-07-06 12:10 +0200
    Re: [PATCH v2 0/4] implement vcpu preempted check Paolo Bonzini <pbonzini@redhat.com> - 2016-07-06 12:50 +0200
      Re: [PATCH v2 0/4] implement vcpu preempted check Wanpeng Li <kernellwp@gmail.com> - 2016-07-06 14:10 +0200
        Re: [PATCH v2 0/4] implement vcpu preempted check Paolo Bonzini <pbonzini@redhat.com> - 2016-07-06 14:40 +0200
          Re: [PATCH v2 0/4] implement vcpu preempted check Wanpeng Li <kernellwp@gmail.com> - 2016-07-06 15:10 +0200
          Re: [PATCH v2 0/4] implement vcpu preempted check Wanpeng Li <kernellwp@gmail.com> - 2016-07-07 10:50 +0200
            Re: [PATCH v2 0/4] implement vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-07 11:50 +0200
              Re: [PATCH v2 0/4] implement vcpu preempted check Wanpeng Li <kernellwp@gmail.com> - 2016-07-07 12:20 +0200
                Re: [PATCH v2 0/4] implement vcpu preempted check Wanpeng Li <kernellwp@gmail.com> - 2016-07-07 12:30 +0200
                Re: [PATCH v2 0/4] implement vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-07 13:20 +0200
                Re: [PATCH v2 0/4] implement vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-07 13:10 +0200
              Re: [PATCH v2 0/4] implement vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-07 13:10 +0200
              Re: [PATCH v2 0/4] implement vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-07 13:30 +0200
      Re: [PATCH v2 0/4] implement vcpu preempted check Peter Zijlstra <peterz@infradead.org> - 2016-07-06 14:10 +0200

csiph-web