lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 7 Jul 2016 01:46:16 -0700
From:	tip-bot for Thomas Gleixner <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	john.stultz@...aro.org, dbaryshkov@...il.com, edumazet@...gle.com,
	tglx@...utronix.de, linux@...encehorizons.net,
	mathias.nyman@...el.com, josh@...htriplett.org, riel@...hat.com,
	linux-kernel@...r.kernel.org, fweisbec@...il.com,
	jh80.chung@...sung.com, axboe@...nel.dk, peterz@...radead.org,
	lenb@...nel.org, afd@...com, torvalds@...ux-foundation.org,
	sre@...nel.org, gregkh@...uxfoundation.org, ulf.hansson@...aro.org,
	arjan@...radead.org, davem@...emloft.net,
	paulmck@...ux.vnet.ibm.com, pali.rohar@...il.com, hpa@...or.com,
	dwmw2@...radead.org, mingo@...nel.org, clm@...com,
	stern@...land.harvard.edu
Subject: [tip:timers/core] timers: Remove set_timer_slack() leftovers

Commit-ID:  53bf837b78d155b8e1110b3c25b4d0d6391b8ff3
Gitweb:     http://git.kernel.org/tip/53bf837b78d155b8e1110b3c25b4d0d6391b8ff3
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Mon, 4 Jul 2016 09:50:31 +0000
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 7 Jul 2016 10:35:09 +0200

timers: Remove set_timer_slack() leftovers

We now have implicit batching in the timer wheel. The slack API is no longer
used, so remove it.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Alan Stern <stern@...land.harvard.edu>
Cc: Andrew F. Davis <afd@...com>
Cc: Arjan van de Ven <arjan@...radead.org>
Cc: Chris Mason <clm@...com>
Cc: David S. Miller <davem@...emloft.net>
Cc: David Woodhouse <dwmw2@...radead.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@...il.com>
Cc: Eric Dumazet <edumazet@...gle.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: George Spelvin <linux@...encehorizons.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jaehoon Chung <jh80.chung@...sung.com>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Josh Triplett <josh@...htriplett.org>
Cc: Len Brown <lenb@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mathias Nyman <mathias.nyman@...el.com>
Cc: Pali Rohár <pali.rohar@...il.com>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rik van Riel <riel@...hat.com>
Cc: Sebastian Reichel <sre@...nel.org>
Cc: Ulf Hansson <ulf.hansson@...aro.org>
Cc: linux-block@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: linux-mmc@...r.kernel.org
Cc: linux-pm@...r.kernel.org
Cc: linux-usb@...r.kernel.org
Cc: netdev@...r.kernel.org
Cc: rt@...utronix.de
Link: http://lkml.kernel.org/r/20160704094342.189813118@linutronix.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 block/genhd.c                   |  5 -----
 drivers/mmc/host/jz4740_mmc.c   |  2 --
 drivers/power/bq27xxx_battery.c |  5 +----
 drivers/usb/host/ohci-hcd.c     |  1 -
 drivers/usb/host/xhci.c         |  2 --
 include/linux/timer.h           |  4 ----
 kernel/time/timer.c             | 19 -------------------
 lib/random32.c                  |  1 -
 8 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index 9f42526..f06d7f3 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1523,12 +1523,7 @@ static void __disk_unblock_events(struct gendisk *disk, bool check_now)
 	if (--ev->block)
 		goto out_unlock;
 
-	/*
-	 * Not exactly a latency critical operation, set poll timer
-	 * slack to 25% and kick event check.
-	 */
 	intv = disk_events_poll_jiffies(disk);
-	set_timer_slack(&ev->dwork.timer, intv / 4);
 	if (check_now)
 		queue_delayed_work(system_freezable_power_efficient_wq,
 				&ev->dwork, 0);
diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
index 03ddf0e..684087d 100644
--- a/drivers/mmc/host/jz4740_mmc.c
+++ b/drivers/mmc/host/jz4740_mmc.c
@@ -1068,8 +1068,6 @@ static int jz4740_mmc_probe(struct platform_device* pdev)
 	jz4740_mmc_clock_disable(host);
 	setup_timer(&host->timeout_timer, jz4740_mmc_timeout,
 			(unsigned long)host);
-	/* It is not important when it times out, it just needs to timeout. */
-	set_timer_slack(&host->timeout_timer, HZ);
 
 	host->use_dma = true;
 	if (host->use_dma && jz4740_mmc_acquire_dma_channels(host) != 0)
diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c
index 45f6ebf..e90b3f3 100644
--- a/drivers/power/bq27xxx_battery.c
+++ b/drivers/power/bq27xxx_battery.c
@@ -735,11 +735,8 @@ static void bq27xxx_battery_poll(struct work_struct *work)
 
 	bq27xxx_battery_update(di);
 
-	if (poll_interval > 0) {
-		/* The timer does not have to be accurate. */
-		set_timer_slack(&di->work.timer, poll_interval * HZ / 4);
+	if (poll_interval > 0)
 		schedule_delayed_work(&di->work, poll_interval * HZ);
-	}
 }
 
 /*
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 0449235..1700908 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -500,7 +500,6 @@ static int ohci_init (struct ohci_hcd *ohci)
 
 	setup_timer(&ohci->io_watchdog, io_watchdog_func,
 			(unsigned long) ohci);
-	set_timer_slack(&ohci->io_watchdog, msecs_to_jiffies(20));
 
 	ohci->hcca = dma_alloc_coherent (hcd->self.controller,
 			sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index f2f9518..a986fe7 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -490,8 +490,6 @@ static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci)
 	xhci->comp_mode_recovery_timer.expires = jiffies +
 			msecs_to_jiffies(COMP_MODE_RCVRY_MSECS);
 
-	set_timer_slack(&xhci->comp_mode_recovery_timer,
-			msecs_to_jiffies(COMP_MODE_RCVRY_MSECS));
 	add_timer(&xhci->comp_mode_recovery_timer);
 	xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
 			"Compliance mode recovery timer initialized");
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 5869ab9..4419506 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -19,7 +19,6 @@ struct timer_list {
 	void			(*function)(unsigned long);
 	unsigned long		data;
 	u32			flags;
-	int			slack;
 
 #ifdef CONFIG_TIMER_STATS
 	int			start_pid;
@@ -73,7 +72,6 @@ struct timer_list {
 		.expires = (_expires),				\
 		.data = (_data),				\
 		.flags = (_flags),				\
-		.slack = -1,					\
 		__TIMER_LOCKDEP_MAP_INITIALIZER(		\
 			__FILE__ ":" __stringify(__LINE__))	\
 	}
@@ -193,8 +191,6 @@ extern int del_timer(struct timer_list * timer);
 extern int mod_timer(struct timer_list *timer, unsigned long expires);
 extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
 
-extern void set_timer_slack(struct timer_list *time, int slack_hz);
-
 /*
  * The jiffies value which is added to now, when there is no timer
  * in the timer wheel:
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 86e95b7..a83e23d 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -447,24 +447,6 @@ unsigned long round_jiffies_up_relative(unsigned long j)
 }
 EXPORT_SYMBOL_GPL(round_jiffies_up_relative);
 
-/**
- * set_timer_slack - set the allowed slack for a timer
- * @timer: the timer to be modified
- * @slack_hz: the amount of time (in jiffies) allowed for rounding
- *
- * Set the amount of time, in jiffies, that a certain timer has
- * in terms of slack. By setting this value, the timer subsystem
- * will schedule the actual timer somewhere between
- * the time mod_timer() asks for, and that time plus the slack.
- *
- * By setting the slack to -1, a percentage of the delay is used
- * instead.
- */
-void set_timer_slack(struct timer_list *timer, int slack_hz)
-{
-	timer->slack = slack_hz;
-}
-EXPORT_SYMBOL_GPL(set_timer_slack);
 
 static inline unsigned int timer_get_idx(struct timer_list *timer)
 {
@@ -775,7 +757,6 @@ static void do_init_timer(struct timer_list *timer, unsigned int flags,
 {
 	timer->entry.pprev = NULL;
 	timer->flags = flags | raw_smp_processor_id();
-	timer->slack = -1;
 #ifdef CONFIG_TIMER_STATS
 	timer->start_site = NULL;
 	timer->start_pid = -1;
diff --git a/lib/random32.c b/lib/random32.c
index 510d1ce..69ed593 100644
--- a/lib/random32.c
+++ b/lib/random32.c
@@ -233,7 +233,6 @@ static void __prandom_timer(unsigned long dontcare)
 
 static void __init __prandom_start_seed_timer(void)
 {
-	set_timer_slack(&seed_timer, HZ);
 	seed_timer.expires = jiffies + msecs_to_jiffies(40 * MSEC_PER_SEC);
 	add_timer(&seed_timer);
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ