From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796053605; b=KWuGy9DjPyiL+S+vulH01a0OwyepAlYADgcQpLldU3mQ8ymFtS7oKaqBrbMvFY46T1QK bw/TFEfXVosiYxOze3ittlJzPozIYVJgA6xyoqiEqn6xR+4QG7OWmohRL8wzeL4OwJ8CF +sxqQxyvT5DQ1y+QZnm33gN3LiBK6yPaYB11V8b3IS3fOX4bSfjTmJqJ4fdce7efZQbzo 9CwdQHDmmCxOUOhQXnVkjeYE9tpGrGjgHN2x9sG8ms8EGGOWAnEfoWll7alJIZ1g8RblF d5C3UkMLlFsymuIOLZ8whVZPUwLQega+oxUoP8/Wj8D7P+KVHJ67GGDyO7aDZBV+VvQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796053605; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=ujYbMwnj0TXKoM7a8OnsnST5mkbXWpphlSNIo7JuIwM=; b=rBsYizsy6AbfWuywG+SficohU9+KGhkpy8kWEdyD/Sg1u0HXOzuJVnOGXYo0dXrwZnIQ MZk6eTWnN9Xoa/VNb8DxCDS22CAcCB0+nosQdu77RzPb8vT4F/t8wr6vAL+xz44dHsqJB YCmXEAWVXUTD/MihbBdaHdwzb8kEmZGZagsQQfsBM6YZ5UUgeCr42MD/Qh5QMHRzs/PDh 4CVwubj6lmMCHIBWTMos2MPYlGDJlbOn4mYs2QFC2Cuq3omfXIhHrmIZYeMhYjmfgr8uZ CYGOtLwbGKRXIXPWYJfx2lps2iiNWSOqmDZE56tplefUgYpJwgygdcJx9I9iLWD/rQg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QpqvNuoA; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBAE0606A692 for ; Mon, 30 Nov 2026 15:46:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QpqvNuoA Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF5831F00931; Mon, 30 Nov 2026 15:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796053605; bh=ujYbMwnj0TXKoM7a8OnsnST5mkbXWpphlSNIo7JuIwM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=QpqvNuoAM8fCI1XLPmnPZO9YlhU8SrEk4EJjQ5lqJS2YXVNGLocQNTN1k8h+XDSDB XQaBEeiUSPdWakpXnXNTi1ZF29YxIYpwGAd7XmRQQdqeI96GuJN9QbWpTPkp3qTdXC EOc+opbLM+MIqOeXSU9+p7WcjllqM0FAj5G5pfDbePMqQW4zKAemuAGI9KRbA1HIUZ 3IIAdzmf/h+1sPAr+E9EKRj5o8ACzg63qOCMrZAplo8CKIYIWzkSCRi0UrYNx0I5t6 tXLs1O7Iy04frxWJlFqFedwC7oBk9x93rrxg6FQYexXu/nc3QjbJZ7U5KjNYrzA0sw 0tEeaJz8ESvXw== Subject: Re: [PATCH net-next 2/4] net/sched: sch_cake: dither the flow quantum from a per-tin generator From: netdev-bot+sashiko@kernel.org To: julius@bairaktaris.de Cc: toke@toke.dk, netdev@vger.kernel.org, jhs@mojatatu.com, jiri@resnulli.us, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, victor@mojatatu.com Date: Mon, 30 Nov 2026 15:46:44 +0000 Message-ID: <179605360435.3146.7564718396376708562@kernel.org> In-Reply-To: <20261129151144.2194312-3-julius@bairaktaris.de> References: <20261129151144.2194312-3-julius@bairaktaris.de> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The commit message for "net/sched: sch_cake: dither the flow quantum from a per-tin generator" gives a performance motive but no… -- net/sched: sch_cake: dither the flow quantum from a per-tin generator This patch replaces the get_random_u16() dithering addend in cake_get_flow_quantum() with a value taken from a per-tin struct rnd_state. cake_init() seeds that state from get_random_u64() for each tin. > CAKE adds a random 16-bit value to every flow quantum it hands out, so > that the scaled quantum does not accumulate a rounding error. That is a > get_random_u16() for nearly every packet dequeued, while the dithering > needs no more than a uniform value. [Severity: Low] This isn't a bug, but are there any measurements behind the performance motivation here? The commit message has no cycle counts, pps figures or perf profile showing that get_random_u16() costs anything noticeable in cake_get_flow_quantum(). get_random_u16() already draws from a batched per-CPU buffer. The patch also adds a struct rnd_state to each struct cake_tin_data and moves this call from the system CSPRNG to prandom. Without numbers it is hard to tell what the change gains. Is "nearly every packet dequeued" accurate? In net/sched/sch_cake.c, cake_get_flow_quantum() has only two callers. In cake_dequeue() it runs only when the deficit is refilled: cake_dequeue() { ... if (flow->deficit <= 0) { ... WRITE_ONCE(flow->deficit, flow->deficit + cake_get_flow_quantum(b, flow, q->config->flow_mode)); ... } The second caller is cake_enqueue(), when a flow is activated as sparse. The commit message does not mention this one: cake_enqueue() { ... WRITE_ONCE(flow->deficit, cake_get_flow_quantum(b, flow, q->config->flow_mode)); ... } So the number of calls per dequeued packet is roughly pkt_len divided by the scaled quantum. cake_set_rate() clamps flow_quantum to 300..1514 bytes, and the quantum is then divided by host_load. Bulk MTU-sized or GSO traffic gets one or more calls per packet. Small packets such as ACKs get far fewer than one. Could the commit message describe the call frequency more precisely and include numbers that show the benefit? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129151144.2194312-1-julius%40bairaktaris.de