From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013AbdAQXsl (ORCPT ); Tue, 17 Jan 2017 18:48:41 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33890 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751442AbdAQXrx (ORCPT ); Tue, 17 Jan 2017 18:47:53 -0500 Subject: Re: [PATCH] ARM: smp: Remove CPU: shutdown notice To: Russell King - ARM Linux References: <20170117230714.6799-1-f.fainelli@gmail.com> <20170117232314.GI27312@n2100.armlinux.org.uk> Cc: linux-arm-kernel@lists.infradead.org, Petr Mladek , Chris Metcalf , open list , Aaron Tomlin , Andrew Morton , "Paul E. McKenney" , Thomas Gleixner , Kees Cook From: Florian Fainelli Message-ID: Date: Tue, 17 Jan 2017 15:39:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170117232314.GI27312@n2100.armlinux.org.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/17/2017 03:23 PM, Russell King - ARM Linux wrote: > On Tue, Jan 17, 2017 at 03:07:12PM -0800, Florian Fainelli wrote: >> This message is not particularly informative, and is not paired with an >> identical message when a CPU is brought online. Finally, it slows the >> CPU hotplug path down, thus allowing less CPU hotplug operations per >> second. Just remove it. > > CPU hotplug isn't a fast operation anyway - it's also fairly disruptive > in that it uses stop_machine() to halt activity everywhere while taking > the CPU offline. We have a test that consists in shutting down all CPUs as frequently as we can and do this for about 2 million iterations which takes roughly 24h, and this printk slows thing down by a reasonable amount. Here are some numbers on 500 hotplug operations: w/ printk: real 0m9.997s user 0m0.725s sys 0m3.030s # w/o printk: real 0m8.547s user 0m0.436s sys 0m1.838s > > If you're worried about a single printk slowing things down, it sounds > like you're doing something wrong here - maybe you should be using > cpuidle for power management rather than trying to make CPU hotplug do > that for you? No, this is not about power management considerations here, just how fast we can bang it. > > A rapidly changing CPU hotplug state has other side effects - such as > reading /proc/interrupts is meaningless, because as soon as you've read > it the CPUs could have changed. It also makes a farce of spreading > interrupts over the available CPUs. > > All in all, I don't think this is a good idea... Well, for one it's inconsistent, and it also leaves room for subtle timing/caching issues with some platforms (OK, maybe not so much). Improving the speed and consistency was the primary motive. -- Florian