Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3602256yba; Tue, 23 Apr 2019 06:41:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyW0QpyPzBq1hSeew6tIDHzoWJAYF8Vy7/ab0vN6K8eegVRUA3CEOOwFihKSdSLBj9H309U X-Received: by 2002:a63:5041:: with SMTP id q1mr1614904pgl.386.1556026889262; Tue, 23 Apr 2019 06:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556026889; cv=none; d=google.com; s=arc-20160816; b=nROr5p90hKbEfk0rnUfsIB8YW7j3jUxE6SOWvgp7Eqx8JPdW7awS2RR2YAWskkuS3x Q2kKvkCNJn/3VATiNQack3jnJEtV/Mi21lpimRTbfEzsijA+fXbSa0JxPbyZKBSH5ZL8 cK6YKZ01fro94t9/Ouu/KX6uyz66s3p56VvCYwYKqMMThygkTOCCjVsDRmNvTKZSHNuU 6eJG97vv4bMY4c+iQi08BjJJLgaqPJ/GQyYuxlOLvugcT4Nu17VP3JKTVDbU5MP50ChL yD3H3/aNx+Gc8SVH7SHbcsPSCcK+532+rWls6Cj45OnfepmduK9GE/wUQfhuR0u1oL/3 astA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=y5x4SrRuOG6KqEv5SjoNKrRwTXVCdGEbhb9XQVsw16c=; b=HcgEC0HDlwCs40PqHUxRdmSiU1iomiUuFU6s6drFHoll5rUl1+T4cA0x7ub+OW5FvR lPWEcOigT9lCt7hOyVqjufVMons1EfU+MTUBVRI8/R0vwP7h0U7j8QmxnhVe6SPUuh1a TMFqS8r1E5ZbXXWKtyF3d/nX9uWlLMySmU4SLAmkfo5ADgvaZP42wbajeMUNcpCFlFN6 N0UafLDYvEEDhL//nfeXPi+BUxFWUJE22r+VAONRvFx5z2y6CVKJBN4jLgJKZY9bPVIQ 7sxNHgc0xQKFK8yIhfGzoIpF2sGnS0DYQOkr8CGxy3AO6/DMs+2fv26Kjy3oylmKfyV6 747w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=AR67rJjv; 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 b67si16809650plb.20.2019.04.23.06.41.13; Tue, 23 Apr 2019 06:41:29 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=AR67rJjv; 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 S1727758AbfDWNkN (ORCPT + 99 others); Tue, 23 Apr 2019 09:40:13 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49504 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbfDWNkN (ORCPT ); Tue, 23 Apr 2019 09:40:13 -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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y5x4SrRuOG6KqEv5SjoNKrRwTXVCdGEbhb9XQVsw16c=; b=AR67rJjv+UP1eHVJ2VGR1yZ1v TatE9hy4a62FXAqrTQjkOZ19cdYnX+aNt29yIWRQ9LmlV+1YnFkji6rG2QQs4yNhcUij7gdW10W0u fwodHhgs7DO628bPda+qCDSgB9y9bTv5mSM6KpXM5egVrlL3o8osyZ3fK/oxTD99EVlt7idE32obZ d/X7UFwLcQdAYpOPWZBHWoIweAj7Ly6piCBiB2K6RhfTwLjvruInpjd/aWu+IFkO05Op2cl6ZDzZ9 6QQ0yDJ30d0zpkhcwCks/uMgWCJfQxULQkZngC6eozsUQOehT95VwHMf7qxLCZNTLnmOApCR6h0RI WbHURFUcQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hIveW-0004xz-EL; Tue, 23 Apr 2019 13:40:04 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 35D6529C2338C; Tue, 23 Apr 2019 15:40:03 +0200 (CEST) Date: Tue, 23 Apr 2019 15:40:03 +0200 From: Peter Zijlstra To: "Paul E. McKenney" Cc: Nicholas Piggin , LKMM Maintainers -- Akira Yokosawa , Andrea Parri , Boqun Feng , David Howells , Daniel Lustig , Jade Alglave , Kernel development list , Luc Maranget , Alan Stern , Will Deacon Subject: Re: [PATCH] Documentation: atomic_t.txt: Explain ordering provided by smp_mb__{before,after}_atomic() Message-ID: <20190423134003.GV4038@hirez.programming.kicks-ass.net> References: <20190419180017.GP4038@hirez.programming.kicks-ass.net> <20190419182620.GF14111@linux.ibm.com> <1555719429.t9n8gkf70y.astroid@bobo.none> <20190420085440.GK14111@linux.ibm.com> <20190423123209.GR4038@hirez.programming.kicks-ass.net> <20190423133010.GK3923@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190423133010.GK3923@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 23, 2019 at 06:30:10AM -0700, Paul E. McKenney wrote: > There are a great many that look like this: > > smp_mb__before_atomic(); > clear_bit(NFSD4_CLIENT_UPCALL_LOCK, &clp->cl_flags); > smp_mb__after_atomic(); Ooh, marvel at the comment describing the ordering there. Oh wait :-( So much for checkpatch.pl I suppose. I think the first is a release order for the 'LOCK' bit and the second is because of wake_up_bit() being a shitty interface. So maybe that should've been: clear_bit_unlock(NFSD4_CLIENT_UPCALL_LOCK, &clp->cl_flags); smp_mb__after_atomic(); wake_up_bit(&clp->cl_flags, NFSD4_CLIENT_UPCALL_LOCK); instead?