Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3030460ybe; Sun, 8 Sep 2019 05:47:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuZZTsjcxaZqeCu4riULx1GYUMvbtMZVVL4UqkW3QNpPtIpW7A+rWHr+zLMsO1m3BXtXoy X-Received: by 2002:a50:b19c:: with SMTP id m28mr18913475edd.189.1567946871001; Sun, 08 Sep 2019 05:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567946870; cv=none; d=google.com; s=arc-20160816; b=vlTtaz46SBujFRWpr8eRuJ4sNpZ5FVakhTMhlW1R0aWDh2JXKB6c7PfmJ5E3iwBaUm h+rj/CVt7hYgo8qVneeACJO6B/JGeD+CWYOV/rvm1WYMSByyDSvstuVo0FwzAY2Ij9n5 kuXNlRyizOtcUqIvJ9h56+eH4c3nvemJy/9FlBv9OnXVQMtnvLRF5uPryb8tk/h1QURX XlQFUZ4rtzCrJoNPwvrRldgWCmAG30DgA3l6806ieDbSEwijttOIGEWPdYO4XUpYGpXV ZpSPd/kyR9a2onF+uS3SXJmJ9sAWe5Ao96WgQkIGiySc4jqhJ8ECA7P8SSl8cMRjs9+9 Zmyw== 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=s4gr8NLGKecf6qvFVJsNMewjZepELQCEmC/ws5mgdw0=; b=rEBjxSqXe+1dY2UE3r7XLbrd8i13k030SOzC/9+/ao4cDC5B9L2nKmiv0CwBozEV16 KmcH+gTx74r3u5ZVAAlyvB3TLFG0OnV2xoz466FT8IyZbZgsSWhNJK2+4MSJ8SWSFsVJ L/9h2GQNcswWyS9JydyE3+cOHrgcVrdcsniDNaprqenReW3UnSpyiF+sehulbBFbg423 OQw4MkiYOGRZo2WF+Zr7UmnfTZY16Yoi2wj6td7gU8yEYrKC6zbjfl2Q9qfIhVOjM2zv 1Z6EZyp9jF+Wy+QLEDE8/9GwfO8R+Eb9Bs1CH/WLC7NXkRigPWXXSxe9TCaDI/Dok9q3 dpUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kolabnow.com header.s=dkim20160331 header.b=yJ+1PZLi; 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 z16si7071139edb.420.2019.09.08.05.47.27; Sun, 08 Sep 2019 05:47:50 -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=yJ+1PZLi; 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 S2388281AbfIGKst (ORCPT + 99 others); Sat, 7 Sep 2019 06:48:49 -0400 Received: from mx.kolabnow.com ([95.128.36.42]:58222 "EHLO mx.kolabnow.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbfIGKss (ORCPT ); Sat, 7 Sep 2019 06:48:48 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTP id 916304CA; Sat, 7 Sep 2019 12:48:45 +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=1567853325; x=1569667726; bh=s4gr8NLGKecf6qvFVJs NMewjZepELQCEmC/ws5mgdw0=; b=yJ+1PZLisVt1Mk2jAkVTTZs44KA8dKSwy5l GKfl4pFO7CC5JtGtEnQbHWG3M3NR/h80e115G/UynZszdNBfOjeZNG4lJXErt21W 7r3DEzgFETPaeSx+viq6HZIQdU/6sQJh51tumLWIB060X5+JziOwk3cnSF7zFzN2 gKPwNVVptvUyDRmbAjspypVAaY1PyiyHhLri1C/hXIcc1XAYoXnrIrTSi7paIUfm nclOa22/V7dSN65wV/nr/ZcVvGuvYH/luq/tUK8FNjOxWVnrooLhnizQ89Efc1ZG 1BJcPQG11ynq2HGV3x6nUgbVQMfl18q0lOvUHK7wMsvhpYuQSptnCSStGpyQ88uC ui0RIlh46ftpGRFNmxFfKoeRZ4cANwLDguF938ATZb9ipfsRqWAEWPAN468ai2I7 pTSWEcKdFa1IXt93ZQOWVZo4XW3MSoHSXJnJZ1/l2sl1f6kgly9EFSqXOnxPqo95 kQosSfSuuIW79HcXrLkQ6PI7u31H6ZutY/XyT+Tm0MvyZp01zx66uVN1F7mLIF5G ZnL903DBcR6Wgtuv7XOT7xazOn13jrUMswZeRhu0s71vhLtwsJnT4HLQzeBazchx 4/ACdnbel5Pevxed6bJL147A3c5jsQSpLCaiwYITYmg3+5sBpURq2aXGUQHSaAB9 DL3Us1ys= 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-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x1c4Vl1SHofg; Sat, 7 Sep 2019 12:48:45 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTPS id 164092DE; Sat, 7 Sep 2019 12:48:44 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx001.mykolab.com (Postfix) with ESMTPS id A0EEF125D; Sat, 7 Sep 2019 12:48:44 +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 v2] doc:lock: remove reference to clever use of read-write lock Date: Sat, 7 Sep 2019 12:48:41 +0200 Message-Id: <20190907104841.18928-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 these 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. (and by the way there was a little typo) 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