Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1872551imm; Thu, 7 Jun 2018 01:32:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLm2iu6AkyRTFlJF2MhMTuNmd2pCPpyC0qWitf534W5F2Xm33CaQqnxpCib1X6Y3StqV5FL X-Received: by 2002:a17:902:708c:: with SMTP id z12-v6mr1008340plk.373.1528360364399; Thu, 07 Jun 2018 01:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528360364; cv=none; d=google.com; s=arc-20160816; b=o8U1vTDKcV+22U5rSgZRSQHGBRyrvwuocSN88/PNlDjHUvuuqKlFwa/95eu4RHTl4H 8gWPJG+s59BG7VidGUoDM9CsFV71O7I+s+c77PEsvW8uS2AV6EKck6Wo4baum1ingyJ+ EjquLE89iNlqIBGVU9kY5iRcyXfMvgput8mro2RR+JoJ/aYxhcsyMt0P4l0PBz4l8UNC 6Ooy74K6uTPdIwUTOiFVuXMJiJdCCKePh7AmBwIDp/gIpcVXoidTKHcKP4zsqdRazQiI kqT+1uljQwC7HFxMYnTU2nF1aMc4GabnqvpnN6ry1L4aDToEzrzPNTFYLiyhrWsA0KSr +LQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=jvw+3vBo3cRMUetA3zUKf/5js72VYYKhVp0bSOEfSnU=; b=gktMxfUCJgNugVC4tQX1vwOMdSGmBoeFEsPQHDk0VXIr94ECWrQpQqHQAa+Y1ZLE2F zqjAr8T4tfIJSRaLngkX9bXCed880D8IK5THVkR0MFOePzRUWBisSo4i5cxCMQk//RTE tQI2tHBV6AbMRgi21VcGRwd8Yz15WRMDLI16NALUcU1N9vWcn8WPW4YzwPfcisCbVHRN XwbOtjPt7y+7EYFrO1wj5apzGRbPFTIt1U6M6thGZomnHxmK1uFsSN+lwKlumglGDLH0 PrqDO+Gqoubc7MUPEnzmhRx8eTPOH1ch2YTO7n6fOoa8uFUVGFBwAPQSmdD6VOQ84ft1 p0rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=ANdqjvYO; dkim=pass header.i=@codeaurora.org header.s=default header.b=ANdqjvYO; 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 d1-v6si3503408pll.375.2018.06.07.01.32.29; Thu, 07 Jun 2018 01:32:44 -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=pass header.i=@codeaurora.org header.s=default header.b=ANdqjvYO; dkim=pass header.i=@codeaurora.org header.s=default header.b=ANdqjvYO; 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 S932681AbeFGIbB (ORCPT + 99 others); Thu, 7 Jun 2018 04:31:01 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41962 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932323AbeFGIa7 (ORCPT ); Thu, 7 Jun 2018 04:30:59 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D69D6608C8; Thu, 7 Jun 2018 08:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528360258; bh=bOSHevP5ncy1vhwJfLUegQPLcIP0BM7QNGD9iCfkztM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ANdqjvYO8BZ8A+FXtRIjccp0GDRnqPSIg/UhEp8fzaL6XULqW623k84SsPveGq5L6 GPUq73pAefLWpvWZKRReJlyqJW7K7lrFi0sonQow+RgfJkSrUmfUHw+tsPIrGcBtfq LyOtN+vzzYC53Cob4OL+PZt4y4LnhJE4ma8yEIJg= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.78.68] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gkohli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 79B7B60115; Thu, 7 Jun 2018 08:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528360258; bh=bOSHevP5ncy1vhwJfLUegQPLcIP0BM7QNGD9iCfkztM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ANdqjvYO8BZ8A+FXtRIjccp0GDRnqPSIg/UhEp8fzaL6XULqW623k84SsPveGq5L6 GPUq73pAefLWpvWZKRReJlyqJW7K7lrFi0sonQow+RgfJkSrUmfUHw+tsPIrGcBtfq LyOtN+vzzYC53Cob4OL+PZt4y4LnhJE4ma8yEIJg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 79B7B60115 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=gkohli@codeaurora.org Subject: Re: [PATCH v1] kthread/smpboot: Serialize kthread parking against wakeup To: Peter Zijlstra , Oleg Nesterov Cc: 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 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> <20180606185920.GI12198@hirez.programming.kicks-ass.net> From: "Kohli, Gaurav" Message-ID: <1ebda1e3-dae3-9e86-ad92-e1acdead23be@codeaurora.org> Date: Thu, 7 Jun 2018 14:00:53 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180606185920.GI12198@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI , In the latest patch mentioned, k should be their instead of p: -WARN_ON_ONCE(!wait_task_inactive(p, TASK_PARKED)) +WARN_ON_ONCE(!wait_task_inactive(k, TASK_PARKED)) Regards Gaurav On 6/7/2018 12:29 AM, Peter Zijlstra wrote: > 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 :-) > -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.