Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1036065pxa; Fri, 28 Aug 2020 01:38:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/EMBnfIwjDhnf2XWcesk4Za/y5VTD6n1rWBUlc52leiM0Ab0Og+RGTzxI+NJkjilBPqX2 X-Received: by 2002:a17:906:5fc5:: with SMTP id k5mr721838ejv.412.1598603914933; Fri, 28 Aug 2020 01:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598603914; cv=none; d=google.com; s=arc-20160816; b=H+nfM88u51aLZMLI1rekIr+CsJMGfVAjz9+fZ1ibnQdIY0m8wkJMpfbqdu7byMWLGy rz3VAOWl5IzHheHR1qNzvCQ15v1OzrblTmcWwqrsJZ+DlsT+PFl9sqJipZnVBvRjMPHN CGx1bigarbXwUJBRl0acI0zE6xWUzx29ATJTrRWvoUdBoZICeBOicVfUzgl/iTPpkni8 tP1nQhSQzMjri3C7pggSwHy/hCgGo9ynSDLBDf7gxM/Mdn9TA1ZK5+0LTi9aj7aiongZ QtUkEpTbzvVJcfT1LbOW725H7BDaP/S4dRde8c8UMUuvhD+gCqW2qmKFg7/qc8kKx+Hc Xd7g== 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=pOCz0+m6Q3dzLmGCe/U+1Ir1tkOUWh0lzPLpXP4rESU=; b=0WpUgVEx1VOiUr9T15Pper8Bs6G3ZREOr+4dqKTnwT2OH2BeAapU72g9fYz57QSBFw IauDLzllo5IKcTwPqm9R9DaR16Ty0dTsBzJay4T1TtvG0elLNy51pLr1FUv2YFJ5xxsD dbk6pkGmum8Kudhw8tHl0ic9Q1AEv1OiSOTDjbwF/TUSQ6dRjQTs/OUHBbVJMLKGbcF5 HptbiAQ2CNf49Evbq8Q5yg+FjpbFew3x3+VxYOjMKwHeUmcnWpjff5eqUTHYIhuDVwf1 /PBCLmLzvOrzMIQ1+yKyY6cgu7qLOxVpk/+swZmmKZEbMGezBLitqw/ZFmHsVNUJsGFX QnnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L64pBzxB; dkim=neutral (no key) header.i=@vger.kernel.org; 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 bu19si200977ejb.305.2020.08.28.01.38.11; Fri, 28 Aug 2020 01:38:34 -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=L64pBzxB; dkim=neutral (no key) header.i=@vger.kernel.org; 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 S1728555AbgH1Igq (ORCPT + 99 others); Fri, 28 Aug 2020 04:36:46 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:43856 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbgH1Ign (ORCPT ); Fri, 28 Aug 2020 04:36:43 -0400 Date: Fri, 28 Aug 2020 10:37:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598603801; 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=pOCz0+m6Q3dzLmGCe/U+1Ir1tkOUWh0lzPLpXP4rESU=; b=L64pBzxBF2X1LhBifpV/LOyayH7sFDp00Gu2jNEB7iQhEapqPAP6NN5ePDUSy/IcSu31k9 khRRwpvPowk1ObbACcrJUlutB7gMeC+IvQXPzWfj6TbnuBAEs51+IiusLM+5X3HsUz3Pz0 Ocb+8mJZxF6tgCey+lOfX1gP3LunL5a3Ny8+pE51UX81Lv5FtI/Vw63RjXLVPiFh0BXTVf yQKJTeub5n848JljZI2aiLusL2A0HmPrZjkzrIA5SWhbWnznJmaxD2emCppVoHSy5Z7Ew7 KP3kNLR77eO74UiwuClJUNWgzkqaIAhI6+6PP7f6dv0k2HsJJITLvwxLrRYPEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598603801; 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=pOCz0+m6Q3dzLmGCe/U+1Ir1tkOUWh0lzPLpXP4rESU=; b=dHNcpQcSx5+qWH8EuEM8+ttbRH3Srio3bSru4Zgk3bxanxxJKRKutAKN9sfv1rq8Wrzxl8 lRerVAUk/GRW5wBQ== From: "Ahmed S. Darwish" To: peterz@infradead.org Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , "Sebastian A. Siewior" , "Paul E. McKenney" , Steven Rostedt , LKML Subject: Re: [PATCH v1 3/5] seqlock: seqcount_t: Implement all read APIs as statement expressions Message-ID: <20200828083702.GA7074@lx-t490> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200828010710.5407-1-a.darwish@linutronix.de> <20200828010710.5407-4-a.darwish@linutronix.de> <20200828083022.GO1362448@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200828083022.GO1362448@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2020 at 10:30:22AM +0200, peterz@infradead.org wrote: > On Fri, Aug 28, 2020 at 03:07:08AM +0200, Ahmed S. Darwish wrote: > > #define __read_seqcount_begin(s) \ > > +({ \ > > + unsigned seq; \ > > + \ > > + do { \ > > + seq = __seqcount_sequence(s); \ > > + if (likely(! (seq & 1))) \ > > + break; \ > > + cpu_relax(); \ > > + } while (true); \ > > + \ > > + kcsan_atomic_next(KCSAN_SEQLOCK_REGION_MAX); \ > > + seq; \ > > +}) > > Since we're there anyway, does it make sense to (re)write this like: > > while ((seq = __seqcount_sequence(s)) & 1) > cpu_relax(); > > ? > Yeah, much better of course; will do. Thanks, -- Ahmed S. Darwish Linutronix GmbH