Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3612457pxu; Tue, 8 Dec 2020 17:18:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFLzN1V41QL8Urx0/FCYmz2oqKFBYyGDVsB5FxIvXtkExCMR169438Cj/ohlG40t9fXft3 X-Received: by 2002:a17:906:ce3c:: with SMTP id sd28mr54776ejb.485.1607476704319; Tue, 08 Dec 2020 17:18:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607476704; cv=none; d=google.com; s=arc-20160816; b=t6YO0lX8382PzY9jwCvqxWP93lVkgYWqBhkSM6IYkfib5yNzMz0/b+iWLUc9d6gMXR V1sNlRjiqzaz+g7z0f5ONDZXcs1ci48R7wp/8Nz+OAJXoe7XWY2Un/LBK9vh+QtWYw/4 exzYYYKD+mXnt2CMFsFHzOvgEJXUn9R9mtQzjOINFUpKiL4pmDXxoLDxrenyAomQ/zMB rKutKl4FRZErhSMXD0kQbMiVx6gTnofDzVv1zG9ItNXgmU7iDoWZD/sQsu8mLWr13Ton olhISss+2jDTnAMNm5cIcct/hMa4c5jAJ6qTygQiehA6quA3tcA0vWv+gIJ7Oh9e8CT5 M9zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tt5NYYW3eD0CdG20YGbejb4+Hp9N0V37FHt2G4ZFsdk=; b=kdIYQzcnIkogdgRiak4QG9ChriLX7XkTFn5Z7Dmlb9KISJZt1NpoaJm/VBRtqkLY8x h1uoalUbeTlG4vReGKv+chdigLD+OCUcW1oI9vYs/cnkHZa+GEDMAYm0e9+JBGyo98Wf n6z7yBvXzZqRKxqBfO4YuhCGbaWPq9U/+62fOY06m22lIbOq2eoPbykuwusASw0V6v+0 GdWPoWmnvpC7MDjZfjX3PG8bAzmBrDnWfOBWa7BNLAV1R3ONrlaCdfvo2y7wQAfSw2SX c0A5YcXEZe45saVu9LmQ97zPkqJIs1GLgNS1Eit9c1xzg1xB7H+4A4Vt/LGZiXyqUwBz fTgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oyVudvZz; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si90118ejc.524.2020.12.08.17.18.02; Tue, 08 Dec 2020 17:18:24 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=oyVudvZz; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726142AbgLIBEr (ORCPT + 99 others); Tue, 8 Dec 2020 20:04:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbgLIBEq (ORCPT ); Tue, 8 Dec 2020 20:04:46 -0500 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4F03C0613CF for ; Tue, 8 Dec 2020 17:04:06 -0800 (PST) Received: by mail-pl1-x644.google.com with SMTP id y10so43124plr.10 for ; Tue, 08 Dec 2020 17:04:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tt5NYYW3eD0CdG20YGbejb4+Hp9N0V37FHt2G4ZFsdk=; b=oyVudvZzPBxsLchBZ1RZ/5QowY9BdvvIe7OLQf2UDsbBXc7aYgEddgLgwUcOeUYl0J ZWfeTd/a9TEv5XYDG9XNXnry0r+TOeCEXSOumRtCXHkFyp68Uq/W5HYXRQaPdAMbQm+r Jkq4EPXkHa+gG0+KaUCAJjydTChXQnaDG8aorcaRXejDdzsb1NvrP25eF9zHvp3+RPqL F/BJZ9UHbgl5dA88CJlvXKIL4E+2KpPjttxAjshgJvmB+n8ElMInplyTp68ocr4kQ0MJ 4y3fbaSl3aStgBCYVWXnovLQ4ikUaRAXdBudH+LrlIkaxsNs+SZVGqazNclxMxjuP0CY x/3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tt5NYYW3eD0CdG20YGbejb4+Hp9N0V37FHt2G4ZFsdk=; b=KCXRE4P4ErUpZlQiKkUD5x7CvGVWpvvVZssUm17KRC1pJGiV066VcyZPDNx34RDIYv KlY1s641PEuyaqNY7bx5QShaAQz7CvrxiGXgJGlwUtW7tvNlGciMbA/ydSqiiWbTo9Pn q/e+Ioh6hl0WRinWUZX+IEgC0lBHpUDwXyTWJVMN5grpNv5Z4cDgsB3hCFysl9ELtfYH Do23w0JZ2MXuJHhib9QIHb+chZXibFHIbxDOoDER4SfHPJbzFVrbdszFFjN8JJZ3v6QB mVp5MWT4Q4X8QIx5bL2idaRKxJOmLtggCMzJPj5BQjuT/IYkeNmjFoFoqfT459UFtASh mJyw== X-Gm-Message-State: AOAM530gh9XBQ5qQNX9MGVxaSDfChjl+G6Lp+oflhRUkn60GmcygiC5c bUbZaP/ZEu0n2PLF7VePVLo= X-Received: by 2002:a17:902:848e:b029:d6:d2c9:1d4c with SMTP id c14-20020a170902848eb02900d6d2c91d4cmr172237plo.40.1607475846101; Tue, 08 Dec 2020 17:04:06 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:a6ae:11ff:fe11:4b46]) by smtp.gmail.com with ESMTPSA id y24sm9467pfn.176.2020.12.08.17.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 17:04:05 -0800 (PST) Date: Wed, 9 Dec 2020 10:04:03 +0900 From: Sergey Senozhatsky To: John Ogness Cc: Sergey Senozhatsky , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH next v2 2/3] printk: change @clear_seq to atomic64_t Message-ID: <20201209010403.GC1667627@google.com> References: <20201201205341.3871-1-john.ogness@linutronix.de> <20201201205341.3871-3-john.ogness@linutronix.de> <875z5c9bhn.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875z5c9bhn.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/12/08 23:36), John Ogness wrote: > On 2020-12-09, Sergey Senozhatsky wrote: > >> Sigh, atomic64_read() uses a spin lock in the generic implementation > >> that is used on some architectures. > > > > Oh... So on those archs prb is not lockless in fact, it actually > > takes the spin_lock each time we read the descriptor state? > > > > desc_read() > > atomic_long_read(state_var) > > atomic64_read() > > raw_spin_lock_irqsave(lock, flags) > > << NMI panic >> > > > > Am I missing something? > > For the state variable we chose atomic_long_t instead of atomic64_t for > this reason. atomic_long_t operations are available atomically on all > architectures. Right. Looking more at Kconfigs, it seems that when atomic_long_t is atomic64 (64BIT) then GENERIC_ATOMIC64 is not selected. Those archs that select GENERIC_ATOMIC64 unconditionally all seem to be 32-bit. Thanks. -ss