Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp454354ybh; Mon, 20 Jul 2020 22:35:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzyq/PRcbEXpFpeb+DjAqHh/hBor2m2ZX4lwI9E5f1y/JnUlXdyfIANIM9rfETTBCn6Se3 X-Received: by 2002:a50:ec8b:: with SMTP id e11mr24005355edr.344.1595309750847; Mon, 20 Jul 2020 22:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595309750; cv=none; d=google.com; s=arc-20160816; b=ZkOIsn4KSLi4POdlgyrZp+5QFrgAQACVj31DSYZDTuh2QcjaYOGhWztxO5+INEWPzg klfXOj2vLyV3mMZyc2Sx+2LP1sS97toTYYV9SQ+6QFzjvirlezxDZjuy7q7oY3T8mob7 7bZ/OAknp8VpAOXryVRpGFTcDAPO+PUEfDx1xP7rCAAOnMTgaqjzX4RmwdmVcMPkODhN wMGt1inH9bIT4BjBs7exMre42ElqbNxs7ZFziNAdfwEj4mY9T5N5j4BmfC5SAnZPQznS cvxNmLVHthrrTTnjfFPM8kAtpa01NEJGoYYEoRa9J4VfGB96vd5smqI0n9xEe3IK5anc 179w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:dkim-signature:date; bh=Xh6JYaPWaIWplZOMrnqFpx02BFp6tLeAYyDq7VCSNy8=; b=ndecPQXY1kPDNkC7nJyuKMIMsv0n8/oGBPS8rJ7tYn7fi1wyKy14nqU49aqFITKMIC UQtpNd329QmQpbekOrTrFDQrexQDAaF99+7StKH/pcrIIh3TOCsKqL5Jhl1BEm1g8vxT UQE7lFFc2UUMQZGU81WOSh8vw3HmCXNWe9JhSmH76OW5qSJDvLzGPN+tD0UpU0YZVoYN 4srij7098x5o8NR/KZoA+6COsZ/bBBvPuqzgTkIG89hbIP8DDvZIXE63CIx+BEvR4not BUfm/H49Gn1kwrdBRkdlQNSQnLBJLW3FAUjbipIdWgRNDJwxfvqmZHO/l3INS60GoNit A/4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LU+YNfvc; dkim=neutral (no key) header.i=@vger.kernel.org header.b=RUsOjoEY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw28si11834491edb.424.2020.07.20.22.35.28; Mon, 20 Jul 2020 22:35:50 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LU+YNfvc; dkim=neutral (no key) header.i=@vger.kernel.org header.b=RUsOjoEY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727026AbgGUFe7 (ORCPT + 99 others); Tue, 21 Jul 2020 01:34:59 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34992 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbgGUFe6 (ORCPT ); Tue, 21 Jul 2020 01:34:58 -0400 Date: Tue, 21 Jul 2020 07:34:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595309695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Xh6JYaPWaIWplZOMrnqFpx02BFp6tLeAYyDq7VCSNy8=; b=LU+YNfvcBeMNPH0PLwJ0qgIs+h+wwvZeWt+zW2ZTruQRUt3oshadWL8ke1wVqDH8bwS/iA gVJfxjyeyhiTMU2DtYGgaL2DpsA5Sb/+rQgZcwD2YcRhe25HXr/SLMALSaR2W9AIqUqswT om9AnGdNaYWNVisYJfo8s2KELwdI+S0lz2+Ed02bNPdzGIKfBqIv1Vd89TnxGUnAyCOPDO IA1y2vCczxhNw1Tuw8HhPM8BlLub5dKteD+AVEs1usMCIf02I8+4HSwV7ETlUa79VWbjTY gSjSgbbprSghcQ/r/v97o3PEumfu0Bhr3p5kLsudaatP5n5BTVGiMGKlgbY86Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595309695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Xh6JYaPWaIWplZOMrnqFpx02BFp6tLeAYyDq7VCSNy8=; b=RUsOjoEYNoCJ55m5UQP6l/dq4CRmDI5u8R4q0i/5goIRa7YQ47EFPiFtUdaUDMrNeWxKEk 6lG7KJJfJLIF/MCA== From: "Ahmed S. Darwish" To: Steven Rostedt 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: <20200721053453.GA27648@lx-t490> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200720213551.5ba9bc6d@oasis.local.home> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 20, 2020 at 09:35:51PM -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). will do. Thanks, -- Ahmed S. Darwish Linutronix GmbH