Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2441042imm; Mon, 28 May 2018 08:08:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqNNifF1HnW003Puocf7ZC004p1BR88QKeiEjgkzTA4TyupCyPdKVTqkaJYSNpSkn8zxaBW X-Received: by 2002:a62:8a5b:: with SMTP id y88-v6mr13848916pfd.103.1527520120438; Mon, 28 May 2018 08:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527520120; cv=none; d=google.com; s=arc-20160816; b=BcD9hqgwG8Dj3pQDmaT5xWjoTmp/xDk0OxDtm7XjvW+8W+dUM0g4fEURakoIUoS7Vl SJwFEzHeuG2LvrcBlxvIYA27DlsqXqQOu4YKWF/PB9NpAd1OjWJTURHNnS6b6cUMTi8Y lAt+B2pWr3bZ4vrS/mHFXYblPdENYlG9ruHt0fOKXOyKE5NvGmQP7tr52LDuuYsKEIz8 QUNbwDLLyG1rF0DIPzz2Dd2cBzHKJ9Uv01vwetCCm6Bjbr3H7+XC83GtYHzcReW5OW17 9fcW7ZVAZ9zG8+v89sUVRfs5HHrYWvNK5yH0q2GEUepibjSyYOhEFzdoVgeLAXCZIMLq QHcA== 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=/cOud2Pf7eJjjhDROPveYUFuQNKbiaq9v17KBf+mPuY=; b=hHmRrIz3plMZRotsqwwp5PGN4/o7eYZXnUlSh1oQdRZGXK7zHHp9gs6hShask4uQCy MkHM14OsL8dzPlI/jBy2/yyRqlCGZRKkunl00xybUhzx5Yennj9ulUF6tBGwxVi1f7u1 O9gsHpofRufVBj5zowwi0quADt4AJnU+8NerMYrEIolpem714pQzqVaPKI+3Cp3O2Q8q r09UiVETsA+8zkTbg/aAupNnNDYaF8ajBq782HI8mJOhjSWsebq31yMryOfexNwr95Y8 +0upTUDY+w3cAER3Rw2qK4i746hwgEXSTXoYEknLK5mFz3cb4WwXtFl+L9vr6JoSje37 k87A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=nvSZmb5b; 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 z14-v6si10839003pgz.284.2018.05.28.08.08.25; Mon, 28 May 2018 08:08:40 -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=nvSZmb5b; 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 S939629AbeE1PHW (ORCPT + 99 others); Mon, 28 May 2018 11:07:22 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56816 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937156AbeE1PHF (ORCPT ); Mon, 28 May 2018 11:07:05 -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=/cOud2Pf7eJjjhDROPveYUFuQNKbiaq9v17KBf+mPuY=; b=nvSZmb5bK1KhR1SA2xpON9xtb etvwX0riLqNwHKyTCCHTEA6LmWqO8bPFqf1nZfgN5bc8WVJdwXu01vOh3RxRCtz9R4MAoGPHeIGRC lJVo7n8Z/J7liMfyfkyg+NUdnLAyevroy2WCg5H3pfiM49aJ8BVzbkDuVq/5tadECGGUvQuD2qYw7 pvBGQv6grIMSTMEhrteYycKBXUslSzNXzz5aKiJtdpadP6Gw9KPiB2ONtZYVf7ITTZ2Z8Hwz+GEgM tzMf3YBU34dpE31kMwmQc1xi37hgKzmEmNIeQ5ZSHFLcwK25cOe3WYmETBQwMiXG2O99xu9M9hDFp OxPUmrJvg==; 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 1fNJje-00068V-V5; Mon, 28 May 2018 15:06:59 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9AC9B2029F870; Mon, 28 May 2018 17:06:56 +0200 (CEST) Date: Mon, 28 May 2018 17:06:56 +0200 From: Peter Zijlstra To: Paul Burton Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar Subject: Re: [PATCH 2/2] sched: Warn if we fail to migrate a task Message-ID: <20180528150656.GF12217@hirez.programming.kicks-ass.net> References: <20180526154648.11635-1-paul.burton@mips.com> <20180526154648.11635-3-paul.burton@mips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180526154648.11635-3-paul.burton@mips.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 Sat, May 26, 2018 at 08:46:48AM -0700, Paul Burton wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 2380bc228dd0..cda3affd45b7 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -1127,7 +1127,8 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, > struct migration_arg arg = { p, dest_cpu }; > /* Need help from migration thread: drop lock and wait. */ > task_rq_unlock(rq, p, &rf); > - stop_one_cpu(cpu_of(rq), migration_cpu_stop, &arg); > + ret = stop_one_cpu(cpu_of(rq), migration_cpu_stop, &arg); > + WARN_ON(ret); > tlb_migrate_finish(p->mm); > return 0; > } else if (task_on_rq_queued(p)) { I think we can trigger this at will.. Set affinity to the CPU you're going to take offline and offline concurrently. It is possible for the offline to happen between task_rq_unlock() and stop_one_cpu(), at which point the WARM will then trigger. The point is; and maybe this should be a comment somewhere; that if this fails, there is nothing we can do about it, and it should be fixed up by migrate_tasks()/select_task_rq(). There is no point in propagating the error to userspace, since if we'd have slightly different timing and completed the stop_one_cpu() before the hot-un-plug, migrate_tasks()/select_task_rq() would've had to fix up anyway.