Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3831958ybf; Tue, 3 Mar 2020 13:46:26 -0800 (PST) X-Google-Smtp-Source: ADFU+vu9uzRdNlFBynoIUmAR45/lkOeCtL59iN9FfFVf9y05zJG6ckiBR6f3jnT9/0mzTSGGmbXL X-Received: by 2002:aca:f12:: with SMTP id 18mr441967oip.126.1583271986699; Tue, 03 Mar 2020 13:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583271986; cv=none; d=google.com; s=arc-20160816; b=L0ee8gSd4RriVpJX25qN3crkimwQePBADrL0YLYh38ppCmVhDkH6U0oje5nZE7kANa LgavO5bLkXR4Nk5MvCSXwkDrhuYhL5tttxk7ACSrx8KnTZXIkojjklctP3tFGgrSCPC/ vBgfCqZNHYpS6B7AtXs7kiyqzXWaK739eDza7mjwtGfdJZFsVMFzSGWWfWkKMhI06Fgy mr6VhWPh45TB/pyKYFnJS9xQIZcBOx55Zl1EVJxRD2r/bA8tNjBa3jLA6AUZrWv1jT7w YVIDgqK3d9irHEDkbbIaFdx4BwShfeLK2sEOxqHbvj13UXyT24AghC6aXlEgtRh3iQZU 6oeQ== 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 :user-agent:organization:references:in-reply-to:date:to:from:subject :message-id:dkim-signature; bh=1qj8ZdJngAl1BYhYQ8Pb9xB95Ex95TcCgPbQcv0M/tM=; b=EahYmjXta66E1nyKlM5BjN7Zk6gbY5nMm6BHZETOBmfaSMyoS0ibtvRwxIAXI4MXf+ S0a/YqA+VlHQxt1+UD4ELrvdOLzPu/QByvUmEdFBU4wkl0eIgdI5hZN8AUKAF3BiJMVj nffb6LzizfINToniu0N74QJGScVM7p0aYLebvJQIJ5HqJYrcjGa1D6c2JS0ctiFQn1lw 9C91vH7onOLOxQGqBbVBiyKXkj3gUs0XHSvyIQrXzR56tvixrFO9voAqhNn9JP4tgTL7 1O87PBWVEsvzvJzkeEbgJOpXxM338LESuwA0hBph6Lu7Rr6suDcLfw3ajMtg/r2VRZma q5pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="UxyfZJ/j"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si3445125otn.229.2020.03.03.13.46.15; Tue, 03 Mar 2020 13:46:26 -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=@redhat.com header.s=mimecast20190719 header.b="UxyfZJ/j"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731471AbgCCT4V (ORCPT + 99 others); Tue, 3 Mar 2020 14:56:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52165 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728731AbgCCT4V (ORCPT ); Tue, 3 Mar 2020 14:56:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583265380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1qj8ZdJngAl1BYhYQ8Pb9xB95Ex95TcCgPbQcv0M/tM=; b=UxyfZJ/jkSbSLiW+AJefYRpGIBKxl6DZjGd+OuCynr6V1FqsBbaLwUtctSaS+l/VjycJne ACISo83ghohUdDAaNifHvvxS2h72iSrVAZ7ppJ1q8LCiVtveVKzonh6cjUqYmFQC1YsPRS Pn3gupG215TFOC3oexLS7/pi2pPMxu8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-2UFrHnTtP1mOYL1rblVYZQ-1; Tue, 03 Mar 2020 14:56:16 -0500 X-MC-Unique: 2UFrHnTtP1mOYL1rblVYZQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CEEE4DBA5; Tue, 3 Mar 2020 19:56:13 +0000 (UTC) Received: from ovpn-118-56.phx2.redhat.com (ovpn-118-56.phx2.redhat.com [10.3.118.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04D7510016EB; Tue, 3 Mar 2020 19:56:11 +0000 (UTC) Message-ID: Subject: Re: [PATCH RT 21/23] sched: migrate_enable: Busy loop until the migration request is completed From: Scott Wood To: zanussi@kernel.org, LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner Date: Tue, 03 Mar 2020 13:56:11 -0600 In-Reply-To: References: Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") -Scott