qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/7] userfaultfd: switch to exclusive wakeup for


From: Linus Torvalds
Subject: Re: [Qemu-devel] [PATCH 5/7] userfaultfd: switch to exclusive wakeup for blocking reads
Date: Mon, 15 Jun 2015 08:19:07 -1000


On Jun 15, 2015 7:22 AM, "Andrea Arcangeli" <address@hidden> wrote:
>
> Blocking reads can easily use exclusive wakeups. Poll in theory could
> too but there's no poll_wait_exclusive in common code yet.

NAK.

Tie while commit message is crap, and so us the comment

No, your really cannot "easily use exclusive waits", and no, using them for polling isn't about a lack of interface, it's about the fact that it would be buggy shit.

What if the process doing the polling never doors anything with the end result? Maybe it meant to, but it got killed before it could? Are you going to leave everybody else blocked, even though there are pending events?

The same us try of read() too. What if the reader only reads party of the message? The wake didn't wake anybody else, so now people are (again) blocked despite there being data.

So no, exclusive waiting is never "simple". You have to 100% guarantee that you will consume all the data that caused the wake event (or perhaps wake the next person up if you don't).

    Linus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]