From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C064A4D4897; Thu, 17 Sep 2026 16:50:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789663855; cv=none; b=NfqwB64PyG2TRKT3BoQNrafLH4wr1/Zw9JKQjvVS6qPdI4/R4cWK1hTT8pZfzvVxTowPnTx5e1RNTk1W2vkbTpA1Ysd/a5z9sMfOcxhAmhY6DTkY1qdCqCy5emZkNIS/KfDzqcV53ShgN9DOi0IqVbdzArUmNzqb2Tk202g7Fq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789663855; c=relaxed/simple; bh=ngOO+SlFaKTiwP3Y0/lAYDZzaE5QPpbsI9CZAn91u8Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MhFl1GtEauiGPsdqLMKocNVNmRW7NJLoe9umCSwhMvhU7QCZW5WzMg20qJ4XaVcXOrDR2awsFr+ZAVNfAxfKsoeLc2AjW+68l4hEgMc99nCPBK57bi52HbEQaXFTnsZ6mz33sedbCNy0SSDVwylEVfL4qVD/ROox+mUMLH6devo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=foqj8h6r; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="foqj8h6r" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18F091F000FF; Thu, 17 Sep 2026 16:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789663854; bh=ePAEcG8QR7QKeJpOVIzOfoB9DO3Uc4LqJ1Wx5eHdz8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=foqj8h6rK0Qg5eOMyC/9NhqVWiJfpt0wgsOSJV4qgaZpPNF3rjmAjGLvPuGRWbu4i jSEkeVqMD2BDw3Bq9UblvG7XFWISpV61hFmD9Q3kpNqdK6YL2Nd3Hayo2JxU7YReE/ 7zhwfppeAOVPk0BX2vltfojmPc0513SvTJi/fjbY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 0170/1250] net/sched: sch_drr: make cl->quantum lockless Date: Thu, 17 Sep 2026 15:59:25 +0100 Message-ID: <20260917151556.702822785@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151551.901433442@linuxfoundation.org> References: <20260917151551.901433442@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit a4d880b85089e12a5f2e8e2fee386310cec5b99a ] cl->quantum does not need to be protected by RTNL or qdisc spinlock. Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20260519094618.2632073-3-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sched/sch_drr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index 44686fd1c2749..faafb29056259 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -97,10 +97,8 @@ static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid, } } - sch_tree_lock(sch); if (tb[TCA_DRR_QUANTUM]) - cl->quantum = quantum; - sch_tree_unlock(sch); + WRITE_ONCE(cl->quantum, quantum); return 0; } @@ -251,7 +249,7 @@ static int drr_dump_class(struct Qdisc *sch, unsigned long arg, nest = nla_nest_start_noflag(skb, TCA_OPTIONS); if (nest == NULL) goto nla_put_failure; - if (nla_put_u32(skb, TCA_DRR_QUANTUM, cl->quantum)) + if (nla_put_u32(skb, TCA_DRR_QUANTUM, READ_ONCE(cl->quantum))) goto nla_put_failure; return nla_nest_end(skb, nest); @@ -362,7 +360,7 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch, if (!cl_is_active(cl)) { list_add_tail(&cl->alist, &q->active); - WRITE_ONCE(cl->deficit, cl->quantum); + WRITE_ONCE(cl->deficit, READ_ONCE(cl->quantum)); } sch->qstats.backlog += len; @@ -403,7 +401,7 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch) return skb; } - WRITE_ONCE(cl->deficit, cl->deficit + cl->quantum); + WRITE_ONCE(cl->deficit, cl->deficit + READ_ONCE(cl->quantum)); list_move_tail(&cl->alist, &q->active); } out: -- 2.53.0