Re: [PATCH] jbd2: wake up journal waiters in FIFO order, not LIFO

Ritesh Harjani (IBM)
2022-09-08T09:13:40Z

On 22/09/08 11:16AM, Ritesh Harjani (IBM) wrote:
> On 22/09/07 07:59PM, Alexey Lyashkov wrote:
> > From: Andrew Perepechko <anserper@ya.ru>
> >
> > LIFO wakeup order is unfair and sometimes leads to a journal
> > user not being able to get a journal handle for hundreds of
> > transactions in a row.
> >
> > FIFO wakeup can make things more fair.
>
> prepare_to_wait() will always add the task to the head of the list.
> While prepare_to_wait_exclusive() will add the task to the tail since all of the
> exclusive tasks are added to the tail.
> wake_up() function will wake up all non-exclusive and single exclusive task
> v/s
> wake_up_all() function will wake up all tasks irrespective.
>
> So your change does makes the ordering to FIFO, in which the task which came in
> first will be woken up first.

With all other details which got discussed in other threads.
This looks like the right thing to do.

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>