Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-11-06 Thread David Woodhouse
On 6 November 2020 16:32:00 GMT, Alex Williamson wrote: >On Fri, 6 Nov 2020 11:17:21 +0100 >Paolo Bonzini wrote: > >> On 04/11/20 10:35, David Woodhouse wrote: >> > On Wed, 2020-10-28 at 15:35 +0100, Peter Zijlstra wrote: >> >> On Tue, Oct 27, 2020 at 02:39:43PM +, David Woodhouse

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-11-06 Thread Alex Williamson
On Fri, 6 Nov 2020 11:17:21 +0100 Paolo Bonzini wrote: > On 04/11/20 10:35, David Woodhouse wrote: > > On Wed, 2020-10-28 at 15:35 +0100, Peter Zijlstra wrote: > >> On Tue, Oct 27, 2020 at 02:39:43PM +, David Woodhouse wrote: > >>> From: David Woodhouse > >>> > >>> This allows an

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-11-06 Thread Paolo Bonzini
On 04/11/20 10:35, David Woodhouse wrote: On Wed, 2020-10-28 at 15:35 +0100, Peter Zijlstra wrote: On Tue, Oct 27, 2020 at 02:39:43PM +, David Woodhouse wrote: From: David Woodhouse This allows an exclusive wait_queue_entry to be added at the head of the queue, instead of the tail as

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-11-04 Thread Paolo Bonzini
On 04/11/20 10:35, David Woodhouse wrote: On Wed, 2020-10-28 at 15:35 +0100, Peter Zijlstra wrote: On Tue, Oct 27, 2020 at 02:39:43PM +, David Woodhouse wrote: From: David Woodhouse This allows an exclusive wait_queue_entry to be added at the head of the queue, instead of the tail as

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-11-04 Thread David Woodhouse
On Wed, 2020-10-28 at 15:35 +0100, Peter Zijlstra wrote: > On Tue, Oct 27, 2020 at 02:39:43PM +, David Woodhouse wrote: > > From: David Woodhouse > > > > This allows an exclusive wait_queue_entry to be added at the head of the > > queue, instead of the tail as normal. Thus, it gets to

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-28 Thread Peter Zijlstra
On Tue, Oct 27, 2020 at 09:32:11PM +, David Woodhouse wrote: > On Tue, 2020-10-27 at 21:30 +0100, Peter Zijlstra wrote: > > On Tue, Oct 27, 2020 at 07:27:59PM +, David Woodhouse wrote: > > > > > > While looking at this I found that weird __add_wait_queue_exclusive() > > > > which is used

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-28 Thread Peter Zijlstra
On Tue, Oct 27, 2020 at 02:39:43PM +, David Woodhouse wrote: > From: David Woodhouse > > This allows an exclusive wait_queue_entry to be added at the head of the > queue, instead of the tail as normal. Thus, it gets to consume events > first without allowing non-exclusive waiters to be woken

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-28 Thread Paolo Bonzini
On 28/10/20 15:20, Peter Zijlstra wrote: > Shall I take the waitqueue thing and stick it in a topic branch for > Paolo so he can then merge that and the kvm bits on top into the KVM > tree? Topic branches are always the best solution. :) Paolo

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-27 Thread David Woodhouse
On Tue, 2020-10-27 at 21:30 +0100, Peter Zijlstra wrote: > On Tue, Oct 27, 2020 at 07:27:59PM +, David Woodhouse wrote: > > > > While looking at this I found that weird __add_wait_queue_exclusive() > > > which is used by fs/eventpoll.c and does something similar, except it > > > doesn't keep

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-27 Thread David Woodhouse
On Tue, 2020-10-27 at 21:30 +0100, Peter Zijlstra wrote: > On Tue, Oct 27, 2020 at 07:27:59PM +, David Woodhouse wrote: > > > > While looking at this I found that weird __add_wait_queue_exclusive() > > > which is used by fs/eventpoll.c and does something similar, except it > > > doesn't keep

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-27 Thread Peter Zijlstra
On Tue, Oct 27, 2020 at 07:27:59PM +, David Woodhouse wrote: > > While looking at this I found that weird __add_wait_queue_exclusive() > > which is used by fs/eventpoll.c and does something similar, except it > > doesn't keep the FIFO order. > > It does, doesn't it? Except those so-called

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-27 Thread David Woodhouse
On Tue, 2020-10-27 at 20:09 +0100, Peter Zijlstra wrote: > On Tue, Oct 27, 2020 at 02:39:43PM +, David Woodhouse wrote: > > From: David Woodhouse > > > > This allows an exclusive wait_queue_entry to be added at the head of the > > queue, instead of the tail as normal. Thus, it gets to

Re: [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-27 Thread Peter Zijlstra
On Tue, Oct 27, 2020 at 02:39:43PM +, David Woodhouse wrote: > From: David Woodhouse > > This allows an exclusive wait_queue_entry to be added at the head of the > queue, instead of the tail as normal. Thus, it gets to consume events > first without allowing non-exclusive waiters to be woken

[PATCH v2 1/2] sched/wait: Add add_wait_queue_priority()

2020-10-27 Thread David Woodhouse
From: David Woodhouse This allows an exclusive wait_queue_entry to be added at the head of the queue, instead of the tail as normal. Thus, it gets to consume events first without allowing non-exclusive waiters to be woken at all. The (first) intended use is for KVM IRQFD, which currently has