From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Authentication-Results: smtp.codeaurora.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dn2SCo0y" DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 150F560763 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932522AbeFFS7b (ORCPT + 25 others); Wed, 6 Jun 2018 14:59:31 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44916 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932498AbeFFS73 (ORCPT ); Wed, 6 Jun 2018 14:59:29 -0400 Date: Wed, 6 Jun 2018 20:59:20 +0200 From: Peter Zijlstra To: Oleg Nesterov Cc: "Kohli, Gaurav" , tglx@linutronix.de, mpe@ellerman.id.au, mingo@kernel.org, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Neeraj Upadhyay , Will Deacon Subject: Re: [PATCH v1] kthread/smpboot: Serialize kthread parking against wakeup Message-ID: <20180606185920.GI12198@hirez.programming.kicks-ass.net> References: <830d7225-af90-a55a-991a-bb2023d538f1@codeaurora.org> <55221a5b-dd52-3359-f582-86830dd9f205@codeaurora.org> <20180605150841.GA24053@redhat.com> <20180605152212.GY12180@hirez.programming.kicks-ass.net> <20180605154053.GB12235@hirez.programming.kicks-ass.net> <20180605163515.GB24053@redhat.com> <20180605201316.GZ12198@hirez.programming.kicks-ass.net> <20180606135115.GA4609@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180606135115.GA4609@redhat.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 06, 2018 at 03:51:16PM +0200, Oleg Nesterov wrote: > IIUC, this will only affect smpboot_update_cpumask_percpu_thread() which can hit > an already parked thread, but it doesn't need to wait. > > And it seems that smpboot_update_cpumask_percpu_thread() in turn needs some cleanups. > Hmm. and its single user: kernel/watchdog.c. > > And speaking of watchdog.c, can't we simply kill the "watchdog/%u" threads? This is > off-topic, but can't watchdog_timer_fn() use stop_one_cpu_nowait(watchdog) ? > > And I really think we should unexport kthread_park/unpark(), only smpboot_thread_fn() > should use them. kthread() should not play with __kthread_parkme(). And even > KTHREAD_SHOULD_PARK must die, I mean it should live in struct smp_hotplug_thread, > not in struct kthread. > > OK, this is off-topic too. > And, let me repeat, can't we avoid complete_all() ? Yes, or at least if that watchdog crap is the only user. I have most of the patch reworking watchdog.c to use stop_one_cpu*(), and that cleans up lots -- of course, I've not tested it yet, so it could also be breaking lots :-)