Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6951495ybf; Fri, 6 Mar 2020 07:35:33 -0800 (PST) X-Google-Smtp-Source: ADFU+vtpVJFMWYmx1q8LK6iuolKdViOExY99YxgsTzxLtjrvJYfTT8AqpsObADB5MECIPkjR2ClN X-Received: by 2002:a9d:7e94:: with SMTP id m20mr2858002otp.351.1583508933266; Fri, 06 Mar 2020 07:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583508933; cv=none; d=google.com; s=arc-20160816; b=agqwVw4FrNwlcoHrCGZh8NdvEVcVex471k9zI3PldD7rduq/PM8c3SBwGC5/YlsG+B FuY6W2ycYMWfXvo2QUV8VbYkOVY2xHOM40+PtMppyTfdADop8ytoBJ0+lJ+oZSU/6rey 4tFZRNfhJM/4HQq6PR5Cv3FDR9TlkjETTFSgROzI3YSUipnPIRI3EeMObRvx4kSmEFDf Q8EfyR7rQtseEyoZ0KHbrgWWyedT9xsMM/okINTr93bjO2A5edkaPY9IriD13lRfMSh9 /f+ezpClpXxgAIDm0GxuT3qPQe4nIdJ3MkDiQshjVZf2f2+f8o45RJFCCrGtcyhd5uDG 7dMA== 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; bh=UQaunDGWbrCMtwptoy4d0T2uvIi1Nlbee+yDQEGhp1E=; b=XcjaW8rWigDX3PJgB0hFte8XnlLDRqIGSEN3d1qDAjMX7Xdm59USi/vnK1PQFflEJ7 qPwGd6vkGUnrr5YOjTT+Bf2HYqsUlARGe0BahHoGrL5JaMizSdd0In1ixuiEjUyxcVdO Zq/J/BRZocBnHTwyttl3yKnV65eEbMKqituCw/5mn016/issIYpxM9h4ZxudQt6YOjmY QFQ1bT3fHmPj0993sS8FXWk0pJpBPL7b+3ngaigJwIxIrG/+Q753Uojnp2gAcj67f15E CMDP6z5196pwU/0eJtEoYruIR+a+NANhxTgk1L2JaTE8mk4Qv1N3+UURTc/CQ08QkfgC 4Cjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IigMY9bF; 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 v3si1728116otn.140.2020.03.06.07.35.21; Fri, 06 Mar 2020 07:35:33 -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=IigMY9bF; 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 S1727000AbgCFPeu (ORCPT + 99 others); Fri, 6 Mar 2020 10:34:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:47714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726973AbgCFPeu (ORCPT ); Fri, 6 Mar 2020 10:34:50 -0500 Received: from localhost (lfbn-ncy-1-985-231.w90-101.abo.wanadoo.fr [90.101.63.231]) (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 5C8EA2073B; Fri, 6 Mar 2020 15:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583508889; bh=d4u5+JerVMcA5/COi4zSliWCaFEKrXgk9+SBMnBLOzU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IigMY9bFHGZeibgxLgeU2OPAMia5rClAiOn3x5x6boyTanCM82uTx2yrE3obO+nbQ rfjA6187zluExniJ9VUis53RpRrF0D4JO4vg9j/WzEz8oGFhSOg+Iy8mQLQ5gW18Pi keEH+ReP/mShGvtx7I0R7UVgxzbmtAkEbMCJx/SI= Date: Fri, 6 Mar 2020 16:34:47 +0100 From: Frederic Weisbecker To: Alex Belits Cc: "rostedt@goodmis.org" , "mingo@kernel.org" , "peterz@infradead.org" , "linux-kernel@vger.kernel.org" , Prasun Kapoor , "tglx@linutronix.de" , "linux-api@vger.kernel.org" , "linux-mm@vger.kernel.org" , "linux-arch@vger.kernel.org" Subject: Re: [PATCH 11/12] task_isolation: kick_all_cpus_sync: don't kick isolated cpus Message-ID: <20200306153446.GC8590@lenoir> References: <4473787e1b6bc3cc226067e8d122092a678b63de.camel@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 04, 2020 at 04:15:24PM +0000, Alex Belits wrote: > From: Yuri Norov > > Make sure that kick_all_cpus_sync() does not call CPUs that are running > isolated tasks. > > Signed-off-by: Alex Belits > --- > kernel/smp.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/kernel/smp.c b/kernel/smp.c > index 3a8bcbdd4ce6..d9b4b2fedfed 100644 > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -731,9 +731,21 @@ static void do_nothing(void *unused) > */ > void kick_all_cpus_sync(void) > { > + struct cpumask mask; > + > /* Make sure the change is visible before we kick the cpus */ > smp_mb(); > - smp_call_function(do_nothing, NULL, 1); > + > + preempt_disable(); > +#ifdef CONFIG_TASK_ISOLATION > + cpumask_clear(&mask); > + task_isolation_cpumask(&mask); > + cpumask_complement(&mask, &mask); > +#else > + cpumask_setall(&mask); > +#endif > + smp_call_function_many(&mask, do_nothing, NULL, 1); > + preempt_enable(); > } That looks very dangerous, the callers of kick_all_cpus_sync() want to sync all CPUs for a reason. You will rather need to fix the callers. Thanks. > EXPORT_SYMBOL_GPL(kick_all_cpus_sync); > > -- > 2.20.1 >