From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9A8DC4741F for ; Thu, 1 Oct 2020 14:47:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A47152158C for ; Thu, 1 Oct 2020 14:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601563656; bh=i8gkPOTOaQ0+zyvFuAkWNLjAJL2goMrnBIOZltkQ8Ck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=db//Jp21uyY9dw6dn+07L/Rch7lflCCWzlea3XQY6zobM8TbvqR5WZcNlccX7eNyW QwYsQlEE1E8pm5Z+BPoZCmdquArEuK7yZeV4o5sdYnSlEFeGWwImmCFzBKRyTtmRZG NbB9ABMIfglJaSZrLjnm/vG/U6jO2gScS+kMUqio= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732511AbgJAOrf (ORCPT ); Thu, 1 Oct 2020 10:47:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:35258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732020AbgJAOrf (ORCPT ); Thu, 1 Oct 2020 10:47:35 -0400 Received: from localhost (fla63-h02-176-172-189-251.dsl.sta.abo.bbox.fr [176.172.189.251]) (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 F27AF207DE; Thu, 1 Oct 2020 14:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601563654; bh=i8gkPOTOaQ0+zyvFuAkWNLjAJL2goMrnBIOZltkQ8Ck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AZLGzuFNTPMn09I0z3LQqB6nzf+J1qT4KmkpA1/2qQMnhaYS05nYkxwEHglBaBKuK OD4eWHWTOmOuR6j18ekhqESCIE/U4IteqNC3m2p98CQYXbpth1LrOuqwP+CvdoDQ2N vjlq3eoDrlemL6LFh9S2r7IqXrpMviURP4YvS3WE= Date: Thu, 1 Oct 2020 16:47:31 +0200 From: Frederic Weisbecker To: Alex Belits Cc: "rostedt@goodmis.org" , Prasun Kapoor , "mingo@kernel.org" , "davem@davemloft.net" , "linux-api@vger.kernel.org" , "peterz@infradead.org" , "linux-arch@vger.kernel.org" , "catalin.marinas@arm.com" , "tglx@linutronix.de" , "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" Subject: Re: [PATCH v4 11/13] task_isolation: net: don't flush backlog on CPUs running isolated tasks Message-ID: <20201001144731.GC6595@lothringen> References: <04be044c1bcd76b7438b7563edc35383417f12c8.camel@marvell.com> <01470cf1f1a2e79e46a87bb5a8a4780a1c3cc740.camel@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01470cf1f1a2e79e46a87bb5a8a4780a1c3cc740.camel@marvell.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 22, 2020 at 02:58:24PM +0000, Alex Belits wrote: > From: Yuri Norov > > If CPU runs isolated task, there's no any backlog on it, and > so we don't need to flush it. What guarantees that we have no backlog on it? > Currently flush_all_backlogs() > enqueues corresponding work on all CPUs including ones that run > isolated tasks. It leads to breaking task isolation for nothing. > > In this patch, backlog flushing is enqueued only on non-isolated CPUs. > > Signed-off-by: Yuri Norov > [abelits@marvell.com: use safe task_isolation_on_cpu() implementation] > Signed-off-by: Alex Belits > --- > net/core/dev.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 90b59fc50dc9..83a282f7453d 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -74,6 +74,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -5624,9 +5625,13 @@ static void flush_all_backlogs(void) > > get_online_cpus(); > > - for_each_online_cpu(cpu) > + smp_rmb(); What is it ordering? > + for_each_online_cpu(cpu) { > + if (task_isolation_on_cpu(cpu)) > + continue; > queue_work_on(cpu, system_highpri_wq, > per_cpu_ptr(&flush_works, cpu)); > + } > > for_each_online_cpu(cpu) > flush_work(per_cpu_ptr(&flush_works, cpu)); Thanks. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54AFBC4727C for ; Thu, 1 Oct 2020 14:48:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4DCA207DE for ; Thu, 1 Oct 2020 14:48:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="i5VBa3zJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="AZLGzuFN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4DCA207DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DB6vlCq7kQToH+nLsFXadaMnNVj1FNjLRv6pdSXKvf0=; b=i5VBa3zJ7/ilQG3lRX4hPO8Pa 42BtChsuc/IsmtgWE0jH+6jYcALnv5edIdPxca3KT7uUQMSIJMmLC+hh9pHtxU7iF7HNLQyLZaZc3 1jvhZ1SlYlFU7o773q3vONm5Hhs8vfmqJeRMffRWXIyZTLpK2tGZvgDUjAZtOlwRDLT6TWUDGNFbZ EOc0atjBiXhYqrrnPOwTdiQ35F1MMuzqe17q0MlouvnHOIyWYhuSnOZpMte8o0udd7tU1euZ566UC NCBgtnPT1QdBrzGU1qufu71F7dsol07Kx7N3bzaNKWYjXhcVTd3hbMaXDT02UUW9LgMEzt2ygpTgG IPr1mGaBg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNzru-0002L8-1b; Thu, 01 Oct 2020 14:47:38 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNzrr-0002Jk-7X for linux-arm-kernel@lists.infradead.org; Thu, 01 Oct 2020 14:47:36 +0000 Received: from localhost (fla63-h02-176-172-189-251.dsl.sta.abo.bbox.fr [176.172.189.251]) (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 F27AF207DE; Thu, 1 Oct 2020 14:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601563654; bh=i8gkPOTOaQ0+zyvFuAkWNLjAJL2goMrnBIOZltkQ8Ck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AZLGzuFNTPMn09I0z3LQqB6nzf+J1qT4KmkpA1/2qQMnhaYS05nYkxwEHglBaBKuK OD4eWHWTOmOuR6j18ekhqESCIE/U4IteqNC3m2p98CQYXbpth1LrOuqwP+CvdoDQ2N vjlq3eoDrlemL6LFh9S2r7IqXrpMviURP4YvS3WE= Date: Thu, 1 Oct 2020 16:47:31 +0200 From: Frederic Weisbecker To: Alex Belits Subject: Re: [PATCH v4 11/13] task_isolation: net: don't flush backlog on CPUs running isolated tasks Message-ID: <20201001144731.GC6595@lothringen> References: <04be044c1bcd76b7438b7563edc35383417f12c8.camel@marvell.com> <01470cf1f1a2e79e46a87bb5a8a4780a1c3cc740.camel@marvell.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <01470cf1f1a2e79e46a87bb5a8a4780a1c3cc740.camel@marvell.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201001_104735_363043_7ED40A40 X-CRM114-Status: GOOD ( 19.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arch@vger.kernel.org" , "catalin.marinas@arm.com" , "peterz@infradead.org" , Prasun Kapoor , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-api@vger.kernel.org" , "tglx@linutronix.de" , "will@kernel.org" , "mingo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 22, 2020 at 02:58:24PM +0000, Alex Belits wrote: > From: Yuri Norov > > If CPU runs isolated task, there's no any backlog on it, and > so we don't need to flush it. What guarantees that we have no backlog on it? > Currently flush_all_backlogs() > enqueues corresponding work on all CPUs including ones that run > isolated tasks. It leads to breaking task isolation for nothing. > > In this patch, backlog flushing is enqueued only on non-isolated CPUs. > > Signed-off-by: Yuri Norov > [abelits@marvell.com: use safe task_isolation_on_cpu() implementation] > Signed-off-by: Alex Belits > --- > net/core/dev.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 90b59fc50dc9..83a282f7453d 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -74,6 +74,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -5624,9 +5625,13 @@ static void flush_all_backlogs(void) > > get_online_cpus(); > > - for_each_online_cpu(cpu) > + smp_rmb(); What is it ordering? > + for_each_online_cpu(cpu) { > + if (task_isolation_on_cpu(cpu)) > + continue; > queue_work_on(cpu, system_highpri_wq, > per_cpu_ptr(&flush_works, cpu)); > + } > > for_each_online_cpu(cpu) > flush_work(per_cpu_ptr(&flush_works, cpu)); Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel