Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4489103ivc; Tue, 3 Nov 2020 13:23:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJybMzmEFiiYKfY0ZrQ7l61KRbGubFa+CjvX0m+c1PlMmVsusii32+S+VZS3AfaY5HusyjXn X-Received: by 2002:a50:9fc1:: with SMTP id c59mr4049358edf.59.1604438607935; Tue, 03 Nov 2020 13:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604438607; cv=none; d=google.com; s=arc-20160816; b=ksl1FBZe/SZE+9Ozqj/ixf7B8sTaiO9lkGNulnvhqre6IzMdrj0ff0QBvxwGt+L8db 0fYk29Si4+eONgeYYD91dXIrjDMY2c8RNpCntgGUw9LwCkqTWEZjGCOY+wXr6b9i7dMI Az5box+Vr6B7DbEtgHSElOSBZcoOPZArCMm2l5pR1ezh97Z3QWQduFfLSlxdGlfwKFqK 46VA+n7jug8BiirM5y6LIDbGSOPVge+2JDtwZMLRpAnq0CYmY+2a7FKGdoVta+hcirgV xVu2fvMjIVQfdpqB4TKzacuFp2gtTQuAxK9jjwxjqgkrP008Cfu/AhnqesLiLfzC6JAt 2v7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uQ6oAOp1wmyL4IyMJ9PBMsxofF/IG0YQtplHqz/kf7A=; b=KIsvPt7yQTxhP0/GRQz7qQwvsfevXY6UwaJtKnvx76O0sDMSBaBi90K9+Fs3yfw3Fl RTPcTXoxLD2Bri8t3Tp85pCJ+Qz2OTiLbcCgM3sP2uzRDOWg7GuNn0FgiOwDps17++25 WiO/VWFGtYLCJVCrgbOfDUzypWrfpvH2CqvOxlFU5yLQWX2DA98t0Vu1vkkjGJHswBq6 WDCD/W+Fzd+YMwOFdlQuWojp0clPO4wlvIf2DPS6auUqYWXl42Jt3e/Qo8HXLh+T8yJ8 P3ttx3DLFPMH3Nj0ao41pCwy3Yn6Rz/N9DMrZILmmdJjIJinSzwufN5gNlCxkR/bx5dg 4+ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CNRafI0b; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh4si20814ejb.551.2020.11.03.13.23.05; Tue, 03 Nov 2020 13:23:27 -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=@kernel.org header.s=default header.b=CNRafI0b; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388285AbgKCVUW (ORCPT + 99 others); Tue, 3 Nov 2020 16:20:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:46280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388248AbgKCVHI (ORCPT ); Tue, 3 Nov 2020 16:07:08 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E0C33205ED; Tue, 3 Nov 2020 21:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437627; bh=2GUROSi3EXVC0/qC7i1BaF9zk+8qyzuG0+Q6BaSuNho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CNRafI0banfsyhQOCjQSkq2xIxPj1Nd57m3fwH8ENs3RKIN375nKYxdPU4k1AkSrI S6QIUvTc1Xc0fToE2peqhO5sI7s6Ps80hGFnUIEPX2oe/FdkwP0bZVgWvsnpLVIxmX AzvQetCly7A50c3zhW1HhYXpicVhFoQze/bcELnI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joel Stanley , "Gautham R. Shenoy" , Michael Ellerman Subject: [PATCH 4.19 156/191] powerpc: Warn about use of smt_snooze_delay Date: Tue, 3 Nov 2020 21:37:28 +0100 Message-Id: <20201103203247.174991659@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joel Stanley commit a02f6d42357acf6e5de6ffc728e6e77faf3ad217 upstream. It's not done anything for a long time. Save the percpu variable, and emit a warning to remind users to not expect it to do anything. This uses pr_warn_once instead of pr_warn_ratelimit as testing 'ppc64_cpu --smt=off' on a 24 core / 4 SMT system showed the warning to be noisy, as the online/offline loop is slow. Fixes: 3fa8cad82b94 ("powerpc/pseries/cpuidle: smt-snooze-delay cleanup.") Cc: stable@vger.kernel.org # v3.14 Signed-off-by: Joel Stanley Acked-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200902000012.3440389-1-joel@jms.id.au Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/sysfs.c | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c @@ -29,29 +29,27 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices); -/* - * SMT snooze delay stuff, 64-bit only for now - */ - #ifdef CONFIG_PPC64 -/* Time in microseconds we delay before sleeping in the idle loop */ -static DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 }; +/* + * Snooze delay has not been hooked up since 3fa8cad82b94 ("powerpc/pseries/cpuidle: + * smt-snooze-delay cleanup.") and has been broken even longer. As was foretold in + * 2014: + * + * "ppc64_util currently utilises it. Once we fix ppc64_util, propose to clean + * up the kernel code." + * + * powerpc-utils stopped using it as of 1.3.8. At some point in the future this + * code should be removed. + */ static ssize_t store_smt_snooze_delay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct cpu *cpu = container_of(dev, struct cpu, dev); - ssize_t ret; - long snooze; - - ret = sscanf(buf, "%ld", &snooze); - if (ret != 1) - return -EINVAL; - - per_cpu(smt_snooze_delay, cpu->dev.id) = snooze; + pr_warn_once("%s (%d) stored to unsupported smt_snooze_delay, which has no effect.\n", + current->comm, current->pid); return count; } @@ -59,9 +57,9 @@ static ssize_t show_smt_snooze_delay(str struct device_attribute *attr, char *buf) { - struct cpu *cpu = container_of(dev, struct cpu, dev); - - return sprintf(buf, "%ld\n", per_cpu(smt_snooze_delay, cpu->dev.id)); + pr_warn_once("%s (%d) read from unsupported smt_snooze_delay\n", + current->comm, current->pid); + return sprintf(buf, "100\n"); } static DEVICE_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay, @@ -69,16 +67,10 @@ static DEVICE_ATTR(smt_snooze_delay, 064 static int __init setup_smt_snooze_delay(char *str) { - unsigned int cpu; - long snooze; - if (!cpu_has_feature(CPU_FTR_SMT)) return 1; - snooze = simple_strtol(str, NULL, 10); - for_each_possible_cpu(cpu) - per_cpu(smt_snooze_delay, cpu) = snooze; - + pr_warn("smt-snooze-delay command line option has no effect\n"); return 1; } __setup("smt-snooze-delay=", setup_smt_snooze_delay);