Re: wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 29, 2019 at 11:57 PM Valdis Klētnieks
<valdis.kletnieks@xxxxxx> wrote:
>
> On Mon, 29 Jul 2019 22:48:57 +0530, Muni Sekhar said:
> > Let us assume that multiple processes are waiting on wait_event()\
> > wait_event_interruptible()\ wait_event_interruptible_timeout(), which
> > process gets woken up on calling wake_up()??
> >
> > I presume wake_up() picks one process, but is there any algorithm to
> > pick which process?
>
> Hint:  If you have more than one process waiting, and they do the same thing
> (think multiple copies of the same kthread), it probably doesn't matter.
>
> If they do different things and which one gets picked matters for correctness,
> you're doing it wrong and probably need some locking.
>
> If they do different things and the results will be correct no matter which
> order they're picked, but you want one to go first for latency/througput
> considerations, you have a scheduling/priority issue and probably need to fix
> it using the vast plethora of knobs and tools available for that purpose.
If they do different things, does the waiting threads wakeup order is
the same in which they were enqueued (FIFO order)?
>


-- 
Thanks,
Sekhar

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux