Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5932588rwp; Mon, 17 Jul 2023 11:49:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlEN28iEK00cVpC30tYFe+oESPgLfNey0fRUDlBH/XuRt1cV0AnriYNMVQxn8uQpq32K9LG3 X-Received: by 2002:a05:6a00:39a8:b0:673:6cb4:7b0c with SMTP id fi40-20020a056a0039a800b006736cb47b0cmr15157694pfb.2.1689619762327; Mon, 17 Jul 2023 11:49:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689619762; cv=none; d=google.com; s=arc-20160816; b=xmSCvGnxl7DxSB/O4UY0PbvpuBXQLPEi5jnCmhhWINgZErCzoAg2c9+JbLgQHIA9bA QK+8e5BjiSBSIPYD2ARXoGWOvttncb02uqxFgwSeiNJGZs0Bc4OmThag/JpI9n7tHGf7 7yOh2+zkCL57I/OVcb63s5i/VOov6rcjMnaJ/QVYVxcMUVTb+1EOWQ3jNvx3V08oofcp 8pClmVI/N03eh3KcZ36vaH7NGp+yMFmS09L5HV0Kj+i+oxorfhwzvTnOJ77lnW163+qQ 0wlo4FhbIrRT4dYt3VOW06YSkETQrE6ct7grLu1pJPoQ9iaWIv038CvwQEgFloqdqmjE ZtLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/gQWf/Lh1O+SDhuqheIyYLq5Uzd1/LSa61GJbvgmlmE=; fh=sSNl7/e316NsondZsgHqGfADVTbp4Ke0JmmZ/e8B0GM=; b=OUCASJyVKUEnQGzXIJPlJWUfqfnr/WIhl6o+ByyOqz7AdYzd08IbgtrVbvHi7ep46s j8V86CrpnT5ZXeeiNXFYY+0h7Do9IV2rsss9G8squodQGaovTdLwE6Nl99Mw7S0haQhT jxC0mOGj8oKVvxMTeZy50Rk/5okEp2BPfBt2eQp/0aDPNMIHWS4VK0QrongK9NR/tQPS stGBufsoOSSwcq5N/qYN3Sqy20sQVKZ7OPGAdQDlnlNKTrwx7jLfB5cEzNIbXdC0WMXR Encml2Qwgg2+qh51+GXkXCMJDTVttjNBYYRN5Tr6EM9J/g3tm+yGZFUGqmOseRTs2aLb RdAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ywfh0Qp3; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cu1-20020a056a00448100b0068240c29150si193396pfb.227.2023.07.17.11.49.09; Mon, 17 Jul 2023 11:49:22 -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-foundation.org header.s=google header.b=Ywfh0Qp3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231133AbjGQSK0 (ORCPT + 99 others); Mon, 17 Jul 2023 14:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230481AbjGQSKW (ORCPT ); Mon, 17 Jul 2023 14:10:22 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E30610D9 for ; Mon, 17 Jul 2023 11:10:17 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9891c73e0fbso990801266b.1 for ; Mon, 17 Jul 2023 11:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1689617415; x=1692209415; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/gQWf/Lh1O+SDhuqheIyYLq5Uzd1/LSa61GJbvgmlmE=; b=Ywfh0Qp3Sm7REwjcZZLDm//OW0h3u/cR9sbe1N4/dU2fi+SRRxNpYMY060hBB2eOS7 ypwUnpPwFGBBzgCQTWEDzkyK00smpBOXjPhzKjXTtu2cuuzPGZBzdXKyDvZfnZ/kaFrP zDG5CKC/cwUvdtyBIRB35K8zJ8qqI0FJaaPmk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689617415; x=1692209415; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/gQWf/Lh1O+SDhuqheIyYLq5Uzd1/LSa61GJbvgmlmE=; b=GL/JeMboZr+zcthI+0C3p/lA5TjceUYekG1ncG45EpIvBCGrivjZpWNatfYrSBG2PJ JkfR++MIB/0bO+6uBT07bkdi3f5Cu1gpqsgk17ivYfiRToYKhRP3BQUj+6ql9j6zC/hx 08dFlwK/Ryn1Q6XFExrdsVZ5j/dqGXYxFz7d/IeEYGwJYuaCV0FUuy4w2gRjsUsVH+Ls TVdhxpWemEqq6vnKtUAK5zprCtuv7zR9py5jFURqLhDvQ0BWCPbrN0YMEOv2CTAurmgW Rf/fIlDvWJLB46uMdBFmRguk1qtLAwQN9xXHpJMvErGxK7COgqihv2CTPMu7PkCHe1Nu BkCg== X-Gm-Message-State: ABy/qLagsByXAlf3idWW+GwGmYc1la6VIF07xSFu1LrfzqpXDAFhYaOl 0JUeYdVE3E6hZ6PugnjJ6ByOZ4IL+k+mvHDpgo+E4g== X-Received: by 2002:a17:907:7ba8:b0:989:21e4:6c6d with SMTP id ne40-20020a1709077ba800b0098921e46c6dmr11895823ejc.28.1689617415748; Mon, 17 Jul 2023 11:10:15 -0700 (PDT) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com. [209.85.208.43]) by smtp.gmail.com with ESMTPSA id u18-20020aa7d992000000b0050bc4eb9846sm10400874eds.1.2023.07.17.11.10.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jul 2023 11:10:13 -0700 (PDT) Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-51e344efd75so9960087a12.1 for ; Mon, 17 Jul 2023 11:10:13 -0700 (PDT) X-Received: by 2002:a05:6402:34c2:b0:51e:5206:d69e with SMTP id w2-20020a05640234c200b0051e5206d69emr12317922edc.10.1689617412904; Mon, 17 Jul 2023 11:10:12 -0700 (PDT) MIME-Version: 1.0 References: <6127192c-da9b-4599-9738-6e8f92e6c75c@paulmck-laptop> <20230717180317.1097590-3-paulmck@kernel.org> In-Reply-To: <20230717180317.1097590-3-paulmck@kernel.org> From: Linus Torvalds Date: Mon, 17 Jul 2023 11:09:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH rcu 3/6] srcu,notifier: Remove #ifdefs in favor of SRCU Tiny srcu_usage To: "Paul E. McKenney" Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, atthias Brugger , "Rafael J. Wysocki" , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Dmitry Osipenko , Sachin Sant , Joel Fernandes Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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, 17 Jul 2023 at 11:03, Paul E. McKenney wrote: > > +// Dummy structure for srcu_notifier_head. > +struct srcu_usage { > + char srcuu_dummy; > +}; > + > +#define __SRCU_USAGE_INIT(name) { .srcuu_dummy = 0, } You really should be able to just do struct srcu_usage { }; #define __SRCU_USAGE_INIT(name) { } which is something we've done for ages for spinlocks in include/linux/spinlock_types_up.h because while we had a gcc bug wrt empty structures, that was ages ago (ie "gcc-2.x"). See commit a1365647022e ("[PATCH] remove gcc-2 checks") from 2006. So we've already had these kinds of empty dummy structs for literally over a decade in active use. Exactly so that you can avoid having to use #ifdef's etc, and can just always assume you have a spinlock, even if it doesn't generate any code or any data overhead. Linus