Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp342696ybh; Mon, 20 Jul 2020 18:40:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfssNMmMWT7znpHe3fDsn+sIsj7ZEIhbSny7vrKpWgMwf/m7m4uOiNpA+xa0qLvsdeQTaa X-Received: by 2002:a17:906:8595:: with SMTP id v21mr24102762ejx.333.1595295643760; Mon, 20 Jul 2020 18:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595295643; cv=none; d=google.com; s=arc-20160816; b=HTXmE7nQyQT2zudxnj290TgQ2RSbHUtKklX6OEhZr3gM7JZJRit6lRI4E+f5J8ZcqP 1p1JMFUw/tfjJwoo7g0MbvOK6uplk00GapwvyOIbsmmHQ0a6nM6zclf1bYtP4wh5mUwF MJjeJyREjBF2dVGiwwp+uLak3chj3z+kHPBRNvW7LnSSSzYePncYCUCe9ctE7lKJhr+Q rUGl7oSHb79fOmwUSmcCLwiHunV9zoCkdjavuRrS/ztjGcB6QX22thmXA6XIuNUcsGna qow0g0i4mehdrtrPhdypKaXpddch1Cz5DKvDUhOAeVfBXWfO4ikuYjw3nNqJ1ucTCooE jovA== 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:subject:cc:to:from:date; bh=Jhshg4TQBhAlJV2N1iilL9TNi4V44pH3Xqw2RnrZLP8=; b=fKT9c0PWTqhxTWAcW6KpSD2U2OD2/e3UxRo8fgr0z6j+5sGLgvoYyNmyDV0C1/49Nt qsP9HeV1j7V5LxDP4zEE5LYe+Di/dz6fZndNV8ZkcN7d98nIVOnb1XdbxEpn+wM0s1yJ xnPKmhSZhpdDqyCAyh1AE2cDkpCsXWTw6xOdzfcjrBPgLgqlypyKt3Tntkka1WrGlDRq BGEEyh61jFFp3ksENZBeStYn8/40GpJxOU+Un1RTHFxCBp0RXu+BNHtUcChfnt7Jzv5U 21DUb/Fp8K2HrdT3Q4G5yywC8wOqzN3UyumgG4Pox9/udDrVSOLXN8DY/KIN4XEXx44i SD5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si11718010eds.345.2020.07.20.18.40.20; Mon, 20 Jul 2020 18:40:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726266AbgGUBhz (ORCPT + 99 others); Mon, 20 Jul 2020 21:37:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:41600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgGUBhy (ORCPT ); Mon, 20 Jul 2020 21:37:54 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 9A97F2075B; Tue, 21 Jul 2020 01:37:53 +0000 (UTC) Date: Mon, 20 Jul 2020 21:37:52 -0400 From: Steven Rostedt To: "Ahmed S. Darwish" Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Thomas Gleixner , "Paul E. McKenney" , "Sebastian A. Siewior" , LKML , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [PATCH v4 01/24] Documentation: locking: Describe seqlock design and usage Message-ID: <20200720213752.70319a1c@oasis.local.home> In-Reply-To: <20200720213551.5ba9bc6d@oasis.local.home> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200720155530.1173732-1-a.darwish@linutronix.de> <20200720155530.1173732-2-a.darwish@linutronix.de> <20200720213551.5ba9bc6d@oasis.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 Jul 2020 21:35:51 -0400 Steven Rostedt wrote: > On Mon, 20 Jul 2020 17:55:07 +0200 > "Ahmed S. Darwish" wrote: > > +Read path, three categories: > > + > > +1. Normal Sequence readers which never block a writer but they must > > + retry if a writer is in progress by detecting change in the sequence > > + number. Writers do not wait for a sequence reader:: > > + > > + do { > > + seq = read_seqbegin(&foo_seqlock); > > + > > + /* ... [[read-side critical section]] ... */ > > + > > + } while (read_seqretry(&foo_seqlock, seq)); > > + > > +2. Locking readers which will wait if a writer or another locking reader > > + is in progress. A locking reader in progress will also block a writer > > + from entering its critical section. This read lock is > > + exclusive. Unlike rwlock_t, only one locking reader can acquire it:: > > Nit, but I would mention that this acts similar to a normal spin_lock, and even disables preeption (in the non-RT case). What I learned today: Ctrl-return on claws mail sends the email :-p I need to disable that before I send another email before I'm done with it! I haven't finished reading the rest. -- Steve