From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4062EC4361B for ; Fri, 11 Dec 2020 21:59:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09FA523C84 for ; Fri, 11 Dec 2020 21:59:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395258AbgLKVLp (ORCPT ); Fri, 11 Dec 2020 16:11:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395159AbgLKVLT (ORCPT ); Fri, 11 Dec 2020 16:11:19 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF0DC0613D3; Fri, 11 Dec 2020 13:10:38 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607721037; 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=Mo2pAYuz+fdW3SgRq/XPKjojssrrAkt+Ucf5porPagA=; b=Jwq6ijv1GHVoieraIz9ydp2q4O6t/9GUc1eMMejV0w+8HMZFh2MudG98dd8dHkmBbtcY23 rWBcv8bjhS74ccS+ED0Y2Ffx6+AE3ILOJic4uDyRWA5WOr4daMkBthSaLo/d+kCRNbQOx4 /u1tQekXWSXK+tnBOy8SnybwPlOHVa58yu83Wz/vzB6Q7kN2A+/PUNns70l+Y5AN2H5xGf 7iGU6k2Q0hE5HprbYz1Eu3KcHibChvhCzqBaZRj/WCHuBdSDA1VHcJDgDidwq1qqERl/TB s9Q8j4pTrdZ9IKgusBRQ2bAa+V0Lruumrto07aTzrOd30AjJDgps945/dnu+DQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607721037; 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=Mo2pAYuz+fdW3SgRq/XPKjojssrrAkt+Ucf5porPagA=; b=6/ko850V23KEuDS4nOrh7BVWq2Ew0gOANx75sF2cdzYDioAkFAZKWg5jsxMNTHTfHBIf/A ckLpFAtkm+PHw5Bw== To: David Laight , Tvrtko Ursulin , LKML Cc: Peter Zijlstra , Marc Zyngier , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , "intel-gfx\@lists.freedesktop.org" , "dri-devel\@lists.freedesktop.org" , "James E.J. Bottomley" , Helge Deller , afzal mohammed , "linux-parisc\@vger.kernel.org" , Russell King , "linux-arm-kernel\@lists.infradead.org" , Mark Rutland , Catalin Marinas , Will Deacon , Christian Borntraeger , Heiko Carstens , "linux-s390\@vger.kernel.org" , Pankaj Bharadiya , Chris Wilson , Wambui Karuga , Linus Walleij , "linux-gpio\@vger.kernel.org" , Lee Jones , Jon Mason , Dave Jiang , Allen Hubbe , "linux-ntb\@googlegroups.com" , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Michal Simek , "linux-pci\@vger.kernel.org" , Karthikeyan Mitran , Hou Zhiqiang , Tariq Toukan , "David S. Miller" , Jakub Kicinski , "netdev\@vger.kernel.org" , "linux-rdma\@vger.kernel.org" , Saeed Mahameed , Leon Romanovsky , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "xen-devel\@lists.xenproject.org" Subject: RE: [patch 14/30] drm/i915/pmu: Replace open coded kstat_irqs() copy In-Reply-To: References: <20201210192536.118432146@linutronix.de> <20201210194043.957046529@linutronix.de> <87y2i4h54i.fsf@nanos.tec.linutronix.de> Date: Fri, 11 Dec 2020 22:10:36 +0100 Message-ID: <87eejwgib7.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 11 2020 at 14:19, David Laight wrote: > From: Thomas Gleixner >> You can't catch that. If this really becomes an issue you need a >> sequence counter around it. > > Or just two copies of the high word. > Provided the accesses are sequenced: > writer: > load high:low > add small_value,high:low > store high > store low > store high_copy > reader: > load high_copy > load low > load high > if (high != high_copy) > low = 0; And low = 0 is solving what? You need to loop back and retry until it's consistent and then it's nothing else than an open coded sequence count. Thanks, tglx