Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2515469ybe; Thu, 12 Sep 2019 10:32:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzibk8xsF7PAxNuxxg6n1K4or8odp3VB4XwxQLaNli+nBJf+RRWfquvGaSchJrwlzZgfvhz X-Received: by 2002:a50:d5c5:: with SMTP id g5mr40389105edj.57.1568309540111; Thu, 12 Sep 2019 10:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568309540; cv=none; d=google.com; s=arc-20160816; b=xfZzYdXbWwYqxInC4QCITI7CHv8TZbXyVjAxqX8/CeqKqLkogeEV/H6muO5W+vfWL9 biTrhP6yp6qrb+50h0uakkvTITI7pmT6WGqDlarQ8l4v/56mjAkpyMIhL2yaMK1DiWKJ u8+xAuSyatCThrQ8p0i1rOL1wdJ71kEWrFuOJszEGpJHvlgjF66+8hGJZGUFyEPFdVRV DtM/hkLxukLF3FW3EsdnMMmO4+nisQGAO9nPC4skzcDwupR4hknoi7T6BrCyqfGHyxRo yMx3anykf01eeICPdjWbJw3mV/LEaLNxwajZkL/cprPaNsEAItdM/uZuM6wzFvmtbCvq YDOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=y+w/sv0yJb44V5nenUZOvn5u91nnXYGZXkxYk9UH4pk=; b=eFvrxv8WeMONTR7JAP/wuk4ORqSg/FXlpDG1J/t8cPXZZWal8AaoEAGk2hiteC5A/i 793oHQYelJkaSbAqnvzWBjQJ3wElTCtMPIL+U3ZvufzngFE1N41PX2vx/BcGqpQpJZG8 eop6qvIg0XPoULBlhzwb3RPSCvVBHGRJAM61bRfG84VIbTo6lkTC53m4KoUWmsPTDiNQ k9IY/k2WirzICnUwATxunDtjRt4b5Q76RJ+4+xkMBW0/gB+yEl2dxSAVuviCYDATlOR6 hgvboVLDiLIMQtVvVFv9PQtOnSlpX02pd4/B+IAGaRyRsSIHtPnq4+D3xR1rttDKs0dt 3dYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="1W1/PCRa"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v19si15533833edm.103.2019.09.12.10.31.56; Thu, 12 Sep 2019 10:32:20 -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=@kernel.org header.s=default header.b="1W1/PCRa"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732213AbfILNcc (ORCPT + 99 others); Thu, 12 Sep 2019 09:32:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:58500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732126AbfILNcc (ORCPT ); Thu, 12 Sep 2019 09:32:32 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE57F20830; Thu, 12 Sep 2019 13:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568295151; bh=9mM3BMLFghazKVa4ITPL27kP5L6MutGjThJyUAY6ORY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1W1/PCRaDcJ1pkRDt7vN5r0zzX07LEmhfgtlAK+JpEYqQ5sln8IwQyE4klxtz55AT DrvzAmrcsv9SpDUpHoRhKeTbkoO8iFEJSx4+6WtPgVBJeqc3ZkvBB8xkInGTH+09X6 XU52e9zgwWoe5ACFM8ecD/bgFWbkXOPKzY5sFaSg= Date: Thu, 12 Sep 2019 14:32:27 +0100 From: Will Deacon To: Federico Vaga Cc: Jonathan Corbet , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v3] doc:lock: remove reference to clever use of read-write lock Message-ID: <20190912133226.oeo3eecvzfr52yv3@willie-the-truck> References: <20190908062901.4218-1-federico.vaga@vaga.pv.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190908062901.4218-1-federico.vaga@vaga.pv.it> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 08, 2019 at 08:29:01AM +0200, Federico Vaga wrote: > Remove the clever example about read-write lock because this type of > lock is not reccomended anymore (according to the very same document). reccomended => recommended > So there is no reason to teach cleaver things that people should not do. cleaver => clever > 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. > - With the typos fixed in the commit message: Acked-by: Will Deacon Will