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=-15.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 12374C433E0 for ; Fri, 22 Jan 2021 15:02:59 +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 B8BA223AC9 for ; Fri, 22 Jan 2021 15:02:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8BA223AC9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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: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=1jxLv3rch/eL9Ws4od53HMJiwl5+rBGj/nn4Bd+5KuA=; b=BBy5HIQCvjomw/8qTcU1yDFU3 uOtFjk86Y4lNDWBek+VE1M/DvJKt06RbATB2P1qybJwOC8fuXiSUxiMba7SDDT6ttuOKvt51fqVJl FzgA/RmIVg0c0caghWWfPpDtP9RbMZtkQWngw5LnA8x8QE0dqM6Jc9saJtwCh/WOt9nbld3OkQCKw PKnx5AQbD5sNNFLgAbOvwTdUAAUD0LOXPRfC7U+JkFb27wiXvcdPqe79OGpBxTgp5DBxXZjIECvwx 2QiZdrmXQswHAL0ncAQiv1kiaLUzpcUH0RIBG/OtXfA7xU5HRJPjJJ2EpoCqNl3RAS8/JDDGHeyqp CYUvEgjDA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2xwI-0004kp-3i; Fri, 22 Jan 2021 15:01:30 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2xwE-0004jV-Ob for linux-arm-kernel@lists.infradead.org; Fri, 22 Jan 2021 15:01:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611327686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pmb5w3rLav37us1XL43BkDMIwzOvI7ua2CZXzDfcqdo=; b=RMNia+aWsbZ2a4Uow1vMMsoI1dfC5hik/A4ABjPSW+h7rvN7tUD2HQmzicf9J1bJJvX5fx a2A57LcIXNIQLFbhEMwC7faaho3vWa3w8uNOjc3wvYqS8FNHz7o/T5ZR/lNv462IxQJDe2 tDVWVCPnmJmqGK+Win3qP+3ouaN9etY= 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-321-8khLFf0OO4Wy_Qo2eG4Tuw-1; Fri, 22 Jan 2021 10:01:22 -0500 X-MC-Unique: 8khLFf0OO4Wy_Qo2eG4Tuw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A28DA190A7A1; Fri, 22 Jan 2021 15:01:18 +0000 (UTC) Received: from fuller.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32EC36F990; Fri, 22 Jan 2021 15:01:18 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 02E034178900; Fri, 22 Jan 2021 11:13:20 -0300 (-03) Date: Fri, 22 Jan 2021 11:13:20 -0300 From: Marcelo Tosatti To: Frederic Weisbecker Subject: Re: [PATCH v4 11/13] task_isolation: net: don't flush backlog on CPUs running isolated tasks Message-ID: <20210122141320.GA66969@fuller.cnet> References: <04be044c1bcd76b7438b7563edc35383417f12c8.camel@marvell.com> <01470cf1f1a2e79e46a87bb5a8a4780a1c3cc740.camel@marvell.com> <20201001144731.GC6595@lothringen> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201001144731.GC6595@lothringen> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210122_100126_866623_2929CD56 X-CRM114-Status: GOOD ( 23.90 ) 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" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "mingo@kernel.org" , "netdev@vger.kernel.org" , Alex Belits , Prasun Kapoor , "tglx@linutronix.de" , "will@kernel.org" , "davem@davemloft.net" , "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, Oct 01, 2020 at 04:47:31PM +0200, Frederic Weisbecker wrote: > On Wed, Jul 22, 2020 at 02:58:24PM +0000, Alex Belits wrote: > > From: Yuri Norov > > > > so we don't need to flush it. > > What guarantees that we have no backlog on it? >From Paolo's work to use lockless reading of per-CPU skb lists https://www.spinics.net/lists/netdev/msg682693.html It also exposed skb queue length to userspace https://www.spinics.net/lists/netdev/msg684939.html But if i remember correctly waiting for a RCU grace period was also necessary to ensure no backlog !?! Paolo would you please remind us what was the sequence of steps? (and then also, for the userspace isolation interface, where the application informs the kernel that its entering isolated mode, is just confirming the queues have zero length is sufficient?). TIA! > > > 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