From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f202.google.com (mail-qt1-f202.google.com [209.85.160.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2785C3431E6 for ; Mon, 2 Mar 2026 18:14:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772475280; cv=none; b=uswX5CrRjYJSV/woPkT+IBM5zlL7+wJ+GKm5QxeWLLnRFc/KEW9BjEgINmVdpvxijKhaKylwjwCCsEtN1fVNjIVXcaxnZl1l/LELgXpiEen+calAbe1rI/Pe93buWAyphwjQDD/Hw73jlCr+HOQWto4StqpBo6ln4XH1A6jhnRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772475280; c=relaxed/simple; bh=QTMrbPraPLDxOEIUtWRShfaSnMGJSy5Du5wSxtkUJDU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Dys3inAYqnVC6ojXzCHVBhEBl7m91vJU+hpxdGwJDfOxL8lIMi24TPTgM8J/53Ya5797543bNxOKWLj3zy8oCg3d984P2CsOzfAUHSdUKZ10H2nV1vPyLLdP4qppUo8TZ7L+s6B99GRnC59aiVwBQrMPJvzHHgvMEHucD2T0ua0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bIIBNsX/; arc=none smtp.client-ip=209.85.160.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bIIBNsX/" Received: by mail-qt1-f202.google.com with SMTP id d75a77b69052e-506c0231e63so575903301cf.1 for ; Mon, 02 Mar 2026 10:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772475278; x=1773080078; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=++qqChHCxPNceSOgjzDFvaWkjwxttaKgTopHBSGe1To=; b=bIIBNsX/WRPaO+WInbnOHjAc193UvAzb6T7bdFfsLEyNUDWc0WV2b6jek1WYbiobTN 8qP5v6Fj4bmtQ/RVAzlf20xej8DdBh+vrr5am5IGSqB5Omm1aeYX20dd63f20/GS5Ucw FYtc+97npxvNgBmcUg1qvYNSj1quVNkLwI67ofFZwNjc1G13B5tEmt93m3xCWZXDsj+i 8akGGktLeJEfi7S+NWvX8j0Y0/riw4lsoSclW+HVQs9xipHRu6Qt5EtcRNSU7htxN/Gs P8/Ejut4B3v6fI520WwOuf3AAIsgu2fjXcHGwRrBygJW2+uxrp4A9NACtcUqHXFMJxgi /Cfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772475278; x=1773080078; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=++qqChHCxPNceSOgjzDFvaWkjwxttaKgTopHBSGe1To=; b=D97ZGIweG+sKNY66jBtsRkmWTb43vS85cD/vq4QwHgnBMWbBjph5zO6PKAHFqzD2lE 9FSVV/OUGR+SSXq4ueNOcaaIl3fpTrXpWQa+ZeikLiM1xWnlKlJqM09/b10ZJeHQgoL5 4bitZa62zwpW/WbKxLFmvyFiSjNWatZLCwCcbbvu3aXJRos0y/AWuCEmPbiXRalkkQ6j 73UDGY/ao5KbFLSCScOcLsAdZe4NsbV+ElFhbHOvo1X7tc405B4sLssTXbPZE0HgqQzl o2zb8PsW3qmZ1dEgNIx0w6u11pc4y9lvp9XLjaw+w8GXVdKfmVvX+u84Z9qumKYCCDrF PQjw== X-Forwarded-Encrypted: i=1; AJvYcCVM4TGhueweySNqefHs5J4/qcthM02VcF0iavtgdnsIbyE7r53LLGM++suoxbDJM/7lmnKPL58=@vger.kernel.org X-Gm-Message-State: AOJu0YxscJu8kF2NBcHxoeQzbUMYdyOMBPbJz8HJJ0eePBuomi4GgJXD mNAvHF7IuuyTvfDl39S0w8clkYY4Tz2JNn+R5bBpTZqxGb9mdK4Ph6rdVOuZudLvVSs6ekxrGZ4 aZ1Uu2dZb+X7W5g== X-Received: from qtw2.prod.google.com ([2002:ac8:5702:0:b0:4f0:2dd:9d10]) (user=edumazet job=prod-delivery.src-stubby-dispatcher) by 2002:a05:622a:214:b0:506:baf9:5dd9 with SMTP id d75a77b69052e-5074436ffbbmr207320081cf.17.1772475277666; Mon, 02 Mar 2026 10:14:37 -0800 (PST) Date: Mon, 2 Mar 2026 18:14:27 +0000 In-Reply-To: <20260302181432.1836150-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260302181432.1836150-1-edumazet@google.com> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog Message-ID: <20260302181432.1836150-3-edumazet@google.com> Subject: [PATCH v3 net-next 2/7] net-sysfs: remove rcu field from 'struct rps_sock_flow_table' From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , Kuniyuki Iwashima , netdev@vger.kernel.org, eric.dumazet@gmail.com, Eric Dumazet Content-Type: text/plain; charset="UTF-8" Removing rcu_head (and @mask in a following patch) will allow a power-of-two allocation and thus high-order allocation for better performance. Signed-off-by: Eric Dumazet --- include/net/rps.h | 1 - net/core/sysctl_net_core.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/net/rps.h b/include/net/rps.h index f1794cd2e7fb32a36bde9959fab651663ab190fd..32cfa250d9f931b8ab1c94e0410d0820bb9c999f 100644 --- a/include/net/rps.h +++ b/include/net/rps.h @@ -60,7 +60,6 @@ struct rps_dev_flow_table { * meaning we use 32-6=26 bits for the hash. */ struct rps_sock_flow_table { - struct rcu_head rcu; u32 mask; u32 ents[] ____cacheline_aligned_in_smp; diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 03aea10073f003b0339884ee0f40b8c96d7d22e2..0b659c932cffef45e05207890b8187d64ae3c85a 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c @@ -147,6 +147,7 @@ static int rps_sock_flow_sysctl(const struct ctl_table *table, int write, }; struct rps_sock_flow_table *orig_sock_table, *sock_table; static DEFINE_MUTEX(sock_flow_mutex); + void *tofree = NULL; mutex_lock(&sock_flow_mutex); @@ -193,13 +194,14 @@ static int rps_sock_flow_sysctl(const struct ctl_table *table, int write, if (orig_sock_table) { static_branch_dec(&rps_needed); static_branch_dec(&rfs_needed); - kvfree_rcu(orig_sock_table, rcu); + tofree = orig_sock_table; } } } mutex_unlock(&sock_flow_mutex); + kvfree_rcu_mightsleep(tofree); return ret; } #endif /* CONFIG_RPS */ -- 2.53.0.473.g4a7958ca14-goog