Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27465111rwd; Tue, 4 Jul 2023 03:25:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlEUkomTBwFxQ2U2smS0Pp3w/ujlnu5hmZX8ogtqGX2zntqC5rijHKs4c5E9W/ae36bJ5Qjf X-Received: by 2002:a17:90a:a61:b0:263:11f8:a132 with SMTP id o88-20020a17090a0a6100b0026311f8a132mr13421541pjo.36.1688466320872; Tue, 04 Jul 2023 03:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688466320; cv=none; d=google.com; s=arc-20160816; b=DD84NM2OQeBTE8v82b3vac7HoHACHhv4U36B77XxmcCZ2CjDQg+46JrudLDxHarexC 585U0UPnkBe1IXSpflQ+ZCQlIGEnfMRqurz5izJ6+EJk83xabcT4YAK6UENBc8yEAl3t 8pxMM06p14bpWVZ/Lcw7Yq3lQ0gbty21ZRMjSA7jGciV1locZi+XuZcEOgAiiRrWrOVE /t03TM0xT4D/dzLgn7kVTDTsOUmwScLMY10pIyVmGOy39aNP0NlruYq8tzhpnGUAl1An RYs2NKgP7WvuveCU+eGZjnxUIZrXGeiszI2vgOCWcC+l4lOOsKPUKJoK2ptVYifVn/cg F9Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=8MTmdUPrOxgHFBWgYdG8uHdtoV2yVFTVtMbfQtqI+N4=; fh=Cq+YmiqTLS7IQSmduJzIaKB0HMx7hYDtabH8cb5lW1Y=; b=eD2PvaS0v21SeqKf8ktsJwqWWNDX4i8nbfJ9sIq/wWk2MAjrlLMfTYY+PxA3MeR1bu qIuLqf/v9Tx/16zVWoAeUQWPSDrpxBwqnvcr4v1m6M520VkFOafajseexsl71dadSkM+ xdvGhw3qQlEi0EWViIoF1nQ5SNxvYChrFllKc8IufvPl3m/VvNXUOnS66Ky6Yd1rhDyT k2G/L8X7yQmqMMU7DgUrlSrFUBakDyqGTglWyNPIU1LEqI9ivM60bLdumnLafk/qvozw p6VYVIwXuyoDWW8nEjPL4FyKGzvPQOtzxq++EWEBgjr2EJb3AgJGOIRZRBAsxeWqXIkc khjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=w8g9zcjF; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a63e009000000b0051322a8d2aesi20363300pgh.110.2023.07.04.03.25.05; Tue, 04 Jul 2023 03:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=w8g9zcjF; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231570AbjGDKFe (ORCPT + 99 others); Tue, 4 Jul 2023 06:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231552AbjGDKFd (ORCPT ); Tue, 4 Jul 2023 06:05:33 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0260EE; Tue, 4 Jul 2023 03:05:30 -0700 (PDT) Date: Tue, 4 Jul 2023 12:05:27 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1688465129; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8MTmdUPrOxgHFBWgYdG8uHdtoV2yVFTVtMbfQtqI+N4=; b=w8g9zcjFUkBQGTavZvYh+mxRwEQbWF/wvTL5F26kb5aDCtJSlsuEQbkT1II7W+AqLuhm2e UYGJcNhxH+ctOs0U+E6G1yHVuz6Eebmzz9pXRKP3wOgfWhFv8BclaETf6EtTDyZohZ5UoN fQWp5nX+SWm9jPmPJuiquffPGsMeZDlriJajYpJatc/wOyqAo9SgB6X1hDKkaC+cAST+Qk wfAXKioU53axGudjYCcmmx9nCDmQaeNdlul6CJKja0s3uMbPB6zIJRx+iemQptrHuqYoOj e1fIlW6ku52s5g+KjvVFaHsF1iV09ubBInI+zMwmYGYPn30ME8onc7laFeOqeQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1688465129; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8MTmdUPrOxgHFBWgYdG8uHdtoV2yVFTVtMbfQtqI+N4=; b=rqUf3S4T7NRDsOq8vH2lBF1h3Fnp9qybW4fqH1LoOvIGZpXX4/YR0DYpeOPQcYUJn7ESzs dKvqjMXhERPe+pDg== From: Sebastian Andrzej Siewior To: Wander Lairson Costa Cc: Paolo Abeni , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, juri.lelli@redhat.com Subject: Re: Splat in kernel RT while processing incoming network packets Message-ID: <20230704100527.75hMNZ35@linutronix.de> References: <20230703142908.RcxjjF_E@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-07-03 18:15:58 [-0300], Wander Lairson Costa wrote: > > Not sure how to proceed. One thing you could do is a hack similar like > > net-Avoid-the-IPI-to-free-the.patch which does it for defer_csd. >=20 > At first sight it seems straightforward to implement. >=20 > > On the other hand we could drop net-Avoid-the-IPI-to-free-the.patch and > > remove the warning because we have now commit > > d15121be74856 ("Revert "softirq: Let ksoftirqd do its job"") >=20 > But I am more in favor of a solution that removes code than one that > adds more :) Raising the softirq from anonymous (hardirq context) is not ideal for the reasons I stated below. > > Prior that, raising softirq from hardirq would wake ksoftirqd which in > > turn would collect all pending softirqs. As a consequence all following > > softirqs (networking, =E2=80=A6) would run as SCHED_OTHER and compete w= ith > > SCHED_OTHER tasks for resources. Not good because the networking work is > > no longer processed within the networking interrupt thread. Also not a > > DDoS kind of situation where one could want to delay processing. > >=20 > > With that change, this isn't the case anymore. Only an "unrelated" IRQ > > thread could pick up the networking work which is less then ideal. That > > is because the global softirq set is added, ksoftirq is marked for a > > wakeup and could be delayed because other tasks are busy. Then the disk > > interrupt (for instance) could pick it up as part of its threaded > > interrupt. > >=20 > > Now that I think about, we could make the backlog pseudo device a > > thread. NAPI threading enables one thread but here we would need one > > thread per-CPU. So it would remain kind of special. But we would avoid > > clobbering the global state and delay everything to ksoftird. Processing > > it in ksoftirqd might not be ideal from performance point of view. >=20 > Before sending this to the ML, I talked to Paolo about using NAPI > thread. He explained that it is implemented per interface. For example, > for this specific case, it happened on the loopback interface, which > doesn't implement NAPI. I am cc'ing him, so the can correct me if I am > saying something wrong. It is per NAPI-queue/instance and you could have multiple instances per interface. However loopback has one and you need per-CPU threads if you want to RPS your skbs to any CPU. We could just remove the warning but then your RPS processes the skbs in SCHED_OTHER. This might not be what you want. Maybe Paolo has a better idea. > > > Cheers, > > > Wander Sebastian