All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] um: time-travel: avoid multiple identical propagations
@ 2020-12-04 11:34 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2020-12-04 11:34 UTC (permalink / raw)
  To: linux-um; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

If there is some kind of interrupt negotation or such then
it may happen that we send an update message multiple times,
avoid that in the interest of efficiency by storing the last
transmitted value and only sending a new update if it's not
the same as the last update.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 arch/um/kernel/time.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index 5ac084deac7e..2c1c04f4ef27 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -198,7 +198,13 @@ static void time_travel_ext_update_request(unsigned long long time)
 
 void __time_travel_propagate_time(void)
 {
+	static unsigned long long last_propagated;
+
+	if (last_propagated == time_travel_time)
+		return;
+
 	time_travel_ext_req(UM_TIMETRAVEL_UPDATE, time_travel_time);
+	last_propagated = time_travel_time;
 }
 EXPORT_SYMBOL_GPL(__time_travel_propagate_time);
 
-- 
2.26.2


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-04 11:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 11:34 [PATCH] um: time-travel: avoid multiple identical propagations Johannes Berg

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.