Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp21600lqo; Wed, 15 May 2024 06:43:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNfo7a55A7oOlYeG98tRwlNlGk4QhO2QwqNn4gab5j3YN/mCW2EV5E9ZgGq9T0f3nCFn0OsieFyB9eF1IvAvdC4z5/yEv+RHuAq3t0RA== X-Google-Smtp-Source: AGHT+IFwRGKyGI4fMB2HMx22FUCIcp6QEjaj9uDx5if1CQtBK4uvdE0Yr1g8lHAkbYdjw+rEgeKx X-Received: by 2002:a17:906:e943:b0:a5a:8a63:9fee with SMTP id a640c23a62f3a-a5a8a63a051mr305999866b.3.1715780625371; Wed, 15 May 2024 06:43:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715780625; cv=pass; d=google.com; s=arc-20160816; b=WZawkEG6YyXMJc6UcNkvuVCpu0P5lLfn0xEHKeJAoEQdIBEUCuCmsPU/FTxWADkw64 E+YvLlkhAt1czSqoGnCDFdUwcokX05fS6RbfE5kqrC9tAv3cde16W11kTZhWR3E3/p5P F04oBkrHl8bQNsAQHv/bXd/i95hjnhKEFSFdg+SB5G39wDao4oH8NYKaymRM9WmcjHIQ p2t1XtAwXaYo+7IipI+Fj07F3MNrdQ79sXeP+bdDVIBrP245GcYbfYd4pu2YVdtnrJqw cNsxbk+sEHmX3rkjSIAJ+R7Neyl0Im96OxGWzzRa3LVnKy6IUAAXI4QD2DzpT3TYhiu1 q6xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=jdU69UoyhJ1zQ0SWWUqZX4B1Wd/oEqna6YOmzjb1SQg=; fh=eIGkCiHOtdhU0dMNUR+ecvnV/lYuDW6w/G2Vn+YtPzs=; b=kqjFSJRrJy4gZb78q5pZ48+YLBz7lPpg1aXPMDUnaaKOKkD/Nn/SbwQyf1rq24iJdI QxTzo3IWfO3jZolTzIFqb6RbLp2xTfPvaizd1+Cw+bBAhM7p43Uz9N+o1NyRaIS9QKqZ 7BXKOJ9iaejUvUp5XbQt/VzjjNIH4XjATCmJVFLSdeHY041vf3938/t1R1Qg32Sgusro txZtPS9vtGaZJIhQMSZLqYHA7EPRDCtlN+eVPBoobm7da3bEetNUX3+ZyskOhX02Ou90 qEEmUhHWV4zHDAJdhrhOHdUk+uuh7hK6sjMg9j0oTGtFK8kleKu0nD8BjOWdIBuWflD0 SunQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FTi282HB; 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-179930-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17b21ac6si807134066b.322.2024.05.15.06.43.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 06:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179930-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FTi282HB; 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-179930-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179930-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 199041F21F11 for ; Wed, 15 May 2024 13:43:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA6D113F016; Wed, 15 May 2024 13:43:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="FTi282HB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZGm6S6Vm" 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 539B11386AD; Wed, 15 May 2024 13:43:30 +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=1715780611; cv=none; b=h26hdF5aVmzOPDMno4D4FeHsVrFLJJ19SA2Ncm+kHmTFiBaRIwfluUqgjEiJnK3/c/2aiHoJjloVhM6fsSlec6HZwHZX/Huhd/+vCpbEiAz5gq15MY+ZV3zfDK5xDW7AitFI+GOUtLXYPlJQyI2cqwk+HoUB4DlVgLn21K3fRO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715780611; c=relaxed/simple; bh=TRd4hhNnYO8xgPIyqCyl4FMG7ggnR9P6dr6VfxbM808=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=txj/ebfL/NSobjOvihEqms9xBv5Ldo6Z0/kJAEfHRNREJEsNPxRDjz5lOp0SGgHCLqDQiNaH1qYJwoOw8i8k4/ybsX+L1hpQAFQYpD0hXwIB3O4oCsxOtkZxmgrIgMlJzFBffkr/PkpgAoNpSob+5OpC9eOVuOSWufhKJmoNojc= 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=FTi282HB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZGm6S6Vm; 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: Wed, 15 May 2024 15:43:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1715780608; 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=jdU69UoyhJ1zQ0SWWUqZX4B1Wd/oEqna6YOmzjb1SQg=; b=FTi282HBZPmh7c6WSn/S4W0VoXiezouodE+uKWxcNgMky5OxF8h3uS021U7PJHtAP39Mp5 dWLAhTE1v4uYd7TcVk57La8G+rWUkM5OIKxDqEkSAIhzB3nAFpd6YhixeKpB/4oiKb4yJg 1srE4D4+NwxIOoymWVuWDzQqjk1hn9ZKsMfPcvBIwmExIuDh2aD3Lx8tPhOl4krgup6CTe agYP4M79xR7awcNAyzbm80mTuKLCdEtQD6k0ck+ApCEU/d/nHp+2tKMZrXMZA8Tsr1QHGV ABEhsV09T6MHTvT6s1ZNycxEWWnuYOF+cxALNh1ZVyjYU1qQQf+p7+axJva5VQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1715780608; 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=jdU69UoyhJ1zQ0SWWUqZX4B1Wd/oEqna6YOmzjb1SQg=; b=ZGm6S6Vm9lEMBk7wMxLxmbVEvokYejJincM8TEVPpN2oaUje3MvkHH1NzflfDEs1mdQvSB Q+STKOt4MnoOH9Bg== From: Sebastian Andrzej Siewior To: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Cc: Jesper Dangaard Brouer , Alexei Starovoitov , LKML , Network Development , "David S. Miller" , Boqun Feng , Daniel Borkmann , Eric Dumazet , Frederic Weisbecker , Ingo Molnar , Jakub Kicinski , Paolo Abeni , Peter Zijlstra , Thomas Gleixner , Waiman Long , Will Deacon , Alexei Starovoitov , Andrii Nakryiko , Eduard Zingerman , Hao Luo , Jiri Olsa , John Fastabend , KP Singh , Martin KaFai Lau , Song Liu , Stanislav Fomichev , Yonghong Song , bpf Subject: Re: [PATCH net-next 14/15 v2] net: Reference bpf_redirect_info via task_struct on PREEMPT_RT. Message-ID: <20240515134326.14x755Wb@linutronix.de> References: <20240503182957.1042122-1-bigeasy@linutronix.de> <20240503182957.1042122-15-bigeasy@linutronix.de> <87y18mohhp.fsf@toke.dk> <20240507123636.cTnT7TvU@linutronix.de> <93062ce7-8dfa-48a9-a4ad-24c5a3993b41@kernel.org> <20240510162121.f-tvqcyf@linutronix.de> <87le4cd2ws.fsf@toke.dk> 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 Content-Transfer-Encoding: quoted-printable In-Reply-To: <87le4cd2ws.fsf@toke.dk> On 2024-05-14 13:54:43 [+0200], Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1504,6 +1505,8 @@ struct task_struct { > > /* Used for BPF run context */ > > struct bpf_run_ctx *bpf_ctx; > > #endif > > + /* Used by BPF for per-TASK xdp storage */ > > + struct bpf_net_context *bpf_net_context; >=20 > Okay, so if we are going the route of always putting this in 'current', > why not just embed the whole struct bpf_net_context inside task_struct, > instead of mucking about with the stack-allocated structures and > setting/clearing of pointers? The whole struct bpf_net_context has 112 bytes. task_struct has 12352 bytes in my debug-config or 7296 bytes with defconfig on x86-64. Adding it unconditionally would grow task_struct by ~1% but it would make things way easier: The NULL case goes away, the assignment and cleanup goes away, the INIT_LIST_HEAD can be moved to fork(). If the size increase is not an issue then why not. Let me prepare=E2=80=A6 > -Toke Sebastian