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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 7B29EC4363C for ; Sun, 4 Oct 2020 17:15:03 +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 F1C59206B6 for ; Sun, 4 Oct 2020 17:15:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OYj/+o69"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="fxRJL+k7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=marvell.onmicrosoft.com header.i=@marvell.onmicrosoft.com header.b="aR/WQqcc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1C59206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=marvell.com 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:MIME-Version:Content-ID:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XNJeOJLtn7WLxrJBn/rtPnwOj5fzvOvl291h4AVWv/Q=; b=OYj/+o69INCJr5RQVx683e5MQ hv04wU2gGZnulFBvstZCKHrKbP2YVWLdIYLLCeLL2+cUSMnDTQmV/lHakrRAtidy4YQVKPDF+Swim By5I+CfgfV90JzHTyZhlM1xJgw2DLCULQO6beubtQqQ2mGfzHVhQ4vzZ94ltUtoXoPNuGofASACEi nu8cZ3D/LedfRcW1h1Q9NU59cmOiJpaKo9UXLSEnSqhF96owwyez/a58ocE6kLcwSHTfVb076ILkO Av17cROhvfhfBNpTaxAUNLhnApQNFwsPmX6ps8Fu1xG1bLgIoNKG47WA1GnlYTEyyoy4vfiFSjb91 y1D7Mp8Sw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kP7ZC-0004hW-JZ; Sun, 04 Oct 2020 17:12:58 +0000 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174] helo=mx0b-0016f401.pphosted.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kP7Z9-0004gz-C8 for linux-arm-kernel@lists.infradead.org; Sun, 04 Oct 2020 17:12:56 +0000 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 094HCCeP015919; Sun, 4 Oct 2020 10:12:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pfpt0220; bh=19SNveT3/1FsvwrecD2T/NRh1Ge7yHRw5/gBv2IAZvc=; b=fxRJL+k7ex/1n85PS1rcyMhsseEhnuYMDSNrM/7fa36811BgojkKPXMDgCNsT/IdKHkU K3b+RG4WVSYcv030dlMuVBvg7L8pr8PJroUH1xVmqJ8LodC9Iydf2B4UeVKjsVXu1V47 Igkgg1VLp7+8IyLHikDTAL4kWeUZGnUdxnhhfLxQtns0C81hVVPI+mfup2LDcAhlfgye MtXiiMbutIHi3NWi4O7evQMhpuFGfANZFvQsZKt5qHWUcDpCWkfl9YnytzmTKLrp0sBT axWqsI4qpMRAN2lhWI1wl12FJrRocQedO/baloXR0mkkDSXc8/Hs9Q4Uldq7fgKaWi2D MA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 33xpnpjxsb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 04 Oct 2020 10:12:13 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 4 Oct 2020 10:12:12 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.170) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Sun, 4 Oct 2020 10:12:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NUodKPnz27Kn1wd4ycKkjRBwd8xdBcsQPOwx3YvFuCz4gzSFV/Q6uJRhxsKNY8ndHTubZ82vuFyQMtZ+x6bFz9BLu0e2SQbqsW5rwdFO19zf4b16fpo4D5Fsi12hZIUDQPw4ej4sfrccsifvUNHSsc22WnU2vc0CvXS/hrPZX0uVtF830/bFaN7TyFo7TnDhVSC2wWJ9oTV2YQUEDR4RLaQid/0l8UVyBmRiABC+mmT39abzJLD4Zb+8I7DSNO8t7ow5q+l+wStmL+DkaXwdQFWulhAYmJaTtuCdlEcgb4Jqm9JmZsZFGRzvI7xkbJ4FnOigZL5zzQoVRxQz5MJ4og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=19SNveT3/1FsvwrecD2T/NRh1Ge7yHRw5/gBv2IAZvc=; b=WCmQ3LCJ6+BFqryAh7mq3cTf1qD3i3P3nI9sj8MfUwAMFmY593ed20RzdnBjATSIyoYDxzcstisZ5IR71h9ikNTKuumJQv/FWHKI7KNxizIntz0ODul5uwP2vmX0Y5l15g3MZXMVB+c4MZSqpWaIuuJTEa2k5e8cGZqwpBqGxrjQfKW2CPOJZdUHc90taxzKQFtnJ3rM4VdoucoFR2LsfBSD6smeGpqRe+KADVkiKFPcSatB/KV3CSimjH76nxuXvWp041bHwxJ9xwxrX2g95D1bUPkImDYiYVPequf2pwuZF/IsLDQoEDgKASWPek1ruWV1on2r/MsIaqTIw3belQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=19SNveT3/1FsvwrecD2T/NRh1Ge7yHRw5/gBv2IAZvc=; b=aR/WQqccz0SQxAdQJseewld6u3ByxfGx45TtpUkeKNdnzlandRk7bSBAvJ3v20MFhXKkn4aiG4vHrQjLrVp4xby7FZdykhGSNvreT3ljeQxsEicYl4aqS8t9vo1huId4HZl+qNW/iaP5nyFDGc7fg/ID2ALdZ8xRL9xSkoXp5EA= Received: from MW2PR18MB2267.namprd18.prod.outlook.com (2603:10b6:907:3::11) by CO6PR18MB3889.namprd18.prod.outlook.com (2603:10b6:5:342::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.36; Sun, 4 Oct 2020 17:12:11 +0000 Received: from MW2PR18MB2267.namprd18.prod.outlook.com ([fe80::54a1:710f:41a5:c76f]) by MW2PR18MB2267.namprd18.prod.outlook.com ([fe80::54a1:710f:41a5:c76f%5]) with mapi id 15.20.3433.043; Sun, 4 Oct 2020 17:12:11 +0000 From: Alex Belits To: "frederic@kernel.org" Subject: Re: [EXT] Re: [PATCH v4 11/13] task_isolation: net: don't flush backlog on CPUs running isolated tasks Thread-Topic: [EXT] Re: [PATCH v4 11/13] task_isolation: net: don't flush backlog on CPUs running isolated tasks Thread-Index: AQHWYDiMpgobFulKPk24EMbX9A+yKamDQyOAgATfaQA= Date: Sun, 4 Oct 2020 17:12:11 +0000 Message-ID: References: <04be044c1bcd76b7438b7563edc35383417f12c8.camel@marvell.com> <01470cf1f1a2e79e46a87bb5a8a4780a1c3cc740.camel@marvell.com> <20201001144731.GC6595@lothringen> In-Reply-To: <20201001144731.GC6595@lothringen> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=marvell.com; x-originating-ip: [173.228.7.197] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1bf49b5e-2406-47af-adb6-08d86888a1c5 x-ms-traffictypediagnostic: CO6PR18MB3889: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Cb+GG8FdJIlTOR6TPeu4wuWQ+Lxr+o6QEuABSWroVfX0JqI+KO7U60ECxFCRLmSroR+0zsbwX+fq/FU4mx0kLHjK76qQIPJugPtxcanjuIxwYMZSq+ZPZalEEbnXb9BLQGhAnFCeuhLaua5G+EA3fpqIWMc9UsD9fC+1OSmpEcRyVmF7VnhB7ZRmTr95uHLCi3o0znVX79tiLiIQ3aEkBV1DUKWGvBr0bZ95Qhxj+0Zh5j/w5mMEht1+Qu+iFMFHOFLdfrUgYhZlu+UyPnuFTApVT1sVUnkuTrsEYiW+pMnb8ehRPaCWjnmRH/Q22qS2aaiBZH4DqBhMfWj7aelLOA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR18MB2267.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(66476007)(66946007)(91956017)(76116006)(8936002)(6506007)(26005)(6916009)(478600001)(5660300002)(7416002)(316002)(54906003)(66446008)(64756008)(36756003)(2616005)(86362001)(6486002)(83380400001)(4326008)(66556008)(71200400001)(8676002)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: q0qKlBXyFd5MOXkyrMBB8bd4EF8J9Gqpn8CH66X5MzhZsAXohlGbuxCBZGjwLZ981RE67REoVGLrm+P8nsJA5ubzvUCCFxHETLzhzAbbx1VVroV8H5+yiZn8GsGDMDIZ8+G9jcSuCphlY+CyOQHQAOdJ52iMKX6ZW0z0aC4N5V7PHbmFqMvVQzYagVRzU3Wjovf4dSh46rc9U3BLAqO+HexvHX1HMHCeZ+fpzByjWPG19osLgK9yBW/SRO5EFujSpsOkTitEu4t39SJdS+kQX63AsuiQX2PmSeMaIw1lKG6dTrh8HzOZD/MwXEIznPZdzp0SyBkLgXeoHSoCyLG/CbjREeGy2qK0klbu3c3Gkvvn/3HN+I3zsj4pKL26G+UAR+o9fCa7UjiCnnhVzfbddqMPIGKkALi6ijvk85jvPEhNBAE8klTacHEHuPjWc/ibKSJZn7kvZdUMqJ56LR1qZYmnzV7yfdoXavWdkxQKr6cIL2sXzYTqCd4Ryi3w5QsTmHiJJEXSNiZ547RWOuxHjnbsvOCrOqp4KbsoxaBADc9xFYlRvLegXZrYUjhu64erjnxeNLfon7h7hV+JELSR7vwhoTHoH3JAfSqgtCPTv4c04I7oIs+fpbR+k5CqY0fEYYpcDnBf3aJKBYpgJWDczQ== Content-ID: <53D0548F5897BC409A3E91F01CB6B17A@namprd18.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR18MB2267.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bf49b5e-2406-47af-adb6-08d86888a1c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2020 17:12:11.0343 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RdU0PkIDjRC1cD3LtaHNS7BTa90GovMdOuqvbLCec+GOUZX90Uu89A4GAI7qyNwPCOd6RMAn3eij8xfBUz6cgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB3889 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-04_16:2020-10-02, 2020-10-04 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201004_131255_545832_4B8F00AD X-CRM114-Status: GOOD ( 30.64 ) 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" , "peterz@infradead.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" , "catalin.marinas@arm.com" , Prasun Kapoor , "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 Thu, 2020-10-01 at 16:47 +0200, Frederic Weisbecker wrote: > External Email > > ------------------------------------------------------------------- > --- > 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? I believe, the logic was that it is not supposed to have backlog because it could not be produced while the CPU was in userspace, because one has to enter kernel to receive (by interrupt) or send (by syscall) anything. Now, looking at this patch. I don't think, it can be guaranteed that there was no backlog before it entered userspace. Then backlog processing will be delayed until exit from isolation. It won't be queued, and flush_work() will not wait when no worker is assigned, so there won't be a deadlock, however this delay may not be such a great idea. So it may be better to flush backlog before entering isolation, and in flush_all_backlogs() instead of skipping all CPUs in isolated mode, check if their per-CPU softnet_data->input_pkt_queue and softnet_data- >process_queue are empty, and if they are not, call backlog anyway. Then, if for whatever reason backlog will appear after flushing (we can't guarantee that nothing preempted us then), it will cause one isolation breaking event, and if nothing will be queued before re- entering isolation, there will be no backlog until exiting isolation. > > > 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? Same as with other calls to task_isolation_on_cpu(cpu), it orders access to ll_isol_flags. > > + 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