All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fushuai Wang <fushuai.wang@linux.dev>
To: sshegde@linux.ibm.com, yury.norov@gmail.com
Cc: wangfushuai@baidu.com, linux-kernel@vger.kernel.org
Subject: [PATCH] virt/steal_governor: Remove redundant delay filed
Date: Wed, 18 Nov 2026 15:27:22 +0800	[thread overview]
Message-ID: <20261118072722.1052-1-fushuai.wang@linux.dev> (raw)

From: Fushuai Wang <wangfushuai@baidu.com>

The 'delay' member in struct steal_governor is just a cache for
msecs_to_jiffies(interval_ms). The duplicate state is confusing
and adds no value. Use msecs_to_jiffies() directly at the schedule
site and remove the 'delay' field.

Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
---
 drivers/virt/steal_governor.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/virt/steal_governor.c b/drivers/virt/steal_governor.c
index 6e31f9923dea..8af6c02c7e77 100644
--- a/drivers/virt/steal_governor.c
+++ b/drivers/virt/steal_governor.c
@@ -38,7 +38,6 @@
 struct steal_governor {
 	ktime_t			time;
 	u64			steal;
-	unsigned long		delay;
 	unsigned int		interval_ms;
 	unsigned int		high_threshold;
 	unsigned int		low_threshold;
@@ -252,7 +251,7 @@ static void steal_governor_loop(struct work_struct *work)
 	}
 
 requeue_work:
-	schedule_delayed_work(&sg_ctx.work, sg_ctx.delay);
+	schedule_delayed_work(&sg_ctx.work, msecs_to_jiffies(sg_ctx.interval_ms));
 }
 
 static int __init steal_governor_init(void)
@@ -270,11 +269,10 @@ static int __init steal_governor_init(void)
 		return -EINVAL;
 	}
 
-	sg_ctx.delay = msecs_to_jiffies(sg_ctx.interval_ms);
 	INIT_DELAYED_WORK(&sg_ctx.work, steal_governor_loop);
 	sg_ctx.steal = get_system_steal_time();
 	sg_ctx.time = ktime_get();
-	schedule_delayed_work(&sg_ctx.work, sg_ctx.delay);
+	schedule_delayed_work(&sg_ctx.work, msecs_to_jiffies(sg_ctx.interval_ms));
 	pr_info("enabled. interval: %ums, high_threshold: %u, low_threshold: %u\n",
 		sg_ctx.interval_ms, sg_ctx.high_threshold, sg_ctx.low_threshold);
 
-- 
2.36.1


             reply	other threads:[~2026-11-18  7:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  7:27 Fushuai Wang [this message]
2026-11-18  9:04 ` [PATCH] virt/steal_governor: Remove redundant delay filed Shrikanth Hegde
2026-11-18  9:16   ` fushuai.wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118072722.1052-1-fushuai.wang@linux.dev \
    --to=fushuai.wang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sshegde@linux.ibm.com \
    --cc=wangfushuai@baidu.com \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.