Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1926107rwb; Fri, 28 Jul 2023 18:19:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlEY5uRh3AAkdLNjKALwkpxFyFNIorQRueO16EaXEy2Mz/6TngvSjHr2x1DIXvFtv1fOl3rK X-Received: by 2002:a05:6a21:47c8:b0:134:24bf:51b with SMTP id as8-20020a056a2147c800b0013424bf051bmr2908452pzc.30.1690593558190; Fri, 28 Jul 2023 18:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690593558; cv=none; d=google.com; s=arc-20160816; b=TRHVQgmZuzjVDVVsxPC+M44AUCH+KL0hq3izpIu/pj3z4qT2oUZvhgjA72eq9ZihNd 2EUs+PmUSR83eeLR1Cigw9LnqOYsOROvQ+WT+s2NpwRClgpbtgDHW2yT4mWEE0dyViqW 5MxfOm4B5k8nclKoga2KPMlejQL7WsUEO6j+Kh8IEB3AgCbUmq9PcLyWscuMDDHTDa/J XeWS6cApyDdtYijOxwxgKIxgXfw8hoRNY6RP9pxfSvmUyRTayOgFHsERAUeBqyUN+e1x VQ/TgKQaKT4WBu9YMq+1OnUnlV6T/3kg5XQpjTqATYcV/OWq76VtPtPtYNUnozK0zKmC CU9w== 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=hdyXHCNmm6/5wN+6xDZf0F3DJhdGMtE6XIr7LH2nzps=; fh=4bZv/+lhpHLcPXAGBAwB3eSODQ2ic5dCx3ElA0y8CXI=; b=ASFX53K4p+7HjR9ImCta05EjedpGx8i80uTwZJfs97lE8PGpcg0OQKvTRJjihWMLSa ZjaN/7S2kp7nHmCsBho4OnsbsDQ1ymi0zsOtJrP2c927+mbwE88LT88uOzYXbdlym2j3 PTyV/Sxd9QEd6pzfAJeSg+7bcbPWme9mNsNlLZb4iFnCwOfeBZSWFQ51olqTseFa5nH+ 8lGR/sO6epJ9wES9+1jeQk0Z3ZijBzXuJJOiAHKM9X8CMeX+BFdmpm5MCyYUs5xCnOkC oJAVZauAyfYax+5InidGvVP1i6nfG2NsDVXgVob0azbJbWMSJtDrhmWTpPkdxZUPytJo mw9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=az3KeLxL; 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 e185-20020a6369c2000000b0055b82bb0bbdsi3701299pgc.879.2023.07.28.18.19.05; Fri, 28 Jul 2023 18:19:18 -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=@infradead.org header.s=desiato.20200630 header.b=az3KeLxL; 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 S234668AbjG1WEd (ORCPT + 99 others); Fri, 28 Jul 2023 18:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbjG1WEb (ORCPT ); Fri, 28 Jul 2023 18:04:31 -0400 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 7EDC72D5F; Fri, 28 Jul 2023 15:04:30 -0700 (PDT) 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=hdyXHCNmm6/5wN+6xDZf0F3DJhdGMtE6XIr7LH2nzps=; b=az3KeLxLnSrbQBwqv9/MzZharB XC/CzNA7Lp/jBX3ELKZoMfPLCFD8prlAFh1YU6kTTR2u17rl3JCqKw+pZowYM57qF6CPwb00aYwbX eBlOmmPr3eFJZvJ3MNy7wcBD1eLVBS3i3DtUJ6AGEt73k06W+rlctva3nopCF/GRvmg/r8r5tbF7O C32CVvNlLVubSVgvWVqJMelwfY8fE7Qt5yAo/bwDQe3SH7hyQ8VuLBLRIOfhU9Y5qwznNbklKqYBC W2pdV/Qoi7PugEUAq/+LeaTyGX125ueR/+JE2wvqq6Ku1Y6Jh+zFpOm1GQ5vj30Dzwphepn9MNOWV SueCznBA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qPVZS-008Veg-2p; Fri, 28 Jul 2023 22:04:27 +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 (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6A18030039F; Sat, 29 Jul 2023 00:04:26 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5144C2C973624; Sat, 29 Jul 2023 00:04:26 +0200 (CEST) Date: Sat, 29 Jul 2023 00:04:26 +0200 From: Peter Zijlstra To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, x86@kernel.org, rcu@vger.kernel.org, linux-kselftest@vger.kernel.org, Steven Rostedt , Masami Hiramatsu , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Andy Lutomirski , Frederic Weisbecker , "Paul E. McKenney" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Josh Poimboeuf , Jason Baron , Kees Cook , Sami Tolvanen , Ard Biesheuvel , Nicholas Piggin , Juerg Haefliger , Nicolas Saenz Julienne , "Kirill A. Shutemov" , Nadav Amit , Dan Carpenter , Chuang Wang , Yang Jihong , Petr Mladek , "Jason A. Donenfeld" , Song Liu , Julian Pidancet , Tom Lendacky , Dionna Glaze , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 10/20] jump_label,module: Don't alloc static_key_mod for __ro_after_init keys Message-ID: <20230728220426.GB3934165@hirez.programming.kicks-ass.net> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-11-vschneid@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230720163056.2564824-11-vschneid@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Thu, Jul 20, 2023 at 05:30:46PM +0100, Valentin Schneider wrote: > From: Peter Zijlstra > > When a static_key is marked ro_after_init, its state will never change > (after init), therefore jump_label_update() will never need to iterate > the entries, and thus module load won't actually need to track this -- > avoiding the static_key::next write. > > Therefore, mark these keys such that jump_label_add_module() might > recognise them and avoid the modification. > > Use the special state: 'static_key_linked(key) && !static_key_mod(key)' > to denote such keys. > > Link: http://lore.kernel.org/r/20230705204142.GB2813335@hirez.programming.kicks-ass.net > NOT-Signed-off-by: Peter Zijlstra (Intel) > Signed-off-by: Valentin Schneider > --- > @Peter: I've barely touched this patch, it's just been writing a comment > and fixing benign compilation issues, so credit's all yours really! Ah, it works? Excellent! You can remove the NOT from the SoB then ;-)