Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3039303ybe; Sun, 8 Sep 2019 05:59:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqziw0HgrB9Sy7pbolb2S2meO3QIBtLrPNStmxVywAjgNmvnRVROcs8xcjt99EvqVuakBnWQ X-Received: by 2002:a17:906:7494:: with SMTP id e20mr15327278ejl.166.1567947568675; Sun, 08 Sep 2019 05:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567947568; cv=none; d=google.com; s=arc-20160816; b=disfdteBm1mSSqf81WjCY1RuDdjFMpDPG4HLs5KaUS40nhEV1dGOjhKSPHMQK6swWs 6dgOB3Vv3kDuh2AEqFvjUxUc64ocDKn0lRBPcqP1cxuOs0GFPb+sEsMus1iGrfGo/2ng /NOjWjb3lrZa1iNVAQGd6YeOmYzV8wgbm3GuGIf0+yTEPrHsTbwSc7lpOIOtlwR0/mCG OGXlWIxlzhX1Bp5NB5lbGAwWMKwQubd2hrlKXm9Xre02gF1QbRQeji4gA6HPl7k/PUku jC1uuefnd3yNcr/ql6kZQbhbDVgXQxT/vUfI3GMOwWB2wWjDA4I5oXTKixT/FQx58ySU MG0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IDdnHi1R5fjcjWMd+Ahiszr3G9hOkBsHRfzixT980PY=; b=i5xl+d0+wokbYsBIQvlUGVONXjlA3GwM2BYkQrn68R3cJEUx7Mwmb6AmQ9ABvWRNeR 9zo0RKFPtloSnGzM9SFLAcIu599VAO8Wpt2wD45iExXBIJF5ryP94VYgAp+Rsudsk1LD NhN4mpkjoVtOGUBkzFEt/fn7NpvSLSpeRxZAiSa8NAJ2iFGOPs0RpOFf5qdTTU83bDKg rcDfrDNUTcwLvZ0xE2KUiaUagP8yh8KKVFaasessxCUKtzViavxI8HWD5Q7xk7n7iNyL LPXeqTwBcBUJqZfFsnT2W6Gv21gY1qPb6KB9WW0x0lKYU/WGXduDiNPchrh4EBoA0yXP K+AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kolabnow.com header.s=dkim20160331 header.b=DTQLkRYy; 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 cb11si5800929ejb.38.2019.09.08.05.59.05; Sun, 08 Sep 2019 05:59:28 -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; dkim=pass header.i=@kolabnow.com header.s=dkim20160331 header.b=DTQLkRYy; 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 S1728034AbfIHG3H (ORCPT + 99 others); Sun, 8 Sep 2019 02:29:07 -0400 Received: from mx.kolabnow.com ([95.128.36.42]:3938 "EHLO mx.kolabnow.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfIHG3H (ORCPT ); Sun, 8 Sep 2019 02:29:07 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 4A0C54053A; Sun, 8 Sep 2019 08:29:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:mime-version:message-id:date:date :subject:subject:from:from:received:received:received; s= dkim20160331; t=1567924144; x=1569738545; bh=IDdnHi1R5fjcjWMd+Ah iszr3G9hOkBsHRfzixT980PY=; b=DTQLkRYyZuu1uiDVlN034v1fmegX+oc8uyO N1wuZLWSLzDKdVBJKLCmjrYdFYNFytMJigaIGvO2LVfVpq08jnlqKmRrJX1vt92E ilA+O2a6zBNXD3Nbnr7LWeXJ8xfAGKljnsxSjF7H12UKYTyJtf5+CVkDwI2LUdbV nBi48lHTVFztL8OEC7Y83cD/nLlP2I1S94czcNIJNO70SMF5VLZCyKW21vVJ62Vm XrH4PrnPKcrkqUiTxkcRJulYtas/Y8K30XdLra+NNdJuGiLmuJT0s069DXS5P/+v 9n7dkMW/hgQIBdGbDyIOj+B9Py23iwBtDYT0NZnj/unmV/mXM4lNIvALF69sFusE drNofU2Yh4EnptdS3AFU4PaiLJgfQHhitEGLAGO/tobHmnT648BeJSYeSZRDUF4/ Fm531GJKns0Lx7EGMAWw6rzg12f3ZHxmklznXa0jtqvLGQtBJrYHLUuR5e8Ej7HS UTFPlbgDgiC2ygldeBArXTVsQFHRsB/XTkfI99UkBRaUHV67suqgOu42oNGCiilu LkltLx/N7Zw3Va/2hT6xpF57fhy6uqsw/Sfk3NoNuEKr+13LDK/L9s5DVv046cP4 gOMkSNTTXtYTgWooNvueiSnwT13F45CIFuWtFEplnDf1eLbx/pqR3izpAb+Wcl55 DkbSPLpQ= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-10 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VQGp1COnr6Ls; Sun, 8 Sep 2019 08:29:04 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id B0B46404DA; Sun, 8 Sep 2019 08:29:04 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 434983EAE; Sun, 8 Sep 2019 08:29:04 +0200 (CEST) From: Federico Vaga To: Jonathan Corbet Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Federico Vaga Subject: [PATCH v3] doc:lock: remove reference to clever use of read-write lock Date: Sun, 8 Sep 2019 08:29:01 +0200 Message-Id: <20190908062901.4218-1-federico.vaga@vaga.pv.it> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the clever example about read-write lock because this type of lock is not reccomended anymore (according to the very same document). So there is no reason to teach cleaver things that people should not do. Signed-off-by: Federico Vaga --- Documentation/locking/spinlocks.rst | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Documentation/locking/spinlocks.rst b/Documentation/locking/spinlocks.rst index e93ec6645238..66e3792f8a36 100644 --- a/Documentation/locking/spinlocks.rst +++ b/Documentation/locking/spinlocks.rst @@ -139,18 +139,6 @@ on other CPU's, because an interrupt on another CPU doesn't interrupt the CPU that holds the lock, so the lock-holder can continue and eventually releases the lock). -Note that you can be clever with read-write locks and interrupts. For -example, if you know that the interrupt only ever gets a read-lock, then -you can use a non-irq version of read locks everywhere - because they -don't block on each other (and thus there is no dead-lock wrt interrupts. -But when you do the write-lock, you have to use the irq-safe version. - -For an example of being clever with rw-locks, see the "waitqueue_lock" -handling in kernel/sched/core.c - nothing ever _changes_ a wait-queue from -within an interrupt, they only read the queue in order to know whom to -wake up. So read-locks are safe (which is good: they are very common -indeed), while write-locks need to protect themselves against interrupts. - Linus ---- -- 2.21.0