Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4923839rwb; Sun, 4 Dec 2022 10:38:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf46RquANFI2aLbwRbFzGllIRh6tLktWRSmC3vyDrhtmSzgEmm2rNT3VEeWx6Li7yHP753zy X-Received: by 2002:a17:907:3101:b0:7c0:f45e:22ff with SMTP id wl1-20020a170907310100b007c0f45e22ffmr1511744ejb.104.1670179097828; Sun, 04 Dec 2022 10:38:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670179097; cv=none; d=google.com; s=arc-20160816; b=eveGM39zGO+67xgflPyYdvNElKwXpJ1IhsV8y+03x3xl2xnq1BuQUcYvnydTIfb2/0 75M4g1Z4s1/c7MVf0LMe2MGKR9LH/tJEBetXPz+RRtXx2/KBUJTAXSv6fRHiUM6EGReA p0HfWCUXLoXAZUaaS+D/eXjLyGpwGBz2FCZ5Z2X83bKoLBj5NmdW9UDIRj5yZeFAvM3T Xo3jajnzWVzko0eWfVb3tJfeo3hullkeYdBP+lDVexFy/0Wrn03mMczhN0+QjgyToUtX IGcMzWlXDHxeHaroeYlw45OCMJy5JTdOLZ3JDacUIr7HPWfWbtW4qMjhezVPVKVcKdjD yTBg== 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=lN8frKuhbaasaQJGEoiPgCA0LmRdK0VQNNyuQB2MjRA=; b=yKRMz7MNIPgXfj1jL0e3aUP+t9dLGM/vg0SpT+ITLvc16WpByKCGC9QZPR9oSxndRB uqmZi1DbnAnx3HIT3fKa5jqUcLuFMeORBdqaaYB6EvXxshO383r3ikVu1Y/08FP7RhFU 5+RFty2awqc24KCs1rizyhcrM0vOMe7OBYNezIJUwRhmPI+HdZi/UrJmAk7DMzCTao3V /em9BfEx0uQn0Z1AulrkAZpMuoS/L9iXMFS51MwKQrF9gM9L2LvHB4Z54MYvHozTPvcp +zrHN+FM9qzk2Zsa29CEuaB395H4HRRyp1CzcILBzX+hjkL/uPaDk6OJgrV4XKCAGOqz b3gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=lozCNi0L; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z44-20020a509e2f000000b004674c93ecb8si9841509ede.326.2022.12.04.10.37.58; Sun, 04 Dec 2022 10:38:17 -0800 (PST) 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=@alien8.de header.s=dkim header.b=lozCNi0L; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbiLDS3T (ORCPT + 83 others); Sun, 4 Dec 2022 13:29:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbiLDS3R (ORCPT ); Sun, 4 Dec 2022 13:29:17 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8730112A9B; Sun, 4 Dec 2022 10:29:16 -0800 (PST) Received: from zn.tnic (p200300ea9733e799329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e799:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 755611EC0662; Sun, 4 Dec 2022 19:29:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1670178554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=lN8frKuhbaasaQJGEoiPgCA0LmRdK0VQNNyuQB2MjRA=; b=lozCNi0LBzmr7CUeSL4cou2nl9OvNILUvzB3GVvOsT9ipRAQtwJUuTW8PtWXidk8f2iOY+ enYjO4utqS2T0OIq/jYTGYu11SgE2LUFQpxUV9gYqXtWgVBdq2en3lVhfCpbDM1TU5lOC6 kLlZZ9FKrjAts/rT747ygAescekIKfA= Date: Sun, 4 Dec 2022 19:29:09 +0100 From: Borislav Petkov To: "Rafael J. Wysocki" Cc: Stuart Hayes , Viresh Kumar , Kyle Meyer , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: acpi: Defer setting boost MSRs Message-ID: References: <20221102195957.82871-1-stuart.w.hayes@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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, Nov 03, 2022 at 07:19:47PM +0100, Rafael J. Wysocki wrote: > On Wed, Nov 2, 2022 at 9:01 PM Stuart Hayes wrote: > > > > When acpi-cpufreq is loaded, boost is enabled on every CPU (by setting an > > MSR) before the driver is registered with cpufreq. This can be very time > > consuming, because it is done with a CPU hotplug startup callback, and > > cpuhp_setup_state() schedules the callback (cpufreq_boost_online()) to run > > on each CPU one at a time, waiting for each to run before calling the next. > > > > If cpufreq_register_driver() fails--if, for example, there are no ACPI > > P-states present--this is wasted time. > > > > Since cpufreq already sets up a CPU hotplug startup callback if and when > > acpi-cpufreq is registered, set the boost MSRs in acpi_cpufreq_cpu_init(), > > which is called by the cpufreq cpuhp callback. This allows acpi-cpufreq to > > exit quickly if it is loaded but not needed. > > > > On one system with 192 CPUs, this patch speeds up boot by about 30 seconds. > > > > Signed-off-by: Stuart Hayes > > --- > > drivers/cpufreq/acpi-cpufreq.c | 31 +++---------------------------- > > 1 file changed, 3 insertions(+), 28 deletions(-) ... > Applied as 6.2 material, thanks! My 32-bit Atom doesn't like this one. Reverting fixes it ofc. [ 22.780260] unchecked MSR access error: WRMSR to 0x1a0 (tried to write 0x0000004364950488) at rIP: 0xf80b37d4 (boost_set_msr.isra.0+0x9c/0x114 [acpi_cpufreq]) [ 22.781186] Call Trace: [ 22.781186] boost_set_msr_each+0x15/0x1c [acpi_cpufreq] [ 22.781186] __flush_smp_call_function_queue+0x132/0x1cc [ 22.781186] ? sysvec_call_function+0x30/0x30 [ 22.781186] generic_smp_call_function_single_interrupt+0x12/0x18 [ 22.781186] __sysvec_call_function_single.constprop.0+0x43/0x1d8 [ 22.781186] sysvec_call_function_single+0x18/0x30 [ 22.781186] handle_exception+0x133/0x133 [ 22.781186] EIP: finish_task_switch.isra.0+0x124/0x3a8 [ 22.781186] Code: d8 e8 8c 16 92 00 85 f6 75 e8 a1 04 24 6c c2 85 c0 0f 8f 9b 00 00 00 89 d8 e8 e4 02 92 00 e8 53 9e 0b 00 fb 64 a1 40 f9 69 c2 <8b> 80 5c 0f 00 00 85 c0 0f 85 72 01 00 00 a1 28 24 6c c2 64 8b 15 [ 22.781186] EAX: c32e2700 EBX: f748af40 ECX: 00000000 EDX: c1c3876e [ 22.781186] ESI: 00000000 EDI: 00000000 EBP: c3241f90 ESP: c3241f78 [ 22.781186] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00000206 [ 22.781186] ? uevent_seqnum_show+0x1b/0x28 [ 22.781186] ? pid_list_refill_irq+0x128/0x1c0 [ 22.781186] ? sysvec_call_function+0x30/0x30 [ 22.781186] ? pid_list_refill_irq+0x128/0x1c0 [ 22.781186] ? sysvec_call_function+0x30/0x30 [ 22.781186] ? finish_task_switch.isra.0+0x124/0x3a8 [ 22.781186] schedule_tail+0x12/0x78 [ 22.781186] schedule_tail_wrapper+0x9/0x10 [ 22.781186] ret_from_fork+0x5/0x28 [ 22.781186] EIP: 0xb7fba549 [ 22.781186] Code: Unable to access opcode bytes at 0xb7fba51f. [ 22.781186] EAX: 00000000 EBX: 01200011 ECX: 00000000 EDX: 00000000 [ 22.781186] ESI: 00000000 EDI: b7bfe868 EBP: 00000000 ESP: bfcfedc0 [ 22.781186] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000246 -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette