Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp714911qtx; Mon, 31 Oct 2022 12:06:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5o21po52g45aZlTIl0RTOLYkTLiiXW6+sSmeQVruXL/AfKAR/f8NDjGtcXRKrPCwEtJB42 X-Received: by 2002:a17:907:628a:b0:781:bbff:1d42 with SMTP id nd10-20020a170907628a00b00781bbff1d42mr14045564ejc.375.1667243167127; Mon, 31 Oct 2022 12:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667243167; cv=none; d=google.com; s=arc-20160816; b=vNowEAkdNFQmq4Hr3NYzmb3BZaJ5HqFXf+XiIiilgHc4VTS9JJCIeP8FIZqW8XsxiO gZxAxBHNl7Zp+ixEQzLxTw1JhHU7fBGVRmAhU0347wIUHd0qN7MyewP4VYAa+Gp8ialc 6M8/m0rAvYcICvGVoP8jK4M0GPswAvhPtd+hH4ximrjWFowB8brdXNNbqxRSZK+DkrJ3 LLUeh+ovO2gpL7MMSOzbPHvWiEOYCUooUovZSPA8MKo9A91O3P9El84bP0ZJrtdqM4Gp n1N6DDyIEqCCNfaM9vrmhQEKQdbEN8ogVtqLWW75HN2X/D4R+0LM+cWkYu+QNIsfX2ti GloA== 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:date :dkim-signature; bh=fuaMWNhnb5TiNUPZoY/TJFAbK2HLLTiwMddJQpgwTU8=; b=tdFmr/IhSW0dAsHYGTMD1sClC4GnZsfNb+VJANgN57E6FQsv1CgounYNkQqctk0RBQ VwARvFTu+kPaNp2JahuPwaMsY8Euxy+swiQuXMe6bVGh7sQq8eW0Vv7M1s9yWiyfiEbm KgLxsPtsMCetaGT4m9Qj15URb3x/r+1koYI/oJvl2Rxt6UJ/i/TXhiSlj6FZmHHZ1aGi rVlNrg2/l4sIYBRQ7t4qCggmIB6t9M4TYTFwtb4AkWXHGA2Ji9FrcgiM6ALcbYkf66dH Qy8pjphJMUCqdeO5aT0/9xOBV/ahn3j38SmW+trgnGUWj+mzxQ1RUEpy0EsFVKriajzg IfcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=EA4XJo4G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a056402134f00b00457fc1bcf12si7104496edw.183.2022.10.31.12.05.42; Mon, 31 Oct 2022 12:06:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=EA4XJo4G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229727AbiJaSsg (ORCPT + 98 others); Mon, 31 Oct 2022 14:48:36 -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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.