Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1226912imm; Wed, 6 Jun 2018 12:28:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIWpdwzuYoBZSOdbV/49vnBFoACn09yehxrXEv/2GwHanDDI0yE5whL6+6YAZNPhwYcfqjh X-Received: by 2002:a63:69c4:: with SMTP id e187-v6mr768343pgc.294.1528313296563; Wed, 06 Jun 2018 12:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528313296; cv=none; d=google.com; s=arc-20160816; b=rkiqA++g0UQE7Mi2bykUrlsubKUM7D9gapJmrVudS5bhkrtAkygf8aLPtQ+7WV0nhg ajbudD0yR2L8Vm0fwvJiDwu2QQ8zK4frkzGj7Y5S4hrDlfQ6XLmS2IHjDTAZTNHJo+2c 0rmaQPBrce0IF+2M/Hl80GSNSuYT14AMEvnm2oa+p8XAMVG8dSkgCx993K9hHEncUusf 8trbB2cB6ptmt4FPHUR9JuDdgdlnv7GFpAE7nXEKdtXen9ACmhVCAE2EgIEuH8wbMpYs 8xHxA2JffzXZ5HioZAH9wHvSxVZHctJN0+5n5b42Qol+PTw77dpBtKQm35SIxvkSPqOT wB6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=D7+ec1aLHGxkrJYZOwBloraCN8bdyNNzjNwSP+MxZQU=; b=nw5F4v/59z+qemsIx0ZAfY2qaIRCj9Lzl+E4p4jGA4rfGb4wfjVa0PKSI+vAqUktps ir6GL8OzMIpoSGt7MrAm4L+uyy+VFarTqXQDprWfoj2HiMxwNPNmKHMbCQyEL5gAtiJK S/FIibF57gDpi2wpvcSKjkr71tkMqo/rki5Edk/c1woJ6PBDqtqr6fbclu9Lv0mW6EW6 vO2b1mZgeG675WspzP3hFQzOdpJP2wABO4mqAKRAYlCnpVa0chv+BVQT+VMS5LR2whj5 YuewhaFKMSVxP6bHYY8SbMgB40mZ6mNc/j4EuQIlF4Pbwxk4WvEu0gs482EbExtOa0yS NTQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dn2SCo0y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 98-v6si1862941pls.430.2018.06.06.12.28.02; Wed, 06 Jun 2018 12:28:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dn2SCo0y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932518AbeFFS7b (ORCPT + 99 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=D7+ec1aLHGxkrJYZOwBloraCN8bdyNNzjNwSP+MxZQU=; b=dn2SCo0y4vjBljuzRIjzyNi+R Ocdlnr7GqxW49Ye0d2vEDsDlVcS0cn+D8F4lvpRDfP0HbdRYpu2ngtOckP0+53G4pufuLRKXCS965 AxWYVslJuJVrEkCpAB/gEPisr/VGuoE7suE6K76q4TSD5sVPhkB4VLADDol09QLLPFce6mRVjGWrC lfpPpE8H9ad2SiP+AE4YujGeELm9oi1bREmujEYwJLtV5vNAFeVL75HP8v5VtE2KWFv5zWedWA2+0 WSLndFeqHtPRbKWMLUoLkIRH0cHIzBHnz46nJeXqtxeMHwqmmaEOkDFYvwQeuwdJ/kR+Lm6JtGp6S /OKATvT6Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQdeU-0008ID-L9; Wed, 06 Jun 2018 18:59:22 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 54683201EA7A3; Wed, 6 Jun 2018 20:59:20 +0200 (CEST) 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 Precedence: bulk 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 :-)