Re: [PATCH 1/2] sched/swait: allow swake_up() to return

2017-11-12 Thread Peter Xu
On Mon, Nov 13, 2017 at 11:33:43AM +0800, Peter Xu wrote: > On Fri, Nov 10, 2017 at 09:05:20AM +0100, Peter Zijlstra wrote: > > On Fri, Nov 10, 2017 at 03:10:17PM +0800, Peter Xu wrote: > > > I came to this when reading kvm_vcpu_wake_up(), so that only affects > > > some statistic which may not be

Re: [PATCH 1/2] sched/swait: allow swake_up() to return

2017-11-12 Thread Peter Xu
On Fri, Nov 10, 2017 at 09:05:20AM +0100, Peter Zijlstra wrote: > On Fri, Nov 10, 2017 at 03:10:17PM +0800, Peter Xu wrote: > > I came to this when reading kvm_vcpu_wake_up(), so that only affects > > some statistic which may not be that critical. However I don't know > > whether there would be an

Re: [PATCH 1/2] sched/swait: allow swake_up() to return

2017-11-10 Thread Peter Zijlstra
On Fri, Nov 10, 2017 at 03:10:17PM +0800, Peter Xu wrote: > I came to this when reading kvm_vcpu_wake_up(), so that only affects > some statistic which may not be that critical. However I don't know > whether there would be any other real use case that we would like to > know exactly whether a cal

Re: [PATCH 1/2] sched/swait: allow swake_up() to return

2017-11-09 Thread Peter Xu
On Thu, Nov 09, 2017 at 11:06:53AM +0100, Paolo Bonzini wrote: > On 09/11/2017 10:18, Peter Xu wrote: > > Let swake_up() to return whether any of the waiters is waked up. One use > > case of it would be: > > > > if (swait_active(wq)) { > > swake_up(wq); > > // do something when waiter is

Re: [PATCH 1/2] sched/swait: allow swake_up() to return

2017-11-09 Thread Peter Xu
On Thu, Nov 09, 2017 at 11:23:03AM +0100, Peter Zijlstra wrote: > On Thu, Nov 09, 2017 at 05:18:53PM +0800, Peter Xu wrote: > > Let swake_up() to return whether any of the waiters is waked up. One use > > case of it would be: > > > > if (swait_active(wq)) { > > swake_up(wq); > > // do so

Re: [PATCH 1/2] sched/swait: allow swake_up() to return

2017-11-09 Thread Peter Zijlstra
On Thu, Nov 09, 2017 at 05:18:53PM +0800, Peter Xu wrote: > Let swake_up() to return whether any of the waiters is waked up. One use > case of it would be: > > if (swait_active(wq)) { > swake_up(wq); > // do something when waiter is waked up > waked_up++; > } The word is 'woken',

Re: [PATCH 1/2] sched/swait: allow swake_up() to return

2017-11-09 Thread Paolo Bonzini
On 09/11/2017 10:18, Peter Xu wrote: > Let swake_up() to return whether any of the waiters is waked up. One use > case of it would be: > > if (swait_active(wq)) { > swake_up(wq); > // do something when waiter is waked up > waked_up++; > } > > Logically it's possible that when reac