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 X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,T_DKIM_INVALID, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD6BAC43142 for ; Mon, 30 Jul 2018 21:07:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 521DC20870 for ; Mon, 30 Jul 2018 21:07:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NQrik2BB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 521DC20870 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731806AbeG3WoZ (ORCPT ); Mon, 30 Jul 2018 18:44:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59168 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728746AbeG3WoZ (ORCPT ); Mon, 30 Jul 2018 18:44:25 -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=sP53BLfYc73/c9QAd2hpYtrz7QXf39oYfXfpVz8T08M=; b=NQrik2BB4L7PYKZjOIGN2KCfJ glsfdGv7oqrf30LJAXT+LHoRxt/SI88t7eqpDrt0ClfZbX8NpXX6tdDuG5xIeP88vl0JOFTryPFMG 3S7IzFnDhpc5iFuDFrpNMwc7fZvkHA3iI10t/KbGOkZspm/BWUtySOB5gz+3nw8g7R1b8xKFek5TT aB3N+nPjgN8T+FlIzBlG8aKqE26ZmEm6fP93k2xMTOUK8Y6gzhJKSO3QLuUbdXOEl8/cEPBcO0eWw WltUSbiGD7EPsw1BHrI8mTxIbUi23+7ToqWJ21ygL8PYExawUQA7y6+pQC8zcrM1WtkWlc05UpMV+ mIQndtZcg==; 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 1fkFO6-0004Gk-IV; Mon, 30 Jul 2018 21:07:30 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2683420298BC1; Mon, 30 Jul 2018 23:07:28 +0200 (CEST) Date: Mon, 30 Jul 2018 23:07:28 +0200 From: Peter Zijlstra To: Sodagudi Prasad Cc: Thomas Gleixner , Sebastian Andrzej Siewior , isaacm@codeaurora.org, matt@codeblueprint.co.uk, mingo@kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, pkondeti@codeaurora.org, stable@vger.kernel.org Subject: Re: [PATCH] stop_machine: Disable preemption after queueing stopper threads Message-ID: <20180730210728.GQ2494@hirez.programming.kicks-ass.net> References: <1531856129-9871-1-git-send-email-isaacm@codeaurora.org> <20180724062350.nlem2suuy5wlxpts@linutronix.de> <20180730112140.GH2494@hirez.programming.kicks-ass.net> <109d0e70606ccd34861a80525d6d11aa@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <109d0e70606ccd34861a80525d6d11aa@codeaurora.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 30, 2018 at 10:12:43AM -0700, Sodagudi Prasad wrote: > How about including below change as well? Currently, there is no way to > identify thread migrations completed or not. When we observe this issue, > the symptom was work queue lock up. It is better to have some timeout here > and induce the bug_on. You'd trigger the soft-lockup or hung-task detector I think. And if not, we ought to look at making it trigger at least one of those. > There is no way to identify the migration threads stuck or not. Should be pretty obvious from the splat generated by the above, no? > --- a/kernel/stop_machine.c > +++ b/kernel/stop_machine.c > @@ -290,6 +290,7 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, > cpu_stop_fn_t fn, void * > struct cpu_stop_done done; > struct cpu_stop_work work1, work2; > struct multi_stop_data msdata; > + int ret; > > msdata = (struct multi_stop_data){ > .fn = fn, > @@ -312,7 +313,10 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, > cpu_stop_fn_t fn, void * > if (cpu_stop_queue_two_works(cpu1, &work1, cpu2, &work2)) > return -ENOENT; > > - wait_for_completion(&done.completion); > + ret = wait_for_completion_timeout(&done.completion, > msecs_to_jiffies(1000)); > + if (!ret) > + BUG_ON(1); > + That's a random timeout, which if you spuriously trigger it, will take down your machine. That seems like a cure worse than the disease.