Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3040127ybe; Sun, 8 Sep 2019 06:00:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqy70kiHXf30MRDDehLGA6ECCSRdLpQBIHFxBzuL4c/coI3dPuJmzseipM5LjiLTya1Nng04 X-Received: by 2002:aa7:d59a:: with SMTP id r26mr19298708edq.137.1567947627698; Sun, 08 Sep 2019 06:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567947627; cv=none; d=google.com; s=arc-20160816; b=jzG3bJqs2qSaBtkFacMmyswN30MXiOyFQ/l8GiOO7IMTZC6lhdytlTNMdt+oPR6HAG 98pJTcrT9tSJzZQFM3OJgsD0h2Ja5ceVa3+Vh+4v7EdEeLkc6P2dQ4XKfaFUKAzN+0Kr TI9CJzOCcv8SeWD+E8a2sHd5OBnLB7d+OeHzITk1Fnefh/GCHHX/I+TK5hMJBRfOtU/+ U2oSKuBdOluv2J71y1vBV+B04WnrWmnKFYfYmhAGwMSVbr1qe1R2fBJnjZvpbL++agHq cA3S9UWgpqsGuKwapWXnIAKk3De9hYoM3De5dhwpEB2IKfW/xINnA7KD+6HUsoMJBTTQ B7xQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=loMIHDDy1oxTCVSwj4XybWzWNEfOxw9dOex0dta1oSM=; b=IVr3poyXwuDwfi4BhsNfRRuxFIjrSe50SITTU/BiBBTN3WWF5BhT///P1yPskUYG03 rBeG7MxNgVFlWmotYUIcUSqVX1Q0US1m4AsZBRnRKLKelv4XDv1O43ttKuGBnRVJYQ5Y /2KoEclshrxXBGRsDPi0K4/H+91liCit0kOkvylThgR96heDk4xNLUnHReHJ9jLxyCSI aMukh8FBRMhe8fiIzop0DuHZzUH1AQe0WbrqSdr16TYmWEUZ9W1dWREuL+xHz71ebkm/ adQLeh9815oi1qvOevaCiP9H8XDhvm1cvJR/w+LkqZFhbDmXsOvYJlJ+YvtFlZ7SmHLl huKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kolabnow.com header.s=dkim20160331 header.b=k7HMG2uG; 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 q14si6653076edr.3.2019.09.08.06.00.04; Sun, 08 Sep 2019 06:00:27 -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=k7HMG2uG; 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 S1727721AbfIHG1F (ORCPT + 99 others); Sun, 8 Sep 2019 02:27:05 -0400 Received: from mx.kolabnow.com ([95.128.36.42]:7426 "EHLO mx.kolabnow.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbfIHG1F (ORCPT ); Sun, 8 Sep 2019 02:27:05 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTP id 4CEDC55C; Sun, 8 Sep 2019 08:27:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1567924022; x=1569738423; bh=loMIHDDy1oxTCVSwj4XybWzWNEfOxw9dOex 0dta1oSM=; b=k7HMG2uGGvIhtmuqKZsnUsM2+oDrz9NwVq1iuUC+OacaBKgtDpP axLA6S7Tc9sofqvTTxU97FG4bevwoJdrZxhc/d3K8y8gffTEoSLRJ1S+tv4UTluy lm8Lt90ajCaeCAIMhDp3md/KhhcoZ7DqWXlm9LoTaB3JIf9ui8+QbAKRUzFg5z9k tXpX0m8Qx7MPsNPm2AfVB/rO2w5nbeQpp/mXVsAJnq8L8AK8d6/307BrkEsmbD9l 3ibajXbZ7aeMWG7u6f87f+JTjZ6E17WWNpd37kXRnDeVldAZd/BCpY8SfF6TL1Gd 21GvwmevjWmkNCGiwfp1jO7PBKyYP2ULt91E91zjF+bZw6xgKrK04Mwxsmv/qhHn YbiJLJ2lBW23nsdbxMdxMVtHUtFPzXUf86GkL+uTxWhw5uDar4fDZWfWtTt+Lmgs utXGUdHWqLGVS9K8tfC9TJImVVugvhkoFu5bRxdZEPL3lQBMPUK+7x0CAipuvBj+ /78BQ5O+iacEnSQSwkfB0x8HY0mcpy1mL3qwynk2wUHyGkVkU13Z7sd52XP/XxLB VvfVQXoqY84MoKQIIYisK/rXpe6yNMYhyB+myeku2hVB670Mx0pyTkhg/eDvspY1 2QbDa6taMjhMqGWWjdLi0x9GahDCY2N/GsxlKEu0Z9gGk9pU7RMgNYwY= 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 m9IlTzeRscVp; Sun, 8 Sep 2019 08:27:02 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTPS id BFB663FE; Sun, 8 Sep 2019 08:27:02 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 60CED174B; Sun, 8 Sep 2019 08:27:02 +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 Subject: Re: [PATCH v2] doc:lock: remove reference to clever use of read-write lock Date: Sun, 08 Sep 2019 08:27:00 +0200 Message-ID: <9118016.19PSEFGOkz@harkonnen> In-Reply-To: <20190907104841.18928-1-federico.vaga@vaga.pv.it> References: <20190907104841.18928-1-federico.vaga@vaga.pv.it> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ignore this, the commit message is incorrect. I am sending a V3 On Saturday, September 7, 2019 12:48:41 PM CEST Federico Vaga wrote: > 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 > > ----