Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4444402ybb; Mon, 23 Mar 2020 21:47:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvrfVja4b8utOUV04jztzQxY74wNmIrFPzMl/+Dtdwdcn38AhLUYKvAJJFYWPTLNPuTW0A/ X-Received: by 2002:aca:ef82:: with SMTP id n124mr2025098oih.73.1585025260865; Mon, 23 Mar 2020 21:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585025260; cv=none; d=google.com; s=arc-20160816; b=qQH035huvdHI6zsAJq6XDeHerRO73TvyK/HI8jHuLS3vesHUKF/rxrYooN8P2t6AEP 5xikLwkvbZlD0dpua9TCywpX8kWLZaFZTr59GNzNu3S/IQ35s2rbATspdU9Lx0oH3iT3 NONZJqckFw4L677BQbj/nCRJe3W6DIXxjI5BGzZY8xAXDfCq8o4VZVBPqFzzyjZU9fh0 kHZhJlUg15sxYSS70tEa6JkyJGMrX7c8p0RkSkDMo2kv5HI3lg47xEtO3/XxNzNTxiqj 0Xvw47OnmEZLZPAymT8ob47fIAGYDQ2AWoqm4BCP4BmKOPwR34lGTuQX1DU+RMUBtxAi C8Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Xc+qFZh9kBqp4FFp3kmqSN/KcFkku3RwX/9BLPvAgMI=; b=PyXoHOrhmHkXGf6wU4vEj9krAuwpP9cgLQE0FfjA9/Aa92uuhr9GJK4vfRbt0l2zPg opjH1Q0b9AxJhWkCv8AE+kAnyusQfVODwYlASeS+iUHZOZvON3TQi4ezwlezoKvgHhY1 cxaqDATn1/o6SOYIWNbA3E6tewIMEU+Jbznu/S9NYpiEWJMdJaF8/yPZGEUts61Tq14K MKzMuWCVLrneR9fH3ncgRFk8V7t2PeYPLHCHYLoGIi8sk3fA/kUq63Cq8KtgmKynv0+D zXS9igfwypni/nGLr+qV4cKrdFwp33MwRmUGlD+rRGjDjXeWpQw9i8BUq/PA9GKVcLlO er+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x66si8300967ota.244.2020.03.23.21.47.28; Mon, 23 Mar 2020 21:47:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbgCXEqS (ORCPT + 99 others); Tue, 24 Mar 2020 00:46:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:39658 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727064AbgCXEqR (ORCPT ); Tue, 24 Mar 2020 00:46:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9B2E2AD5F; Tue, 24 Mar 2020 04:46:15 +0000 (UTC) From: Davidlohr Bueso To: tglx@linutronix.de, pbonzini@redhat.com Cc: bigeasy@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, torvalds@linux-foundation.org, will@kernel.org, joel@joelfernandes.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, dave@stgolabs.net, Davidlohr Bueso Subject: [PATCH 4/4] sched/swait: Reword some of the main description Date: Mon, 23 Mar 2020 21:44:53 -0700 Message-Id: <20200324044453.15733-5-dave@stgolabs.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200324044453.15733-1-dave@stgolabs.net> References: <20200324044453.15733-1-dave@stgolabs.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 /* - * 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 swake_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