Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp229600pxh; Wed, 10 Nov 2021 00:37:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNYYX9LiLc33VIKlDwU6KfSGoa+x+rhFbGnA8TvkecYuPF+icOLXUHQkwpM0CvvFWDLjYH X-Received: by 2002:a02:b616:: with SMTP id h22mr3690102jam.127.1636533462975; Wed, 10 Nov 2021 00:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636533462; cv=none; d=google.com; s=arc-20160816; b=mUZB3j6by9bseCKCupr+H+PXgmNuuwgtETfrZzVxbgWsxZV4YWa97AyJLljhukudDx q0m7DkB0XDfwWPX82RR7Hfz2k24rthNvsyMQZ8KM+KNnhSlUTkV/dKZdmWUGpx4wyG3Z hpZRzahAvfsCLyHCRRApvfUrDIXBBeuNsy1EGQ41o0PQQV1M0/MlGed79kb33pjc+26k OA+mox2YSMXBa3D04/HHGsM2MJ2x2CFy6HZ/TD4AMgcWJdfLvfy7XULhoYrktWAo0OFv YE0+b9WCBYZqjI9h8O65ZeGAiV5SnkGXKeTZ7b55qTbpuhFfZtaae2v9iw+2jFSanHoo dxJA== 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=KQBIHvBKZon1pqxOOwdJjiEbS3m4taieQQby82kVzNc=; b=CPM2pjn9x5EoAwCYm4YSKgnmVaq3YDDNuCMH6dVLIINjWfUTh3aTHBG6f+zGz2ij8U NXyUFiTnrFRwVgmJJDlQGplSA/LV/WkDkRcLQui2z5LO9g4fjZ1d2eiXgJ/5wTn9CDmk A09aM6VRFq5927Epc3mDR9huPU8HJX7cVXehpXpkj6uOadn1qwQoDSCe4BJ7pi+1RbT1 PYZS+SxtcL6RGr0R+9/lGqxFEF0EM9fW2JURlVaVV6UaPkT2bVjF20cwbVIyhPYkkrSt 2tyyKqjb2fW7C0ZYMN0+bwgFukkVO6zzejRfhRc1gbsOlU/WimWl8Cwvib1Jg2/pSXKA uzsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=WRxzj2U3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s17si12119484jaj.108.2021.11.10.00.37.29; Wed, 10 Nov 2021 00:37:42 -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=@infradead.org header.s=desiato.20200630 header.b=WRxzj2U3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230126AbhKJIiy (ORCPT + 99 others); Wed, 10 Nov 2021 03:38:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbhKJIiy (ORCPT ); Wed, 10 Nov 2021 03:38:54 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03BA0C061764 for ; Wed, 10 Nov 2021 00:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KQBIHvBKZon1pqxOOwdJjiEbS3m4taieQQby82kVzNc=; b=WRxzj2U3//CGR6XyeLIMQV8vP6 OiTvd1NKXm0Mbmv6ihvPx7MwDoKEOa6moTZ/y1RwImMjEnWtnCRt9KJFoDOPL8oXe8YKrUYQrJxqe 9VHVHxE9Ta1G8zV3113f728+Z8oP4hf3qICWpPcIA04GHp6o30DV/20nuXUx/Ow41O4m9umVoeIo7 PdijSYweOJNy8swxRjq0UttMeS6+p0IBiOlnmoZC2qW6d8uB3bPkdQhCVjXdHoTWQuND3wVnTOiWc CF3DIsU1Tz2DZQPM0kXst3gv8p+b3GFzOxLJWCHcC1G4xGh+uGwiQZPKUTh6GJATVhFZ6boEfHF7U VkwKN/vg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkj55-00FEzb-NZ; Wed, 10 Nov 2021 08:35:44 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3561430003C; Wed, 10 Nov 2021 09:35:41 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D6913212EE584; Wed, 10 Nov 2021 09:35:41 +0100 (CET) Date: Wed, 10 Nov 2021 09:35:41 +0100 From: Peter Zijlstra To: Eric Dumazet Cc: linux-kernel , Eric Dumazet , jpoimboe@redhat.com, jbaron@akamai.com, rostedt@goodmis.org, ardb@kernel.org Subject: Re: [PATCH 2/2] jump_label: refine placement of static_keys Message-ID: References: <20211110010906.1923210-1-eric.dumazet@gmail.com> <20211110010906.1923210-3-eric.dumazet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211110010906.1923210-3-eric.dumazet@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 09, 2021 at 05:09:06PM -0800, Eric Dumazet wrote: > From: Eric Dumazet > > With CONFIG_JUMP_LABEL=y, "struct static_key" content is only > used for the control path. > > Marking them __read_mostly is only needed when CONFIG_JUMP_LABEL=n. > Otherwise we place them out of the way to increase data locality. > > This patch adds __static_key to centralize this new policy. > > Signed-off-by: Eric Dumazet > --- > arch/x86/kvm/lapic.c | 4 ++-- > arch/x86/kvm/x86.c | 2 +- > include/linux/jump_label.h | 25 +++++++++++++++++-------- > kernel/events/core.c | 2 +- > kernel/sched/fair.c | 2 +- > net/core/dev.c | 8 ++++---- > net/netfilter/core.c | 2 +- > net/netfilter/x_tables.c | 2 +- > 8 files changed, 28 insertions(+), 19 deletions(-) > Hurmph, it's a bit cumbersome to always have to add this __static_key attribute to every definition, and in fact you seem to have missed some. 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 :/