🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10725

Re: [PATCH net v2 2/2] net/sched: taprio: do not replay missed entries in advance_sched()

#10725
From: Vinicius Costa Gomes
Date: Wed, 04 Nov 2026 00:56
73 lines
11433 bytes
Hi,

Krystian Kaniewski <krystianmkaniewski@gmail.com> writes:

> On 10/14/26 22:51, Vinicius Costa Gomes wrote:
>>>>> +	struct sched_entry *entry, *found = NULL;
>>>>> +	ktime_t cycle_start = sched->start_time;
>>>>> +	s64 offset, entry_end = 0, elapsed = 0;
>>>>> +
>>>>> +	if (ktime_after(now, cycle_start)) {
>>>>> +		s64 periods = div64_s64(ktime_sub(now, cycle_start),
>>>>> +					sched->period);
>>>>> +
>>>>> +		cycle_start = ktime_add_ns(cycle_start,
>>>>> +					   periods * sched->period);
>>>>> +	}
>>>>> +	offset = ktime_sub(now, cycle_start);
>>>>> +
>>>>> +	/* The offset is less than one period, so an entry which ends after
>>>>> +	 * @now is found at the latest at the entry which reaches the end of
>>>>> +	 * the cycle, or at the last entry. A schedule has at least one entry,
>>>>> +	 * so the loop always sets found.
>>>>> +	 */
>>>>> +	list_for_each_entry(entry, &sched->entries, list) {
>>>>> +		entry_end = min_t(s64, elapsed + entry->interval,
>>>>> +				  sched->cycle_time);
>>>>> +		if (offset < entry_end ||
>>>>> +		    list_is_last(&entry->list, &sched->entries)) {
>>>>> +			found = entry;
>>>>> +			break;
>>>>> +		}
>>>>> +		elapsed = entry_end;
>>>>> +	}
>>>>> +
>>>>> +	*start = ktime_add_ns(cycle_start, elapsed);
>>>>> +	*end = ktime_add_ns(cycle_start, entry_end);
>>>>> +	sched->cycle_end_time = ktime_add_ns(cycle_start,
>>>>> sched->cycle_time);
>>>>
>>>> Having this side effect here was unexpected. I think this would make
>>>> more sense outside this function.
>>>>
>>>
>>> Agreed. I can make taprio_entry_at() return the cycle end through an
>>> extra output argument and have advance_sched() store it explicitly in
>>> oper->cycle_end_time. The helper could then take the schedule as const.
>>>
>>> I can wait for the rest of your review of this patch before sending v3
>>>
>> 
>> I am going to try and review this by end of this week.
>> 
>> 
>> Cheers,
>
> Hi Vinicius,
>
> Just a gentle ping on patch 2/2. Did you have a chance to continue the
> review?


Sorry for the delay, just another minor/optional nitpick. The series
look good, run a couple of tests on a VM. For the series:

Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>


> -- 
> Krystian Kaniewski

-- 
Vinicius
Technical Details
Message-ID: <87bj85wh0n.fsf@intel.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356105-linux-kernel-netdev=dewy.ru
References: <20261009123309.284193-1-krystianmkaniewski@gmail.com> <20261009123309.284193-3-krystianmkaniewski@gmail.com> <87ik36lee9.fsf@intel.com> <ab4a8b2c-0274-4423-8d10-04e7efb6c120@gmail.com> <874ieoj990.fsf@intel.com> <ff74c290-3093-49ec-85ce-0e2385419366@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356105-linux-kernel-netdev=dewy.ru
From: vinicius.gomes@intel.com (Vinicius Costa Gomes)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 2/2] net/sched: taprio: do not replay missed
 entries in advance_sched()
Date: Tue, 03 Nov 2026 16:56:56 -0800
Organization: Usenet Network
Message-ID: <87bj85wh0n.fsf@intel.com>
References: <20261009123309.284193-1-krystianmkaniewski@gmail.com>
 <20261009123309.284193-3-krystianmkaniewski@gmail.com>
 <87ik36lee9.fsf@intel.com>
 <ab4a8b2c-0274-4423-8d10-04e7efb6c120@gmail.com>
 <874ieoj990.fsf@intel.com>
 <ff74c290-3093-49ec-85ce-0e2385419366@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: usenet.network;
	logging-data="3296821"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:9FjqryMhFEOtc+3X0dgaHk5mmkE= sha256:NAsS7mvcfO7+xLswpji9ZvO1iFxJ5AnCPS+suGAxiCk=
	sha1:V6TBDixB4z29hkDzmimOUAOIJJw= sha256:w5oPryk57LbpGUPZ1ZKcMC3OjZkOa8aG7FKhVlmWYtU=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 52443112A92; Wed,  4 Nov 2026 03:57:43 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.052
X-Spam-Status: No, score=-3.052 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=intel.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id wuYI-nEeeShC;
	Wed,  4 Nov 2026 03:57:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-356105-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=intel.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id E4504112A86; Wed,  4 Nov 2026 03:57:26 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 467452ACFF; Wed,  4 Nov 2026 00:57:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793753830;
	b=RzOaYkaYG55XKP5zP9rOJ3BbUlDA41XKEAXjrpRQuH4WNbRFwmsV9w9W3dS6mNOQk6vg
	 i4tXgynByoa+nkBOuMF4rEEONGm+h249ka6o2JGNEJvn7CXTgXlGO9y+COc+gjfAy7tPV
	 w8JBpkyfVsZBzoHRurTAXADo/tHgxk1MxEtpw8LC7weCjkbkm4wUsXBAnW1SJhTtQh8Nq
	 ieVB4wkKqvmpNoDpqBcwnSfZBNTSl94PZn8TWlIHjW8jtHc2wOmB8Ebf8kzu92jRbC0Hk
	 lC0v2LEo5oHQruSLLmJH22bRQjl23oclRE2lNbHbpuUptW0660H2gn/14dUB2NWHUCA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793753830;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:
	 X-CSE-ConnectionGUID:X-CSE-MsgGUID:X-IronPort-AV:X-IronPort-AV:
	 Received:X-CSE-ConnectionGUID:X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:
	 Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type;
	bh=P/DiIq4E5hY6ERPqc4p6/eiApm3YQ3DYXnC0jmxG1dU=;
	b=rXxwT31CMT0qk7OoTAkNBAnqqAbblJ+zYc4XRu1fi4xSuYhmFnLuGMQFR3PDXKUW5XMi
	 +pLQ2HzneMwKjivlhoFaCoXzgVsXbbZ3zH6kRxs/l9dpRxv/UWxwC03Bp9pl1CmZrc7k3
	 R9R49Oc+84/gnbDmbG6LTviqx5Lf5ZSUYWXdYjaZ2Nx6gNAYTJ4aIsVYcVruBWSsugAN0
	 s6ifbE57WCtxOI18AAt189d50sl+9Bf4T7hIduwX2Vev99NsDFb/+NZSOXuPEiFixsgI/
	 M4gMCYNHS91etjoQMIBPLOIBLGkOCL2+U10ou1AyazS2DsW6fNaxLibEwdZjoTukHDg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Q7UWjUF8;
	dmarc=pass header.from=intel.com;
	spf=pass smtp.mailfrom=intel.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 08C2A606A328;
	Wed,  4 Nov 2026 00:57:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Q7UWjUF8
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.13
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793753819;
	b=TySaZDW80GDbsONBW7CgZ7RFH4+/ONERBUoixcH2CLk37IeVe/t+33UlMJ+3OPLZ4txQ
	 11znCS9aw9oZybvvCkv9qhS9E8Mj5ZA1Ben3l73ch/DV9fQKpyt5IxOgPcvKYYKj0R6iT
	 1hvvmUecdwvux7d8lg2e7BvqBe2Jcvb8BkPvwMdS00H079N97FFhYbcxFjyz5Snp5uJ61
	 s08ssEcH0+dFMyqjemVpYADpe32EFAu6qzorRiWdPayoXG6/sYTUwXc2CoHXFsvzoYA4y
	 BImHVgUC88WmW9Yzrdf+FiW2gD4kuYdYy8+6iFUkKnAPF3Ey5Mm9lGr/hmaf502SFfA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793753819;
	h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID:
	 X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID:
	 X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject:
	 In-Reply-To:References:Date:Message-ID:MIME-Version:Content-Type;
	bh=P/DiIq4E5hY6ERPqc4p6/eiApm3YQ3DYXnC0jmxG1dU=;
	b=f5FrK8eHZnCc+0QymE3rA5OeUljNyV3U2gdbWnbsevP+7KW3diE22WuzczeYk+wRq6uW
	 SvMh0ifvS58O71l+D2xLMP3B+oI/SsEg2rCctX7bI5K2b2R2k30ScEfPZfNBIbUcMY6Sz
	 W2afldqhhC/rpYdURiV5WZq+7vpig0NrxZwbu9ao6vZishF+Ld6xsIxn+E4vBXhFlEQTE
	 h7wBo9EnvbdD/aAtCce+YvKsdGn3UeWJ6Gmr5JsBIAiYH/4jz3+jvurEHNpXamLZmkxo3
	 hTVUyELoVujAv1+J4G7C7QaeLH9cVScya1Yvi2rdw8djOMAQXASAqengR5KjPXd6yAg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=intel.com;
	spf=pass smtp.mailfrom=intel.com;
	dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Q7UWjUF8;
	arc=none smtp.remote-ip=198.175.65.13
X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AF29606A31B;
	Wed,  4 Nov 2026 00:56:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8AF29606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1793753818; x=1825289818;
  h=from:to:cc:subject:in-reply-to:references:date:
   message-id:mime-version;
  bh=zWlPRyG3WzBsJRCZoWEQHc1bfqsPLkX/J47KhKkthKk=;
  b=Q7UWjUF8T7hiTc/KdLcMniZpkMTxnzcBxR2vJ2KhGyOqwqW+meHas6iu
   GSau5terINzgUayeUGTOjn59nny89d7g/hWTTxKtCQexAHedN4KF/JcQu
   KSbcbDwbbPp/3IvfK95xiCZlXUFiup+rKRffPwW+2JTjfPKoUS+EpNPCr
   0CWS3B8MG8XoNeWPnCEKrmGO8teTtN8QndMylYfF+XRX7cEZiqoEULJeD
   MlwkRxtYomhxok2AdTUHegYNKGeZ7MZ1rEc+mb35H6gd6+ZprGfGM1tyY
   FVuQ8q0JKk8iM8cPRp0s0jrrysyvQqqPSgON9zbr31cOcMI6oXnRxKIM3
   w==;
X-CSE-ConnectionGUID: XMIkeFLsTlCXUULAgYI5ew==
X-CSE-MsgGUID: iB1RpQfpSwWAQgCYrey3oQ==
X-IronPort-AV: E=McAfee;i="6800,10657,11955"; a="2379382"
X-IronPort-AV: E=Sophos;i="6.27,194,1787036400"; 
   d="scan'208";a="2379382"
X-Received: from orviesa003.jf.intel.com ([10.64.159.143])
  by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2026 16:56:58 -0800
X-CSE-ConnectionGUID: qWZs14qiRYy3+UXwlORXAA==
X-CSE-MsgGUID: /4RAmKWSQOO8U0XPepJM+g==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.27,194,1787036400"; 
   d="scan'208";a="6449379"
X-Received: from vcostago-desk.jf.intel.com (HELO vcostago-desk) ([10.98.24.84])
  by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2026 16:56:57 -0800
X-Cc: Simon Horman <horms@kernel.org>, Vladimir Oltean
 <vladimir.oltean@nxp.com>, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org,
 syzbot+e044a9b6370ed8ca9737@syzkaller.appspotmail.com
X-In-Reply-To: <ff74c290-3093-49ec-85ce-0e2385419366@gmail.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list