Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp205333rdb; Thu, 18 Jan 2024 00:37:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8g/jvBRBih9zgE7JlH65+AMfn0LNZBuAuzlzFof9zjPnh0jJs+GGUbl2NadWWKz9u6QaJ X-Received: by 2002:a17:90b:d97:b0:28d:19cb:c9de with SMTP id bg23-20020a17090b0d9700b0028d19cbc9demr377364pjb.87.1705567044292; Thu, 18 Jan 2024 00:37:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705567044; cv=pass; d=google.com; s=arc-20160816; b=GmB5BTikc+WdV3Q3RaDbxzgA2pi9PXUjkLlzGyx+Gr80QRwNgBZB6VzgtE5NS6YXTC UTsC5XbUal7T+enxwNcZAO+7kYWnx4J4kuREe1oym5WJBrorli/q1aAvtyJOaADIkitL XDmtF74O6xv1aAaiWBGwZMExYJeNmELKONzNT0Jvo0enV5OKLo/ZwnMwkKEULMso+bpi 3Qzzp211ZsT3hgRjwj/jP0QIjA+ambwsJMcdZ3/ZuE/pQbFxEbU/VpNc8KJxvkAaO8Ti BGVe7dQK0LUctfniswjfJ8Vf/+zN3YBu3EvP88m6h3H38vFO0zy5COHVmF76wIS1MX3U 4+lQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=FqDaDFZqHBr+6WdyMt/QodCMIwP8ih8bcOQuBWFD+a4=; fh=ZUazKBU4kEf9njyf6kBf2RFXzYKfc26iIyBBXpuLBCg=; b=jGQ2QCPxmx4+zuuPX0libG+/g/8YuJbvJApmHcTmFrNxhwp4kcKcpqClPdyLtWl2GR HE06gs1OCMg21UKzwV44aAJrgoX5ye2YOF6Q/yu5cl0wJrbglN2I1f+xslIDKJggB6BU ZzC/G7YbTHbugfvzLq7J95xMElksfHDFg9a8H0LRgsaIgXc84Y+lH7rGdGEIulvgolEK /5UQpKw6UaEAfzq31qEC4SbfTwJylwOec3uSN2V/PAdUqkf4lCZ54DTc7sVJKIRaEv4v uCnkJ6QPUQ2FhsBEzKJFDmp0sJaipWZmL2xBlas7nvLZNMKD0IZMcz4MsUGkDVVhPztr lcUw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ULUlXTuq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-29894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29894-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 11-20020a17090a034b00b00290329356dasi78830pjf.189.2024.01.18.00.37.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 00:37:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ULUlXTuq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-29894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29894-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ECBB3282C7C for ; Thu, 18 Jan 2024 08:37:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B01225619; Thu, 18 Jan 2024 08:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ULUlXTuq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8X0vlXbx" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BDDA25602; Thu, 18 Jan 2024 08:27:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705566479; cv=none; b=gowrD6a7tSWy8KbuIvJTMaBxbiJ81t5fAcxnlwjyN60RnN6SfLZS9yiqKO9kSGZgNSfsEkVLdeVbsa30doq2BSbgQP9JEEje/njP9LSiqRiE39VdjGR05Rx856UT9IiVvqRad4ehauGWHoNNlP41e6WZ/ozMnRTf4B7hTjZ7gow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705566479; c=relaxed/simple; bh=FqDaDFZqHBr+6WdyMt/QodCMIwP8ih8bcOQuBWFD+a4=; h=Date:DKIM-Signature:DKIM-Signature:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=gdxsxUd5XeFWoCkZsV5Bvw8oMh7BfxLGfDCjY3ZKp1Mr+3xOPhdcyAgjDaYbi/bzzbydpT0bspAT03VAl+oXmoNTVLW8i3jNtY5iBSeNA/wuUvUofYfq8g8rx73qrLjquMjxADKbMIlO6/KIMcN6HN/2CuH6S8+GLRlNZfPvXys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ULUlXTuq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8X0vlXbx; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 18 Jan 2024 09:27:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1705566476; 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=FqDaDFZqHBr+6WdyMt/QodCMIwP8ih8bcOQuBWFD+a4=; b=ULUlXTuqug9vx2pHul8nknoShdT3GMPzErH5ysd7s1ozlosDBVdHLNVD/xkJgENWLVD0IE VXZCtDIHyQ8rsg2SxI12zJKRPGA+f8P/tP/R44ZZt5rpmFBzGB+++joNOxOOnDR3TK5nX9 3hJZiXd/0ELV8ISAflvIgJIc5SHPbcRxu3BpDKYRUi0cPy9pareqe7+1G3lvGmx8kLKfR5 oyYq0l7ll4+fnkKun+xy3+ZfpR50ONPQc1RbzldkWUbCSjmfRfG2/ui9H8X55wd5M30JXJ 8f9QOHa4hwHULaLSYAPusjOdcNKrdmwT8HcumuPSsPqC1MeQ8zMv8A79UF/oRg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1705566476; 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=FqDaDFZqHBr+6WdyMt/QodCMIwP8ih8bcOQuBWFD+a4=; b=8X0vlXbxI3eFXc5LIwJRggK1eV2OY9uO4RMh/qUdkwHa4UTEkUDb46oQ3rsgCkJqN7LfBP DEBQdp/o3cm8knCg== From: Sebastian Andrzej Siewior To: Jakub Kicinski Cc: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , Alexei Starovoitov , LKML , Network Development , "David S. Miller" , Boqun Feng , Daniel Borkmann , Eric Dumazet , Frederic Weisbecker , Ingo Molnar , Paolo Abeni , Peter Zijlstra , Thomas Gleixner , Waiman Long , Will Deacon , Alexei Starovoitov , Andrii Nakryiko , Cong Wang , Hao Luo , Jamal Hadi Salim , Jesper Dangaard Brouer , Jiri Olsa , Jiri Pirko , John Fastabend , KP Singh , Martin KaFai Lau , Ronak Doshi , Song Liu , Stanislav Fomichev , VMware PV-Drivers Reviewers , Yonghong Song , bpf Subject: Re: [PATCH net-next 15/24] net: Use nested-BH locking for XDP redirect. Message-ID: <20240118082754.9L_QFIgU@linutronix.de> References: <20231215171020.687342-1-bigeasy@linutronix.de> <20231215171020.687342-16-bigeasy@linutronix.de> <87r0iw524h.fsf@toke.dk> <20240112174138.tMmUs11o@linutronix.de> <87ttnb6hme.fsf@toke.dk> <20240117180447.2512335b@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240117180447.2512335b@kernel.org> On 2024-01-17 18:04:47 [-0800], Jakub Kicinski wrote: > Oh, and I'm bringing it up here, because CONFIG_RT can throw > in "need_resched()" into the napi_rx_has_budget(), obviously. need_resched() does not work on PREEMPT_RT the way you think. This context (the NAPI poll callback) is preemptible and (by default) runs at SCHED_FIFO 50 (within a threaded IRQ) so a context switch can happen at any time by a task with higher priority. If threadA gets preempted and owns a lock that threadB, with higher priority, wants then threadA will get back on CPU, inherit the priority of the threadB and continue to run until it releases the lock. If this is the per-CPU BH lock (which I want to remove) then it will continue until all softirqs complete. Sebastian