Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp477667ybr; Fri, 22 May 2020 11:04:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZEptKiR9A0x4Q6SN/xKHyoFaHTWzyVJszonJYfzYJ+zr+DBTe5HizRvb+0P20M6Ypkxa+ X-Received: by 2002:a17:906:951:: with SMTP id j17mr9057150ejd.352.1590170646166; Fri, 22 May 2020 11:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590170646; cv=none; d=google.com; s=arc-20160816; b=Neay1CU/m/be/vsRgYRwQaNdV25F/qFaauOW+amdKYszSYRH57cSWnyGtAkl2YCjA7 972CxuZFs+MbOBm3YN35CBFps0UNtTLhT7T+8sw0wTThCB9uHk52t0DEls4dR7J6yQZ6 1rkU+1Ms5t+sV3+jQ3EYy9gCAo9NpUXGCuLJChtCrqnEEYNM74ea8usX11nzGVTFZqYG 6MuMqMbRZzrSYU2hHbAE8iKPjREFPQRsRzf9l8aIFgbkA5d2m+C8JAVHWYVXyVk+QcaN We9uVRceULD8ZPR32nMSW3Oyxw7hlbGh0PgQBmL2pKEQ+7ToiuEBN5DDb8Xr9o0M1jwD JDyw== 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:date :dkim-signature; bh=BzGVoYi7lusRQAJzrnCE6lDqe1qUxbheoT+A3b9PhsQ=; b=wQdSDBEv1NWIzMzczIIaR9lqsHv1elpvre9BRoNTeET+H1HmSZdvKX+bRGYF4q/r26 70pkWmrrB5TDU6YCTeI5sx4cOZR79crALzBRJg2QEDpzpKo/gpmhUnkzsDzoJYyYVO6x DLyoBAWC0HbyWdRfluEsPjjNU0aISfvyF2+br4wzpfr+0r+hZLcpA3LkLtbGaGA4bgoT fy5hd7cDl/53V0ZSM5nCQqHGi1zR9Xywr1s6wm1HAy9/U5iFfR2JVIHLMIxgM7FzcWvM K3cpxVbbrB/tLJzZrDykGK7LuSsfekxNMjr4bBSEwCrsRCSX6RRadSnIN7Zv95RIyvfV 4i+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=BbUjf0Dx; 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 ca1si5195481ejb.42.2020.05.22.11.03.41; Fri, 22 May 2020 11:04:06 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=BbUjf0Dx; 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 S1730806AbgEVSCV (ORCPT + 99 others); Fri, 22 May 2020 14:02:21 -0400 Received: from merlin.infradead.org ([205.233.59.134]:51392 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730674AbgEVSCU (ORCPT ); Fri, 22 May 2020 14:02:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BzGVoYi7lusRQAJzrnCE6lDqe1qUxbheoT+A3b9PhsQ=; b=BbUjf0DxmZbE7vMsoDTX+agpyC vQk96e0N/CKRdTq03SRxDoA9kXQTJHweJuNq4kAm1mJZBrgQ3CfZBbhhZKZeCPgQTPDSwS7yq3FVo grzskRCdDWF2XZ3/EYZHw0QyNmRerw6gQDI851fIr5nhuBF26xSIIbsdU4+S5MqoHXqvc7oKodXTO 9Zm+wZZqSQpl3yXh7DSYVnVlAnJxGk6necklRg1aamOQg6Bwbu2SuW38AziE97XMp73yCHautbsfE Zh4RbLZIfOApClRpQsxDKg+GHRPRsmb8+Kt6EzhtM8V+04yMuD3yCDOC1Q7/P2w79rlI6e1MmdpZY vasXWTFw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jcBzP-0008Cl-Sb; Fri, 22 May 2020 18:01:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8530C301AC6; Fri, 22 May 2020 20:01:45 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 756A62B7F3D20; Fri, 22 May 2020 20:01:45 +0200 (CEST) Date: Fri, 22 May 2020 20:01:45 +0200 From: Peter Zijlstra To: "Ahmed S. Darwish" Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , "Paul E. McKenney" , "Sebastian A. Siewior" , Steven Rostedt , LKML , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [PATCH v1 09/25] Documentation: locking: Describe seqlock design and usage Message-ID: <20200522180145.GR325280@hirez.programming.kicks-ass.net> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200519214547.352050-10-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200519214547.352050-10-a.darwish@linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 19, 2020 at 11:45:31PM +0200, Ahmed S. Darwish wrote: > diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h > index d35be7709403..2a4af746b1da 100644 > --- a/include/linux/seqlock.h > +++ b/include/linux/seqlock.h > @@ -1,36 +1,15 @@ > /* SPDX-License-Identifier: GPL-2.0 */ > #ifndef __LINUX_SEQLOCK_H > #define __LINUX_SEQLOCK_H > + > /* > - * Reader/writer consistent mechanism without starving writers. This type of > - * lock for data where the reader wants a consistent set of information > - * and is willing to retry if the information changes. There are two types > - * of readers: > - * 1. Sequence readers which never block a writer but they may have to retry > - * if a writer is in progress by detecting change in sequence number. > - * Writers do not wait for a sequence reader. > - * 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 going forward. Unlike the regular rwlock, the read lock here is > - * exclusive so that only one locking reader can get it. > + * seqcount_t / seqlock_t - a reader-writer consistency mechanism with > + * lockless readers (read-only retry loops), and no writer starvation. > * > - * This is not as cache friendly as brlock. Also, this may not work well > - * for data that contains pointers, because any writer could > - * invalidate a pointer that a reader was following. > + * See Documentation/locking/seqlock.rst for full description. So I really really hate that... I _much_ prefer code comments to crappy documents.