Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp675720pxh; Wed, 10 Nov 2021 07:46:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhl53sn2s5KFIueNXZX5yq68/i9cZbtZpM3ADAPQX0YhuAftwqHzhp+dnWkEoNCPHNwtA/ X-Received: by 2002:a05:6402:1102:: with SMTP id u2mr678327edv.124.1636559201046; Wed, 10 Nov 2021 07:46:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636559201; cv=none; d=google.com; s=arc-20160816; b=YoYY7hJc/pp283+9H8bqxLq7DouFHkkTjk1KeP9YWgEZL8PBDEJa1JpK3ZH+ri8OfQ dP9jMzCpcI3inz1xFlnkhXf0iK5pP7kzDvFagJ+haQ8vGAPBtG8Vw5sLincGR0phZPy1 /0gTtJRaFNa8yGprR8tGRbat5oCUOaOViPKa5ZBWtFDRyNi2t1yK+YM3ANeWK96VTzyD 072vK+cVNaFKbxi2hrrods+pkeLYsNQe69f8ox6CQQ1UI0Tof6+JgyYmO/fmLoPnSTuS mArda49q0WMjCtHaXKpoKirvBXBPh30sgmTXtYLqA0bcplxVnNowLE+M4NGdai+B1I7/ dkJA== 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=M5ip8+WF10up78UWLF1pGKUjApOcu0vg6ZMhf84Dwo4=; b=pG1BNnkCU7ATt+cOpqmbQAEV7Ccdl9UFSBPKZ5kriCcYegTg98bOJqouubj0k3daBw x2jf/xwqOhtJi9Y+JySNptiN+P8jz9w9Ftm7cMGOuK5/EPpTm8CgxQQF50ZXQD7V/wXU dSZe1xTqo8+twa5U7APq3PLJCvUzgKC+M2nK/CpmzuyJ+uBi/5BFBbsmCqC8QMPqiMW+ M2Ea7DGMYubSI4+5v3ExkH639c7vL2Fiq/QN7dsknzBxP3fnFEwpXfDRmet8vH/t5fFk H7d3eGeve7TZTeaUr8ZFtKDgzeqcvkiB8le3uzN5kkYYgKZTnyNxR+G1ep+36j6prgtO eJNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="KR8INsl/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si274318eje.103.2021.11.10.07.46.16; Wed, 10 Nov 2021 07:46:41 -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=@google.com header.s=20210112 header.b="KR8INsl/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232298AbhKJPoZ (ORCPT + 99 others); Wed, 10 Nov 2021 10:44:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231408AbhKJPoY (ORCPT ); Wed, 10 Nov 2021 10:44:24 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD097C061764 for ; Wed, 10 Nov 2021 07:41:36 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id b12so4796475wrh.4 for ; Wed, 10 Nov 2021 07:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M5ip8+WF10up78UWLF1pGKUjApOcu0vg6ZMhf84Dwo4=; b=KR8INsl/WEQgnQoPf5irY+IeY98nazKbcca7XzB9sHhnzAoLjIOhrYP9wMynzham6e HIh1mf87JytOM3AsraHTbNBV2f60pEXtVdmGGKnA75LtJFnWxzV4GaW6sLmVhxCHKHul gnUbkstRgGTCdvpiF1u4WooF/Ez0BUZMwNoN1jz/ql5Rz7dEWDyPH1epswNz6g9PRSUu hPilxowN7Daxy62r2rQDDK4s9rzvDWtv18HEwk7+FgRkDXtKp1TTu+TcsGL/YsxwL/V4 moKH8Z2NodockxCtuXefZdHxJfAUoEh2KgDN7PbD1upbWGa+ldXS2qtbGLX/9PXi2Dqm 8qfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M5ip8+WF10up78UWLF1pGKUjApOcu0vg6ZMhf84Dwo4=; b=fiCjXU5uacMmVzpv+fcgKfzEaSVEcnyquOWznUQYM7jsaHLCvszvVOuz4/y3gpS618 ZpM/j22EgDkmBZnsinnpcbwZgupShYjeF1vXbFXClZx/ST5YLruetMiz2miYHP2zIqLe 3P9GBveZwC8XJE+eopYUTVbAVufFrDMMmvLYPBtMFc1af/LACgHfodhMDrGsjfbZYIxo 78rG8O6xcEfQJrwC7q8LskSMhBgEVGEM5pWxkq5nXyO6DYAWJV42lemVOA4kq0i0Im20 Tgrq50ewnjS3/YBG5bCU88uE+Kyd29efx3CqldIph4JVM0rluMW1bc/RNxCeK8WsyVtn e32w== X-Gm-Message-State: AOAM532ep+vY00f2ty+4TGsI4B9EbNOggEcvjxhBMeFO1ICVGtUKDN4R tAuQ+no1KhnxzuxVsTsqEBf2rQgvsmsbiRU5F6g8rQ== X-Received: by 2002:a5d:4a0a:: with SMTP id m10mr770486wrq.221.1636558894874; Wed, 10 Nov 2021 07:41:34 -0800 (PST) MIME-Version: 1.0 References: <20211110010906.1923210-1-eric.dumazet@gmail.com> <20211110010906.1923210-3-eric.dumazet@gmail.com> In-Reply-To: From: Eric Dumazet Date: Wed, 10 Nov 2021 07:41:22 -0800 Message-ID: Subject: Re: [PATCH 2/2] jump_label: refine placement of static_keys To: Peter Zijlstra Cc: Eric Dumazet , linux-kernel , jpoimboe@redhat.com, jbaron@akamai.com, rostedt@goodmis.org, ardb@kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 10, 2021 at 7:30 AM Eric Dumazet wrote: > > > Sure, I can make sure to include all cases. I was hoping > DEFINE_STATIC_KEY_TRUE()/DEFINE_STATIC_KEY_FALSE() > would catch the majority of uses. > > We also can add a new DEFINE_STATIC_KEY() macro to ease these cases. Although use of 'struct static_key' is marked deprecated. I guess that we can leave legacy uses be converted by maintainers if they care. (They do not have to, __static_key section is only a hint, not a requirement) For instance these ones had no __read_mostly and nobody cared. arch/x86/kernel/paravirt.c:124:struct static_key paravirt_steal_enabled; arch/x86/kernel/paravirt.c:125:struct static_key paravirt_steal_rq_enabled; > > > > > > > Would something like: > > > > typedef struct static_key __static_key static_key_t; > > > > work? I forever seem to forget the exact things you can make a typedef > > do :/ > > I tried, but a typedef was not working. A macro would work.