Received: by 10.223.164.202 with SMTP id h10csp5223607wrb; Tue, 21 Nov 2017 06:35:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMZV+HRY2IYcBrSCIHnpcjbjBJVPhxN3DvtasXFnS+dgFLM6OXuk6z/jksacpWFV4Oi2n+vc X-Received: by 10.101.98.9 with SMTP id d9mr17422382pgv.8.1511274958469; Tue, 21 Nov 2017 06:35:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511274958; cv=none; d=google.com; s=arc-20160816; b=0iCe/S5dt39/AzPNCnv67CQ9CupbBlf3VGKzhnzP4j5EGUOs6s+NXLK8NEPWTTDSEO fzCeBziJtByrPNYWa86DRWbLVvlsrSofMETKMQmlPtmryCzWS7h4g692v3pjJ64OtHSD cMn8ec9F8cAsq2uWvw2gIIvRIaGFQI24JLxGtW/SAEq262B8BTz01bjv6+BpfdNYRbzZ eKzck+/zgdMkZHa60/kj+rZQ56hjqytxG5u0ci6IOoFr+IDs4dvmSqrioUP7KOu3gpys TmAtbLM1UGL6MoTJWYcUFcOUPC8rJv62Xb0/QIOmkkHmnZ1R1dqKmXzXviELSXLnEKeO QIsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=JhclGRW4dSSWnqMoTWcZqCnhJ3Uy1XkSZ470AwQENCk=; b=N1mMlzMq/USffIiBdw+4DG3H2k0o/WhjHZIHJsqEiavgDQQd8jmO/1btDVIwarbf6N 1oLsimcF9yiIw9pOb39pSqSC8AXazgVRpu5+K8JgOOFvuMJecEx5mnKXS+QtiL34rRoM Ziqpl4cU8CG6gA5VPipyQ6TwnQ58lWeePW0O2vvnJev5X03VvVCU+TzO3JvP+u+AgPVI vGW/aV7q77Kzjx01+JRoaej6U+NYsUo3M6phzhvY/Dj9MjIrdq3ZIP+RCQdl36SPgAZ3 8k8I7yvkfMZGFD9W47q4BBW6yJ6Q6xEDklGhZvJqu9c06S7nZ2g8Rpsl6npiyxWE/Gby t+ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@concurrentrt.onmicrosoft.com header.s=selector1-concurrentrt-com02e header.b=X13SOqUI; 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 s64si11989217pfj.279.2017.11.21.06.35.47; Tue, 21 Nov 2017 06:35:58 -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=@concurrentrt.onmicrosoft.com header.s=selector1-concurrentrt-com02e header.b=X13SOqUI; 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 S1751768AbdKUOeC (ORCPT + 76 others); Tue, 21 Nov 2017 09:34:02 -0500 Received: from mail-sn1nam02on0108.outbound.protection.outlook.com ([104.47.36.108]:9143 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751711AbdKUOd7 (ORCPT ); Tue, 21 Nov 2017 09:33:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=concurrentrt.onmicrosoft.com; s=selector1-concurrentrt-com02e; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JhclGRW4dSSWnqMoTWcZqCnhJ3Uy1XkSZ470AwQENCk=; b=X13SOqUIctEu/gQKk1gqhoWQucpd41uPHxTzPPzI2gfL7MC7H/Kv8dUMLo7YLu8U7mr0ESD9w4po3c27B4LG2aZsTDgV2z2oMcoMR4+5q3qOfl/RBHa/0xR9BBBhdFH0vnO1cFZmTv9F4G6aTs14UNgHb8ZO2SzxxrHnlh2UhSY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Joe.Korty@concurrent-rt.com; Received: from zipoli.concurrent-rt.com (12.220.59.2) by CY4PR11MB1479.namprd11.prod.outlook.com (10.172.69.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.239.5; Tue, 21 Nov 2017 14:33:57 +0000 Date: Tue, 21 Nov 2017 09:33:52 -0500 From: joe.korty@concurrent-rt.com To: Steven Rostedt Cc: Thomas Gleixner , Peter Zijlstra , Linux Kernel Mailing List Subject: Re: [PATCH] 4.4.86-rt99: fix sync breakage between nr_cpus_allowed and cpus_allowed Message-ID: <20171121143352.GA25941@zipoli.concurrent-rt.com> Reply-To: "Joe Korty" References: <20171115192529.GA14158@zipoli.concurrent-rt.com> <20171117174851.2a253785@gandalf.local.home> <20171120163040.GA25993@zipoli.concurrent-rt.com> <20171120230207.19a4bc14@vmware.local.home> <20171120235751.0424cf23@vmware.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171120235751.0424cf23@vmware.local.home> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [12.220.59.2] X-ClientProxiedBy: CY4PR02CA0043.namprd02.prod.outlook.com (10.175.57.157) To CY4PR11MB1479.namprd11.prod.outlook.com (10.172.69.150) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06cb2683-977e-46e3-ed2f-08d530ece64a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:CY4PR11MB1479; X-Microsoft-Exchange-Diagnostics: 1;CY4PR11MB1479;3:R5c1cWZsgR2mmPXSV3DFY0HDkWaEb0SrUMOdnrNazRgkGMvFPNpMI513tONmw18toNVDcuDySgbCQNRU3tet5ZmoNFwA6f0FFw3gPQ1Xy10vLe/Q7vkUA2kBB7lELwMdN9sky7UTtdtbbz77e0TCFSv0Jc+wNUWO0wf0J3ivhzqw+Bni9QO3S3IY9Vm/QR2Vmp9+RLbW2XQbRuyvG5P3KqxtXidlDygPnVvoTB69mxRb3lNVw7yrn1fMSK6xvXLj;25:KD8mHxlxdwSccVW/jP7l1oaG1G2KB54UTzcED6GFIwimrNeietj2w2wY68Q2STY5Gh3HB+bc5zz51jKlRusmcgRO/i6zMwgd5QJQ4D5QKxZ/l8z9JYxUTlIcQaPj0M7TI33Fr0qn559dcYUV/0kV2onzSq5pgRMK2iSRCFyY7wb/HwcyDLEpVR4TjXkk3tjtH/gKK5Mnr+PySwINBnWnJEppApeffct4CrfSHgAYNez+80EoRvqNuetHsKcAH8QTlF7Y1+ac/GZNGspiO5pAf2M6aJE2q4K3FDGsgWenhjIoGH13sjk24yuhY/0KXD4CzBX+o2l2dsIBCScm0mQpWA==;31:VuLIbLDJsfHnAUvdkNq31Bhsk6kIGTvkV9QvKU86Vdp0GpmUSj6lk3Q3cC0NzofFU6tDAqbx37hqDBYF2xgKmUE/SqzMlfXdj2faJtWYBnWeeXRe7eihJhUmCq0nur98+rhoWggSmlJSe+KXYmZj15a7pp1GebAuryn5Eg4Ur2IRkYMX37nhVE1bqqUdPZzrf/ubozfAwffDxuFnswk5edGEhYan56APlJTGt42pC5U= X-MS-TrafficTypeDiagnostic: CY4PR11MB1479: X-Microsoft-Exchange-Diagnostics: 1;CY4PR11MB1479;20:8FPgS6UKiNLBfTp0a87jVdN/VfAKDyTJOOC0XJ6faaMt9dxRrqxHk8UslzOrtEK78gqkcLsufEREpQHX8uaDQXIzkxACGn9Fwf19ZoL2oxMtkACWVU82BOvXmLjgQs2GsgqLnX921hpiTYfBvL3FIJes4cpWJJ8gna0UD12+oDI=;4:QArYLGwtFzubKDNmlGTU9brGZWkTBvvZREyLHLub+MAMkdtDRIIAzr/7luYlQ36i3A6+kwDRsMa8WATkFYNkIKZa0b2XPdTioqWkjqGduLZPeIjyqtXRJM6bav/hEpDAmvp7qGgkSqdy/lqVtVD53LJ8WwvWtC3SL2YarhDU7snQs+NqLSCXNRgyoeJtORN+Ptsz0PGLueifhg/U3+5Fhd02RLZWrLwaMXIXeBX4ao647uC9nOUP6N6yW6Cr5T2a913Ze7/DrMBzvLRL5gE6zmen0IJJdlAAokNC8le0kakChgfCg/kmZnUGCz++ecW9B4EJOTCCz7oCqt8RC2yTXopbu3yhVOlEd4PXSEd/E2I= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851)(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(3231022)(6041248)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR11MB1479;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR11MB1479; X-Forefront-PRVS: 049897979A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(39830400002)(376002)(346002)(189002)(5423002)(24454002)(199003)(377424004)(53416004)(16586007)(58126008)(316002)(69596002)(53546010)(105586002)(5660300001)(8936002)(16526018)(54906003)(83506002)(97736004)(4326008)(43066004)(4001150100001)(33656002)(81166006)(81156014)(478600001)(85782001)(9686003)(6116002)(50986999)(76176999)(86362001)(54356999)(2906002)(47776003)(6246003)(2950100002)(50466002)(101416001)(68736007)(72206003)(6916009)(305945005)(8676002)(106356001)(7736002)(3846002)(66066001)(93886005)(229853002)(6666003)(189998001)(23726003)(55016002)(575784001)(53936002)(25786009)(1076002)(18370500001)(85772001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR11MB1479;H:zipoli.concurrent-rt.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: concurrent-rt.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR11MB1479;23:eYmzDjZuu1iM78d6QUIKXCzRK2/EpuCTHfL+t01On?= =?us-ascii?Q?pFyZP1C3bf3mnJ0iq3BbVCjYGzi24cF2c3NvBceuR77s2CFMfU1QrVp0vpKW?= =?us-ascii?Q?A+WXVffro7v/IHcTybRsM+riu2hMWDET6ADHRdUVvwgwD2EWLTtYenlwUkOr?= =?us-ascii?Q?KGIEhZ6vH2/hlE5SLCv3k4xoSw37AeUDFnf1Z3Dayz47miGGNow3gMQ+r0Kl?= =?us-ascii?Q?WlL4aoyR4zRNz5IgaHI/ouYacd2dakQTkY6eaeC3ZLdfCCdEFBVN9+tjJsdn?= =?us-ascii?Q?CdciKGUO0XOmG30u+wkg00AN8d7KlREeY7eeDh3lwSBFp1kShbkQu8VPSJXs?= =?us-ascii?Q?Ji3oE9HK6DFxl55o3dh0Qs/Ww65ng/aOu4/97ngaBGN3EomWLcE2A7XglAmN?= =?us-ascii?Q?3+Wnn+q/COTf5FQcGAlo5AmfMqn/RIh/7zcc/jeQpdww8UJhBK/1BeUlychC?= =?us-ascii?Q?7gWHq0uk0ynzJvQvVUt58cPLlA97Wzdvk9xZhdVjVSrHRbncqnIxIvxyFefV?= =?us-ascii?Q?vf8sZVce7jC5XlWOfS5SechPAxtQYGwV1WJk1J1TkOfNOAM3bBTRF0Ah4km5?= =?us-ascii?Q?nlAcpXdW2depC/YnkE2rUbmkqFzJLmAfyXaepFOTY6KHiQHEBgYMyLHn2nSw?= =?us-ascii?Q?YMdoYFoh+Jr+34qC9/F/kAurEi9rIhWjeTcOPLrxF4QA73wCC3BPlG1yhIv4?= =?us-ascii?Q?67QAbjxT7T70vXAztksgwMlyYdFjazADLtQ8bMUEda2v7Fp/Sb6MLQS+idqM?= =?us-ascii?Q?cCuadRlIB8EImq1TjU8eGPCKmsSJwU99mnrvrWCruYjg0UTgq+Je8n7p+9l7?= =?us-ascii?Q?SFdx+MeI81yOYIlulOBygjyIIMPFas/WVcWhdBQswOsGWRi4bJFl05meMKAM?= =?us-ascii?Q?kckQTvDA2QNu1mAD4T7a4TVJ9VSG77O3G/B4OFj31AB0aADWETLgvChdPR2h?= =?us-ascii?Q?UOAM8pKeTEoOdfHzwhrPNeqwKKDDbTz2BgerDK53FA6hEiX/6szGd6P7MQd/?= =?us-ascii?Q?h20biNbUXIwWXKVCcyL6iGc0AZRFzOQoF0l0Be1XoEvL3BxQUNH6qCPMqQJ0?= =?us-ascii?Q?MDp7hN+EF2NsU+vyQmalNWz3/t4BqeyS5F8deqMOZiZsrEpQYYZVXC69hKbg?= =?us-ascii?Q?zOoPuI1ogINgf/E8dkCa7lkJTvBVm/n9IkUAjzaymrs2+N5LHVmffURxJPde?= =?us-ascii?Q?99ZoYYmdd4683yWvtcrv8967nhDa/fHr74QKf4D+a9xk9udMITXZTTps9Nrs?= =?us-ascii?Q?rCYtus1q+BBr3cHjF1fxIgb6tv4rioOW0FwoITCL/l6FUP4qs5IcAnw8eCOu?= =?us-ascii?Q?4dHYP7zV0u5L7DIiHIKPZ7iOfe9nP1sHVXnrDi2pkZLXkg57waSuBL8LJtNN?= =?us-ascii?Q?oLTVcb80SZWFVDQ97LZOZ+FKGMnNSqNdhfehFfc0DqLDKtJMuZTjM005FSef?= =?us-ascii?Q?H+N6siEa0SX5q/DnJKo6ediq0/xKN9NWoEiI6cAKgTUM6uf6qKc?= X-Microsoft-Exchange-Diagnostics: 1;CY4PR11MB1479;6:BNulgvTbIpPcMt1ZzY2Nmf2HiEVWHbUkn6O/KZXXpKMUaYnQUfDAFLL6H+81UjTmLNRC3+j50ZUy4ELjgVIu9ZXyTffPALdhc55kLDIM2OdXzwMf6QDPnyqPUdQD0XlqK0VqF8RPpz5U02Ps1YpqDDqhQ34yWRnNKsUFWjXmuOMB2BpaMYZF/cd2xe4tEakx8TI+oVCfAdWfhDKLFW9WWdgAEqgrni1BF3OUoOycrkZukHNbXiMHRiRCNMOiKRbwGiFn5QjZ67HxB8SbihfHCjJT03XNOd8tzLHOJ6HkrjQlScA2fgPQC8r50cUmYISFCDMxWK20Xl0Dtn4ulBoQwC6ygp7YedaXAaUYjhBt6WQ=;5:GvEjMfcaQeINspXxnXuYY/0xdeBN+Q+Y7m/MSiWf8N3Ptk155AyIKNDDOyK8PKsKmhzIVwdzuWHH2dOBPPlAqqHNGnAOD/h8owZ1d2N3/V8dkAMp2mp7haL1FQim9MbHgat/f2+CLda/+y7nfWuFJ38oKADVzdLPAavkff4UOOk=;24:9dAsUqBhIh64nO/QJjEvmVi3r6IrDEDehfZ0A+9uiBLg2GveAX26l4saJ3M4H1Ox0uWPwXNn5kEJLEGimt/oO2NA9XUiC4MhMg11iIxElaM=;7:+tLY+8ADKm1ZAYtZUMNXHcuGwQZibxxNv3Llro2maHaQjATVvUm03e9YjEsAbc8S0J8/MTBaooRfjCuSXb1YtbBHSVpi1IFqy63Wj5M46E5PwfktEBxoEffm9Vznnj1jXGAA8xcbl5SjrBz/nQGQ4X9i/JZuP5z/e1vXj75IqC99K/0X56K3dd1JvWSHE+5q4c/vxtl6ty24rDul7NGpfsPAEpjndosLpBOrinwTpUnp3ED0LGPwzDwMU9+mXbcf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: concurrent-rt.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2017 14:33:57.2915 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06cb2683-977e-46e3-ed2f-08d530ece64a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38747689-e6b0-4933-86c0-1116ee3ef93e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1479 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 11:57:51PM -0500, Steven Rostedt wrote: > On Mon, 20 Nov 2017 23:02:07 -0500 > Steven Rostedt wrote: > > > > Ideally, I would like to stay close to what upstream -rt does. Would > > you be able to backport the 4.11-rt patch? > > > > I'm currently working on releasing 4.9-rt and 4.4-rt with the latest > > backports. I could easily add this one too. > > Speaking of which. I just backported this patch to 4.4-rt. Is this what > you are talking about? Yes it is. Thanks for finding that! Joe > >From 1dc89be37874bfc7bb4a0ea7c45492d7db39f62b Mon Sep 17 00:00:00 2001 > From: Sebastian Andrzej Siewior > Date: Mon, 19 Jun 2017 09:55:47 +0200 > Subject: [PATCH] sched/migrate disable: handle updated task-mask mg-dis > section > > If task's cpumask changes while in the task is in a migrate_disable() > section then we don't react on it after a migrate_enable(). It matters > however if current CPU is no longer part of the cpumask. We also miss > the ->set_cpus_allowed() callback. > This patch fixes it by setting task->migrate_disable_update once we this > "delayed" hook. > This bug was introduced while fixing unrelated issue in > migrate_disable() in v4.4-rt3 (update_migrate_disable() got removed > during that). > > Cc: stable-rt@vger.kernel.org > Signed-off-by: Sebastian Andrzej Siewior > Signed-off-by: Steven Rostedt (VMware) > --- > include/linux/sched.h | 1 > kernel/sched/core.c | 59 ++++++++++++++++++++++++++++++++++++++++++++------ > 2 files changed, 54 insertions(+), 6 deletions(-) > > Index: stable-rt.git/include/linux/sched.h > =================================================================== > --- stable-rt.git.orig/include/linux/sched.h 2017-11-20 23:43:24.214077537 -0500 > +++ stable-rt.git/include/linux/sched.h 2017-11-20 23:43:24.154079278 -0500 > @@ -1438,6 +1438,7 @@ struct task_struct { > unsigned int policy; > #ifdef CONFIG_PREEMPT_RT_FULL > int migrate_disable; > + int migrate_disable_update; > # ifdef CONFIG_SCHED_DEBUG > int migrate_disable_atomic; > # endif > Index: stable-rt.git/kernel/sched/core.c > =================================================================== > --- stable-rt.git.orig/kernel/sched/core.c 2017-11-20 23:43:24.214077537 -0500 > +++ stable-rt.git/kernel/sched/core.c 2017-11-20 23:56:05.071687323 -0500 > @@ -1212,18 +1212,14 @@ void set_cpus_allowed_common(struct task > p->nr_cpus_allowed = cpumask_weight(new_mask); > } > > -void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) > +static void __do_set_cpus_allowed_tail(struct task_struct *p, > + const struct cpumask *new_mask) > { > struct rq *rq = task_rq(p); > bool queued, running; > > lockdep_assert_held(&p->pi_lock); > > - if (__migrate_disabled(p)) { > - cpumask_copy(&p->cpus_allowed, new_mask); > - return; > - } > - > queued = task_on_rq_queued(p); > running = task_current(rq, p); > > @@ -1246,6 +1242,20 @@ void do_set_cpus_allowed(struct task_str > enqueue_task(rq, p, ENQUEUE_RESTORE); > } > > +void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) > +{ > + if (__migrate_disabled(p)) { > + lockdep_assert_held(&p->pi_lock); > + > + cpumask_copy(&p->cpus_allowed, new_mask); > +#if defined(CONFIG_PREEMPT_RT_FULL) && defined(CONFIG_SMP) > + p->migrate_disable_update = 1; > +#endif > + return; > + } > + __do_set_cpus_allowed_tail(p, new_mask); > +} > + > static DEFINE_PER_CPU(struct cpumask, sched_cpumasks); > static DEFINE_MUTEX(sched_down_mutex); > static cpumask_t sched_down_cpumask; > @@ -3231,6 +3241,43 @@ void migrate_enable(void) > */ > p->migrate_disable = 0; > > + if (p->migrate_disable_update) { > + unsigned long flags; > + struct rq *rq; > + > + rq = task_rq_lock(p, &flags); > + update_rq_clock(rq); > + > + __do_set_cpus_allowed_tail(p, &p->cpus_allowed); > + task_rq_unlock(rq, p, &flags); > + > + p->migrate_disable_update = 0; > + > + WARN_ON(smp_processor_id() != task_cpu(p)); > + if (!cpumask_test_cpu(task_cpu(p), &p->cpus_allowed)) { > + const struct cpumask *cpu_valid_mask = cpu_active_mask; > + struct migration_arg arg; > + unsigned int dest_cpu; > + > + if (p->flags & PF_KTHREAD) { > + /* > + * Kernel threads are allowed on online && !active CPUs > + */ > + cpu_valid_mask = cpu_online_mask; > + } > + dest_cpu = cpumask_any_and(cpu_valid_mask, &p->cpus_allowed); > + arg.task = p; > + arg.dest_cpu = dest_cpu; > + > + unpin_current_cpu(); > + preempt_lazy_enable(); > + preempt_enable(); > + stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); > + tlb_migrate_finish(p->mm); > + return; > + } > + } > + > unpin_current_cpu(); > preempt_enable(); > preempt_lazy_enable(); From 1584650335001272563@xxx Tue Nov 21 04:58:44 +0000 2017 X-GM-THRID: 1584176322889836856 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread