Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3275766imm; Mon, 6 Aug 2018 01:38:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpceouiMCUlTYsolMrn8RYoNN1jy2Ja44RqHTWxY4sQFg1gCMgDcK/VtzMrJPESYjJSNw3IS X-Received: by 2002:a17:902:8482:: with SMTP id c2-v6mr13119748plo.45.1533544730264; Mon, 06 Aug 2018 01:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533544730; cv=none; d=google.com; s=arc-20160816; b=u0bUXUBsUILr6le+e8riN4w+wKXX8K7t7Kv9Zqm29fAB1dS/RjAYPhc9ClTos3zmt6 4e/kHbk3pFnIS7uAFMSEefTZYGLZbI4wP92ZxSkQebIcQ2vmTjpf5odrwgp1kBBd3dvc iK+dfFrl57LBGTUkWDDgFasaBw6MFIl9I3InTq2LEILSQK9IMgJPIuWXg+PqTVsc/w+H RBWA1rBULh4qPXBhWN4ni7ZXaptl3A2xdsIR17gB+Gm33oMoobolhuUKQ6bTdJ0jwctr lAluT5JTYJ5Q7H+VtrtYnnwrRUePdvrhj6bEkRxiC18/zYBxgSoj3qA+ehmEzI+bYHf1 1YCQ== 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:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=a42urLbzXvL7smS147Dc2SDYLJZdq7JeMT4dIgoPb+M=; b=mKagDf1UdfRDF0lXoTJZ/ZJyJNSevrvvsvYU2ODp0ivUwW0hi9Z1HeB0cwpLouWUKB J0DjPFhYHakF9Y4hAd/nfu2Ru8/br0BD+WzH6BF67N4EIM3Jx8l9gBgIqH5ARtMCCYED 5N6OPNemzdqmwsXLNhkw5QdpF5baLLDQ24fpYAfoVnLN/IwFhdTm8LCTlTQn+iogIm1P NRajIFYd27w8mYfH4AcQS6HfNtp5hhID6wbmFSRmyT54ucr0D5z96UGRpd2c06jpVnd8 zhAU5Tcxc+OyLvAXbItnBgDFAbHVmGOv2CzfDQFaKFJwjrltjnEaJkcvAM5ks4yFR+Mx XB0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QBQYVdXp; dkim=pass header.i=@codeaurora.org header.s=default header.b=IoJ7TFfG; 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 u11-v6si12511778pgg.683.2018.08.06.01.38.35; Mon, 06 Aug 2018 01:38:50 -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=QBQYVdXp; dkim=pass header.i=@codeaurora.org header.s=default header.b=IoJ7TFfG; 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 S1727363AbeHFKpn (ORCPT + 99 others); Mon, 6 Aug 2018 06:45:43 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46148 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbeHFKpm (ORCPT ); Mon, 6 Aug 2018 06:45:42 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5F95A604BE; Mon, 6 Aug 2018 08:37:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533544663; bh=0qKgZSUE2DjPo7VCqS67fpJL0G/P0pih+tcFb0Xkh9U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QBQYVdXpLSjE80pxI6pWhYRxqUVag/SGnXV98o6yRzXgAlqt2aCZkR7/MxyK4zZH7 BqCC6NnMYVna+nvBaytORc/FN/Pjqq4E05+121ClED29TLgrc8vvSwKpKMzeK1Ih+t sSFeqY90BXj058ZxHJCijN5NaXU1SwFHLHfihiZc= 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 codeaurora.org (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: pkondeti@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E7BF5604BE; Mon, 6 Aug 2018 08:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533544662; bh=0qKgZSUE2DjPo7VCqS67fpJL0G/P0pih+tcFb0Xkh9U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IoJ7TFfGOp/bzYffsAPSk4qZe5SD+JzCQfLuM7LXTlBDN6rMEEZEAVWUDcbxZjHbf 5hcbT+6gLoMXBkwZRrBzZhkmqrYTCR5k13FihIZ5W5iGHztamwR47wsCmGgsUHHmr8 q3vsbK+KuWqLlbMrdAQVuIwL1zYqjRHbmfY8x238= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E7BF5604BE 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=pkondeti@codeaurora.org Date: Mon, 6 Aug 2018 14:07:36 +0530 From: Pavan Kondeti To: Sodagudi Prasad Cc: Peter Zijlstra , Thomas Gleixner , Sebastian Andrzej Siewior , isaacm@codeaurora.org, matt@codeblueprint.co.uk, mingo@kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: Re: [PATCH] stop_machine: Disable preemption after queueing stopper threads Message-ID: <20180806083736.GA2661@codeaurora.org> References: <1531856129-9871-1-git-send-email-isaacm@codeaurora.org> <20180724062350.nlem2suuy5wlxpts@linutronix.de> <20180730112140.GH2494@hirez.programming.kicks-ass.net> <109d0e70606ccd34861a80525d6d11aa@codeaurora.org> <20180730210728.GQ2494@hirez.programming.kicks-ass.net> <52a34ed365cd560457e9abf5877c5b37@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52a34ed365cd560457e9abf5877c5b37@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prasad, On Wed, Aug 01, 2018 at 01:07:03AM -0700, Sodagudi Prasad wrote: > On 2018-07-30 14:07, Peter Zijlstra wrote: > >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? > Hi Peter and Thomas, > > Thanks for your support. > I have another question on this flow and retry mechanism used in > this cpu_stop_queue_two_works() function using the global variable > stop_cpus_in_progress. > > This variable is getting used in various paths, such as task > migration, set task affinity, and CPU hotplug. > > For example cpu hotplug path, stop_cpus_in_progress variable getting > set with true with out checking. > takedown_cpu() > --stop_machine_cpuslocked() > ---stop_cpus() > ---__stop_cpus() > ----queue_stop_cpus_work() > setting stop_cpus_in_progress to true directly. > > But in the task migration path only, the stop_cpus_in_progress > variable is used for retry. > > I am thinking that stop_cpus_in_progress variable lead race > conditions, where CPU hotplug and task migration happening > simultaneously. Please correct me If my understanding wrong. > The stop_cpus_in_progress variable is to guard against out of order queuing. The stopper locks does not protect this when cpu_stop_queue_two_works() and stop_cpus() are executing in parallel. stop_one_cpu_{nowait} functions are called to handle affinity change and load balance. Since we are queuing the work only on 1 CPU, stop_cpus_in_progress variable protection is not needed. Thanks, Pavan -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.