[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200320085527.23861-4-dave@stgolabs.net>
Date: Fri, 20 Mar 2020 01:55:27 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: tglx@...utronix.de
Cc: arnd@...db.de, balbi@...nel.org, bhelgaas@...gle.com,
bigeasy@...utronix.de, dave@...olabs.net, davem@...emloft.net,
gregkh@...uxfoundation.org, joel@...lfernandes.org,
kurt.schwemmer@...rosemi.com, kvalo@...eaurora.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-usb@...r.kernel.org, linux-wireless@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, logang@...tatee.com,
mingo@...nel.org, mpe@...erman.id.au, netdev@...r.kernel.org,
oleg@...hat.com, paulmck@...nel.org, peterz@...radead.org,
rdunlap@...radead.org, rostedt@...dmis.org,
torvalds@...ux-foundation.org, will@...nel.org,
Davidlohr Bueso <dbueso@...e.de>
Subject: [PATCH 19/15] sched/swait: Reword some of the main description
With both the increased use of swait and kvm no longer using
it, we can reword some of the comments. While removing Linus'
valid rant, I've also cared to explicitly mention that swait
is very different than regular wait. In addition it is
mentioned against using swait in favor of the regular flavor.
Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
---
include/linux/swait.h | 23 +++++------------------
1 file changed, 5 insertions(+), 18 deletions(-)
diff --git a/include/linux/swait.h b/include/linux/swait.h
index 73e06e9986d4..6e5b5d0e64fd 100644
--- a/include/linux/swait.h
+++ b/include/linux/swait.h
@@ -9,23 +9,10 @@
#include <asm/current.h>
/*
- * BROKEN wait-queues.
- *
- * These "simple" wait-queues are broken garbage, and should never be
- * used. The comments below claim that they are "similar" to regular
- * wait-queues, but the semantics are actually completely different, and
- * every single user we have ever had has been buggy (or pointless).
- *
- * A "swake_up_one()" only wakes up _one_ waiter, which is not at all what
- * "wake_up()" does, and has led to problems. In other cases, it has
- * been fine, because there's only ever one waiter (kvm), but in that
- * case gthe whole "simple" wait-queue is just pointless to begin with,
- * since there is no "queue". Use "wake_up_process()" with a direct
- * pointer instead.
- *
- * While these are very similar to regular wait queues (wait.h) the most
- * important difference is that the simple waitqueue allows for deterministic
- * behaviour -- IOW it has strictly bounded IRQ and lock hold times.
+ * Simple waitqueues are semantically very different to regular wait queues
+ * (wait.h). The most important difference is that the simple waitqueue allows
+ * for deterministic behaviour -- IOW it has strictly bounded IRQ and lock hold
+ * times.
*
* Mainly, this is accomplished by two things. Firstly not allowing swake_up_all
* from IRQ disabled, and dropping the lock upon every wakeup, giving a higher
@@ -39,7 +26,7 @@
* sleeper state.
*
* - the !exclusive mode; because that leads to O(n) wakeups, everything is
- * exclusive.
+ * exclusive. As such swait_wake_up_one will only ever awake _one_ waiter.
*
* - custom wake callback functions; because you cannot give any guarantees
* about random code. This also allows swait to be used in RT, such that
--
2.16.4
Powered by blists - more mailing lists