From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6123EC004D4 for ; Thu, 19 Jan 2023 13:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1MoAD+CO2Q9/JzpR3UKCNz+iZjNg3+Hj3UNd7ktV3x4=; b=W3kw/hBJJ+tKgx JLt1lkvfmxqmLrDS/Vo+NWo4DwKnTs6A/k+YfoJ56UgaKb4vWFHglhBjheYSEVNp2xcWj8XrMoL3m 5hqn2UN47seE/6HUhHqZr8xJACYFJ1IiE+bSxSNOs5YSX2y55/rlIhpuzCVd48DunmXuC65YwZXTZ ulryJm0lHu402VjsRSiwhU0h5Pyxudb/AVtn94EfP/90Lybhc10M5zWxzr4UEm6NaLLqLY6tYd5p5 u8JBdHumcG9xNgqV5HUOsr8NdxihAvZYFScHJzh6Db2esmz798tZmUQeZ/dWaAJq1KB1TF1AWQr35 KICUCD69ayZ7SOWLDx5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIVQe-005C2F-St; Thu, 19 Jan 2023 13:58:09 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIVQb-005C1A-Ka for linux-arm-kernel@lists.infradead.org; Thu, 19 Jan 2023 13:58:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AC673B823CA; Thu, 19 Jan 2023 13:58:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12483C43392; Thu, 19 Jan 2023 13:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674136682; bh=epbO/VybMvBMU2YFWAcNyutM/yOiKghht0mu5n9HyFU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RbqtyKipCFEz1meg/C62GcT9wXf2cWZ7VqY3dcDRqKhJ1GYal7pCvJCDAb58W8f/j FMqFpRjupf6a3D3KS+nwPZPuqxPRkJj7JO05sczig+wi8gR52HacjpHgGIr2reQXXD QOYSM+t5er6GERSmfRWEoE04Z4XxRajiLJcIrLDrpkA/o8ql2PiyRCQciHmP65+0kG ijQMGZdoKRxpp982xl9JSeZX8bnrhkLpx+P3HJIgTPDyTbja6mmNrkFxGMOv8mhA5k 48cmHce44kQ137PGKyEVsd7wpJTuws/rOMdAYGBA7G5uXhQJa/p9Z5fPSA+5E4HJDp f/pe9a3KTwITw== Date: Thu, 19 Jan 2023 14:57:59 +0100 From: Frederic Weisbecker To: Joel Fernandes Cc: "Paul E. McKenney" , Zhouyi Zhou , "moderated list:ARM/STM32 ARCHITECTURE" , Will Deacon , Marc Zyngier , Mark Rutland , Catalin Marinas , rcu Subject: Re: arm64 torture test hotplug failures (offlining causes -EBUSY) Message-ID: References: <20230117043011.GD2948950@paulmck-ThinkPad-P17-Gen-1> <24953EEA-5B3E-4046-B106-7A7FBE8B8995@joelfernandes.org> <20230117045456.GG2948950@paulmck-ThinkPad-P17-Gen-1> <20230117204231.GP2948950@paulmck-ThinkPad-P17-Gen-1> <20230118040058.GV2948950@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_055805_980701_36FAABFD X-CRM114-Status: GOOD ( 22.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 18, 2023 at 10:37:08PM +0000, Joel Fernandes wrote: > > That's a great idea. I found a way to do that without having to do the > EXPORT_SYMBOL (like in Zhouyi's patch). > > Would the following be acceptable (only build-tested)? > > I can run more tests and submit a patch: > > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c > index 55405ebf23ab..f73bc520b70e 100644 > --- a/drivers/base/cpu.c > +++ b/drivers/base/cpu.c > @@ -487,7 +487,8 @@ static const struct attribute_group *cpu_root_attr_groups[] = { > bool cpu_is_hotpluggable(unsigned int cpu) > { > struct device *dev = get_cpu_device(cpu); > - return dev && container_of(dev, struct cpu, dev)->hotpluggable; > + return dev && container_of(dev, struct cpu, dev)->hotpluggable > + && !tick_nohz_cpu_hotpluggable(cpu); > } > EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); > > diff --git a/include/linux/tick.h b/include/linux/tick.h > index bfd571f18cfd..9459fef5b857 100644 > --- a/include/linux/tick.h > +++ b/include/linux/tick.h > @@ -216,6 +216,7 @@ extern void tick_nohz_dep_set_signal(struct task_struct *tsk, > enum tick_dep_bits bit); > extern void tick_nohz_dep_clear_signal(struct signal_struct *signal, > enum tick_dep_bits bit); > +extern bool tick_nohz_cpu_hotpluggable(unsigned int cpu); > > /* > * The below are tick_nohz_[set,clear]_dep() wrappers that optimize off-cases > @@ -280,6 +281,7 @@ static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask) { } > > static inline void tick_nohz_dep_set_cpu(int cpu, enum tick_dep_bits bit) { } > static inline void tick_nohz_dep_clear_cpu(int cpu, enum tick_dep_bits bit) { } > +static inline bool tick_nohz_cpu_hotpluggable(unsigned int cpu) { return true; } > > static inline void tick_dep_set(enum tick_dep_bits bit) { } > static inline void tick_dep_clear(enum tick_dep_bits bit) { } > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > index 9c6f661fb436..d1cc7525240e 100644 > --- a/kernel/time/tick-sched.c > +++ b/kernel/time/tick-sched.c > @@ -522,6 +522,11 @@ static int tick_nohz_cpu_down(unsigned int cpu) > return 0; > } > > +bool tick_nohz_cpu_hotpluggable(unsigned int cpu) > +{ > + return tick_nohz_cpu_down(cpu) == 0; > +} > + Can you make it the opposite? Have tick_nohz_cpu_down() call tick_nohz_cpu_hotpluggable()? To avoid future accidents. Thanks. > void __init tick_nohz_init(void) > { > int cpu, ret; > -- > 2.39.0.246.g2a6d74b583-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel