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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60E35ECAAA1 for ; Mon, 31 Oct 2022 18:48:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229739AbiJaSsh (ORCPT ); Mon, 31 Oct 2022 14:48:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiJaSsb (ORCPT ); Mon, 31 Oct 2022 14:48:31 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C07D2E5; Mon, 31 Oct 2022 11:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fuaMWNhnb5TiNUPZoY/TJFAbK2HLLTiwMddJQpgwTU8=; b=EA4XJo4GscWqo+/Kx110vWRkmZ P+x7F27NAR4Mtrri5TigDt2S4/XhFyxGyrvubbM9VAaKUo4BYpIBuLWvx57MQAm1eaUSwZBzVqWe7 xJFChseG2hkbb6FKSQj7xWkwaqVHUQe0th+CWVEiJM7oGGtmIzd+chkdbsJDHzrmkM9PmGFgFfGme o/55RUV44jPtbRBzge4dQQy8DNca1kN2b3mRuEKXanclFjdkQcBuAzFv+rCulH3dt3fjIGjQfXjY1 hzZo4ljhgh/tQ/zjlDrHWe9GkC3EnGq8PGwTN7PYa0jwbl2+bXhunAmo4pnFSQMKc557C1BmWEYG0 DxL0IuaA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1opZph-00Gle1-2n; Mon, 31 Oct 2022 18:48:25 +0000 Date: Mon, 31 Oct 2022 18:48:25 +0000 From: Al Viro To: Jann Horn Cc: Linus Torvalds , Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon Subject: Re: [PATCH v2] fs: use acquire ordering in __fget_light() Message-ID: References: <20221031175256.2813280-1-jannh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 31, 2022 at 07:13:30PM +0100, Jann Horn wrote: > On Mon, Oct 31, 2022 at 7:08 PM Al Viro wrote: > [...] > > No arch-specific instances, so... > > static __always_inline int > > arch_atomic_read_acquire(const atomic_t *v) > > { > > int ret; > > > > if (__native_word(atomic_t)) { > > ret = smp_load_acquire(&(v)->counter); > > } else { > > ret = arch_atomic_read(v); > > __atomic_acquire_fence(); > > } > > > > return ret; > > } > [...] > > Do we really have any architectures where a structure with one > > int field does *not* have a size that would satisfy that check? > > > > Is it future-proofing for masturbation sake, or am I missing something > > real here? > > include/linux/atomic/atomic-arch-fallback.h has a comment at the top that says: > > // Generated by scripts/atomic/gen-atomic-fallback.sh > // DO NOT MODIFY THIS FILE DIRECTLY Hmm... Apparently, the source is shared for atomic and atomic64, and the check is intended for atomic64 counterpart of that thing on 32bit boxen. Might make sense to put a comment in there... The question about architectures with non-default implementations still stands, though. Anyway, it's unrelated to the patch itself. I'm fine with it in the current form. Will apply for the next merge window, unless Linus wants it in right now.