Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3833970ybf; Tue, 3 Mar 2020 13:49:24 -0800 (PST) X-Google-Smtp-Source: ADFU+vtDrb9NvMtpwnYE2uGBhNKF5tfxVEDcGbJCTP4kijiBrODNgWkaC9qWihzhJPuIK7570OMO X-Received: by 2002:a05:6830:145:: with SMTP id j5mr4770023otp.242.1583272164617; Tue, 03 Mar 2020 13:49:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583272164; cv=none; d=google.com; s=arc-20160816; b=xJR4jyhH0S/Hwz48KFjhLJBOe5RHJ99xxqA8YFPnQYfTTCxMl9NXHAp2Ps5FgNXJJQ gtBLoj0CtyGDtI+ghNvn9vZLs9nfG4zX33zFDerOu1UMNIg3n9a9GtBrMOM+AArG8Gqa nmw+oBZNmlIQ8EkudKonDpMqV1jIizAPCSKBrK0/T2DRedn5T8vUea9EKr/fPxMWIWuj NPg55nC3U6InCU7lIvSTEFdmxkQsg0ubL1VAOiQE6Frk/QjOFmDLC/5t5CRtjTYnUEdC 7Q6tRuztP8ZphpLpHfqGZp1WWKfGgOXQ4noSGfWmKjj3HO3S8eqUUeTAKTNaEcWFdPes XTBQ== 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:mime-version :references:in-reply-to:date:to:from:subject:message-id :dkim-signature; bh=y7z418kB111geExDhcGsjtZWhY0SkXPKOs8Z534WRsk=; b=mivF/yr3zLMVtkaUwZqb6l9pepwK7epYaL1eRDl6cVEdMrNqOxAoHx+rCrMmj6Klm5 BDxyfGvyHNX/e1Fuf0JljlumzV0uIIjCLt8qO2zb016iwzQm7iNOJn+XFQPyQneE+DK0 wgEQwrDuKtVxaCdcUd0ZT76eMa4HXMcGHBW5gzWTLlDgZh+5DnkyYVfyBJrOHYzo1APe 9Z/MaUjMq+Rasaztskz0uS8QpMNt6lYDWLK6jLBbXFqwKNAyYwxYg3pN6K7bTHx+OpF1 sQ1qFQwlzanyJsI2wAJbvSsrf0KvM8PwV82XtVvj4fNAk0v6iPi7ZxXss+TXjnSFuOFu jJIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MDakxZK/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p26si8485346oto.240.2020.03.03.13.49.13; Tue, 03 Mar 2020 13:49:24 -0800 (PST) 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=@kernel.org header.s=default header.b="MDakxZK/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731885AbgCCUjk (ORCPT + 99 others); Tue, 3 Mar 2020 15:39:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:40912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729681AbgCCUjk (ORCPT ); Tue, 3 Mar 2020 15:39:40 -0500 Received: from tzanussi-mobl7 (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED00320848; Tue, 3 Mar 2020 20:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583267979; bh=knYRWXGS61DRVFa5XZOhaWuesiDvSgsYGK32jWx2rnw=; h=Subject:From:To:Date:In-Reply-To:References:From; b=MDakxZK/1Ju+j0JR74tJyG0dtLHLaZIZSCp2V4d3Okqj4ngwsw721m5fc2MCoDFXg uFVgjZeDrUSsFyZwrfrwQULeaa/zyfUQWPqKHTzjCP7vL/RMLp8tqdhMbWhFIeIA1G yxJL/FADxa6gEibS+nwsrE71fTxrI5oO0snzJoa4= Message-ID: <1583267977.12738.53.camel@kernel.org> Subject: Re: [PATCH RT 21/23] sched: migrate_enable: Busy loop until the migration request is completed From: Tom Zanussi To: Scott Wood , LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner Date: Tue, 03 Mar 2020 14:39:37 -0600 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Scott, On Tue, 2020-03-03 at 13:56 -0600, Scott Wood wrote: > On Thu, 2020-02-27 at 08:33 -0600, zanussi@kernel.org wrote: > > From: Sebastian Andrzej Siewior > > > > v4.14.170-rt75-rc2 stable review patch. > > If anyone has any objections, please let me know. > > > > ----------- > > > > > > [ Upstream commit 140d7f54a5fff02898d2ca9802b39548bf7455f1 ] > > > > If user task changes the CPU affinity mask of a running task it > > will > > dispatch migration request if the current CPU is no longer allowed. > > This > > might happen shortly before a task enters a migrate_disable() > > section. > > Upon leaving the migrate_disable() section, the task will notice > > that > > the current CPU is no longer allowed and will will dispatch its own > > migration request to move it off the current CPU. > > While invoking __schedule() the first migration request will be > > processed and the task returns on the "new" CPU with "arg.done = > > 0". Its > > own migration request will be processed shortly after and will > > result in > > memory corruption if the stack memory, designed for request, was > > used > > otherwise in the meantime. > > > > Spin until the migration request has been processed if it was > > accepted. > > > > Signed-off-by: Sebastian Andrzej Siewior > > Signed-off-by: Tom Zanussi > > --- > > kernel/sched/core.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > As I said in https://marc.info/?l=linux-rt-users&m=158258256415340&w= > 2 if > you take thhis you should take the followup 2dcd94b443c5dcbc ("sched: > migrate_enable: Use per-cpu cpu_stop_work") > Yes, I didn't forget about this, it's just that I can't apply this to 4.14-rt until 4.19-rt does, otherwise it will be seen as a regression to someone moving from 4.14-rt to 4.19-rt. I will be keeping my eye out for when that happens and will apply it to the next backport release at that point. Thanks for making sure it wasn't missed in any case. Tom > -Scott > >