aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:56:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:56:58 -0500
commit2bcc673101268dc50e52b83226c5bbf38391e16d (patch)
tree0cdaf6affa8b05d436c2e8b80ff23e8c7f03a30a /net
parent670310dfbae0eefe7318ff6a61e29e67a7a7bbce (diff)
parentb24591e2fcf852ad7ad2ccf745c8220bf378d312 (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "Yet another big pile of changes: - More year 2038 work from Arnd slowly reaching the point where we need to think about the syscalls themself. - A new timer function which allows to conditionally (re)arm a timer only when it's either not running or the new expiry time is sooner than the armed expiry time. This allows to use a single timer for multiple timeout requirements w/o caring about the first expiry time at the call site. - A new NMI safe accessor to clock real time for the printk timestamp work. Can be used by tracing, perf as well if required. - A large number of timer setup conversions from Kees which got collected here because either maintainers requested so or they simply got ignored. As Kees pointed out already there are a few trivial merge conflicts and some redundant commits which was unavoidable due to the size of this conversion effort. - Avoid a redundant iteration in the timer wheel softirq processing. - Provide a mechanism to treat RTC implementations depending on their hardware properties, i.e. don't inflict the write at the 0.5 seconds boundary which originates from the PC CMOS RTC to all RTCs. No functional change as drivers need to be updated separately. - The usual small updates to core code clocksource drivers. Nothing really exciting" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (111 commits) timers: Add a function to start/reduce a timer pstore: Use ktime_get_real_fast_ns() instead of __getnstimeofday() timer: Prepare to change all DEFINE_TIMER() callbacks netfilter: ipvs: Convert timers to use timer_setup() scsi: qla2xxx: Convert timers to use timer_setup() block/aoe: discover_timer: Convert timers to use timer_setup() ide: Convert timers to use timer_setup() drbd: Convert timers to use timer_setup() mailbox: Convert timers to use timer_setup() crypto: Convert timers to use timer_setup() drivers/pcmcia: omap1: Fix error in automated timer conversion ARM: footbridge: Fix typo in timer conversion drivers/sgi-xp: Convert timers to use timer_setup() drivers/pcmcia: Convert timers to use timer_setup() drivers/memstick: Convert timers to use timer_setup() drivers/macintosh: Convert timers to use timer_setup() hwrng/xgene-rng: Convert timers to use timer_setup() auxdisplay: Convert timers to use timer_setup() sparc/led: Convert timers to use timer_setup() mips: ip22/32: Convert timers to use timer_setup() ...
Diffstat (limited to 'net')
-rw-r--r--net/atm/mpc.c2
-rw-r--r--net/decnet/dn_route.c2
-rw-r--r--net/ipv6/ip6_flowlabel.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_conn.c10
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c7
-rw-r--r--net/netfilter/ipvs/ip_vs_est.c6
-rw-r--r--net/netfilter/ipvs/ip_vs_lblc.c11
-rw-r--r--net/netfilter/ipvs/ip_vs_lblcr.c11
-rw-r--r--net/netrom/nr_loopback.c2
9 files changed, 27 insertions, 26 deletions
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 5677147209e8..63138c8c2269 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -121,7 +121,7 @@ static struct notifier_block mpoa_notifier = {
121 121
122struct mpoa_client *mpcs = NULL; /* FIXME */ 122struct mpoa_client *mpcs = NULL; /* FIXME */
123static struct atm_mpoa_qos *qos_head = NULL; 123static struct atm_mpoa_qos *qos_head = NULL;
124static DEFINE_TIMER(mpc_timer, NULL, 0, 0); 124static DEFINE_TIMER(mpc_timer, NULL);
125 125
126 126
127static struct mpoa_client *find_mpc_by_itfnum(int itf) 127static struct mpoa_client *find_mpc_by_itfnum(int itf)
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 0bd3afd01dd2..6538632fbd03 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -131,7 +131,7 @@ static struct dn_rt_hash_bucket *dn_rt_hash_table;
131static unsigned int dn_rt_hash_mask; 131static unsigned int dn_rt_hash_mask;
132 132
133static struct timer_list dn_route_timer; 133static struct timer_list dn_route_timer;
134static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush, 0, 0); 134static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush);
135int decnet_dst_gc_interval = 2; 135int decnet_dst_gc_interval = 2;
136 136
137static struct dst_ops dn_dst_ops = { 137static struct dst_ops dn_dst_ops = {
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 15535ee327c5..9f2e73c71768 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -47,7 +47,7 @@ static atomic_t fl_size = ATOMIC_INIT(0);
47static struct ip6_flowlabel __rcu *fl_ht[FL_HASH_MASK+1]; 47static struct ip6_flowlabel __rcu *fl_ht[FL_HASH_MASK+1];
48 48
49static void ip6_fl_gc(unsigned long dummy); 49static void ip6_fl_gc(unsigned long dummy);
50static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc, 0, 0); 50static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc);
51 51
52/* FL hash table lock: it protects only of GC */ 52/* FL hash table lock: it protects only of GC */
53 53
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 3d2ac71a83ec..3a43b3470331 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -104,7 +104,7 @@ static inline void ct_write_unlock_bh(unsigned int key)
104 spin_unlock_bh(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l); 104 spin_unlock_bh(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);
105} 105}
106 106
107static void ip_vs_conn_expire(unsigned long data); 107static void ip_vs_conn_expire(struct timer_list *t);
108 108
109/* 109/*
110 * Returns hash value for IPVS connection entry 110 * Returns hash value for IPVS connection entry
@@ -457,7 +457,7 @@ EXPORT_SYMBOL_GPL(ip_vs_conn_out_get_proto);
457static void __ip_vs_conn_put_notimer(struct ip_vs_conn *cp) 457static void __ip_vs_conn_put_notimer(struct ip_vs_conn *cp)
458{ 458{
459 __ip_vs_conn_put(cp); 459 __ip_vs_conn_put(cp);
460 ip_vs_conn_expire((unsigned long)cp); 460 ip_vs_conn_expire(&cp->timer);
461} 461}
462 462
463/* 463/*
@@ -817,9 +817,9 @@ static void ip_vs_conn_rcu_free(struct rcu_head *head)
817 kmem_cache_free(ip_vs_conn_cachep, cp); 817 kmem_cache_free(ip_vs_conn_cachep, cp);
818} 818}
819 819
820static void ip_vs_conn_expire(unsigned long data) 820static void ip_vs_conn_expire(struct timer_list *t)
821{ 821{
822 struct ip_vs_conn *cp = (struct ip_vs_conn *)data; 822 struct ip_vs_conn *cp = from_timer(cp, t, timer);
823 struct netns_ipvs *ipvs = cp->ipvs; 823 struct netns_ipvs *ipvs = cp->ipvs;
824 824
825 /* 825 /*
@@ -909,7 +909,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p, int dest_af,
909 } 909 }
910 910
911 INIT_HLIST_NODE(&cp->c_list); 911 INIT_HLIST_NODE(&cp->c_list);
912 setup_timer(&cp->timer, ip_vs_conn_expire, (unsigned long)cp); 912 timer_setup(&cp->timer, ip_vs_conn_expire, 0);
913 cp->ipvs = ipvs; 913 cp->ipvs = ipvs;
914 cp->af = p->af; 914 cp->af = p->af;
915 cp->daf = dest_af; 915 cp->daf = dest_af;
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 4f940d7eb2f7..b47e266c6eca 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1146,9 +1146,9 @@ ip_vs_del_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest)
1146 return 0; 1146 return 0;
1147} 1147}
1148 1148
1149static void ip_vs_dest_trash_expire(unsigned long data) 1149static void ip_vs_dest_trash_expire(struct timer_list *t)
1150{ 1150{
1151 struct netns_ipvs *ipvs = (struct netns_ipvs *)data; 1151 struct netns_ipvs *ipvs = from_timer(ipvs, t, dest_trash_timer);
1152 struct ip_vs_dest *dest, *next; 1152 struct ip_vs_dest *dest, *next;
1153 unsigned long now = jiffies; 1153 unsigned long now = jiffies;
1154 1154
@@ -4019,8 +4019,7 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)
4019 4019
4020 INIT_LIST_HEAD(&ipvs->dest_trash); 4020 INIT_LIST_HEAD(&ipvs->dest_trash);
4021 spin_lock_init(&ipvs->dest_trash_lock); 4021 spin_lock_init(&ipvs->dest_trash_lock);
4022 setup_timer(&ipvs->dest_trash_timer, ip_vs_dest_trash_expire, 4022 timer_setup(&ipvs->dest_trash_timer, ip_vs_dest_trash_expire, 0);
4023 (unsigned long) ipvs);
4024 atomic_set(&ipvs->ftpsvc_counter, 0); 4023 atomic_set(&ipvs->ftpsvc_counter, 0);
4025 atomic_set(&ipvs->nullsvc_counter, 0); 4024 atomic_set(&ipvs->nullsvc_counter, 0);
4026 atomic_set(&ipvs->conn_out_counter, 0); 4025 atomic_set(&ipvs->conn_out_counter, 0);
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c
index 457c6c193e13..489055091a9b 100644
--- a/net/netfilter/ipvs/ip_vs_est.c
+++ b/net/netfilter/ipvs/ip_vs_est.c
@@ -97,12 +97,12 @@ static void ip_vs_read_cpu_stats(struct ip_vs_kstats *sum,
97} 97}
98 98
99 99
100static void estimation_timer(unsigned long arg) 100static void estimation_timer(struct timer_list *t)
101{ 101{
102 struct ip_vs_estimator *e; 102 struct ip_vs_estimator *e;
103 struct ip_vs_stats *s; 103 struct ip_vs_stats *s;
104 u64 rate; 104 u64 rate;
105 struct netns_ipvs *ipvs = (struct netns_ipvs *)arg; 105 struct netns_ipvs *ipvs = from_timer(ipvs, t, est_timer);
106 106
107 spin_lock(&ipvs->est_lock); 107 spin_lock(&ipvs->est_lock);
108 list_for_each_entry(e, &ipvs->est_list, list) { 108 list_for_each_entry(e, &ipvs->est_list, list) {
@@ -192,7 +192,7 @@ int __net_init ip_vs_estimator_net_init(struct netns_ipvs *ipvs)
192{ 192{
193 INIT_LIST_HEAD(&ipvs->est_list); 193 INIT_LIST_HEAD(&ipvs->est_list);
194 spin_lock_init(&ipvs->est_lock); 194 spin_lock_init(&ipvs->est_lock);
195 setup_timer(&ipvs->est_timer, estimation_timer, (unsigned long)ipvs); 195 timer_setup(&ipvs->est_timer, estimation_timer, 0);
196 mod_timer(&ipvs->est_timer, jiffies + 2 * HZ); 196 mod_timer(&ipvs->est_timer, jiffies + 2 * HZ);
197 return 0; 197 return 0;
198} 198}
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index b6aa4a970c6e..d625179de485 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -106,6 +106,7 @@ struct ip_vs_lblc_table {
106 struct rcu_head rcu_head; 106 struct rcu_head rcu_head;
107 struct hlist_head bucket[IP_VS_LBLC_TAB_SIZE]; /* hash bucket */ 107 struct hlist_head bucket[IP_VS_LBLC_TAB_SIZE]; /* hash bucket */
108 struct timer_list periodic_timer; /* collect stale entries */ 108 struct timer_list periodic_timer; /* collect stale entries */
109 struct ip_vs_service *svc; /* pointer back to service */
109 atomic_t entries; /* number of entries */ 110 atomic_t entries; /* number of entries */
110 int max_size; /* maximum size of entries */ 111 int max_size; /* maximum size of entries */
111 int rover; /* rover for expire check */ 112 int rover; /* rover for expire check */
@@ -294,10 +295,10 @@ static inline void ip_vs_lblc_full_check(struct ip_vs_service *svc)
294 * of the table. 295 * of the table.
295 * The full expiration check is for this purpose now. 296 * The full expiration check is for this purpose now.
296 */ 297 */
297static void ip_vs_lblc_check_expire(unsigned long data) 298static void ip_vs_lblc_check_expire(struct timer_list *t)
298{ 299{
299 struct ip_vs_service *svc = (struct ip_vs_service *) data; 300 struct ip_vs_lblc_table *tbl = from_timer(tbl, t, periodic_timer);
300 struct ip_vs_lblc_table *tbl = svc->sched_data; 301 struct ip_vs_service *svc = tbl->svc;
301 unsigned long now = jiffies; 302 unsigned long now = jiffies;
302 int goal; 303 int goal;
303 int i, j; 304 int i, j;
@@ -369,12 +370,12 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc)
369 tbl->rover = 0; 370 tbl->rover = 0;
370 tbl->counter = 1; 371 tbl->counter = 1;
371 tbl->dead = 0; 372 tbl->dead = 0;
373 tbl->svc = svc;
372 374
373 /* 375 /*
374 * Hook periodic timer for garbage collection 376 * Hook periodic timer for garbage collection
375 */ 377 */
376 setup_timer(&tbl->periodic_timer, ip_vs_lblc_check_expire, 378 timer_setup(&tbl->periodic_timer, ip_vs_lblc_check_expire, 0);
377 (unsigned long)svc);
378 mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL); 379 mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL);
379 380
380 return 0; 381 return 0;
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index c13ff575f9f7..84c57b62a588 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -278,6 +278,7 @@ struct ip_vs_lblcr_table {
278 atomic_t entries; /* number of entries */ 278 atomic_t entries; /* number of entries */
279 int max_size; /* maximum size of entries */ 279 int max_size; /* maximum size of entries */
280 struct timer_list periodic_timer; /* collect stale entries */ 280 struct timer_list periodic_timer; /* collect stale entries */
281 struct ip_vs_service *svc; /* pointer back to service */
281 int rover; /* rover for expire check */ 282 int rover; /* rover for expire check */
282 int counter; /* counter for no expire */ 283 int counter; /* counter for no expire */
283 bool dead; 284 bool dead;
@@ -458,10 +459,10 @@ static inline void ip_vs_lblcr_full_check(struct ip_vs_service *svc)
458 * of the table. 459 * of the table.
459 * The full expiration check is for this purpose now. 460 * The full expiration check is for this purpose now.
460 */ 461 */
461static void ip_vs_lblcr_check_expire(unsigned long data) 462static void ip_vs_lblcr_check_expire(struct timer_list *t)
462{ 463{
463 struct ip_vs_service *svc = (struct ip_vs_service *) data; 464 struct ip_vs_lblcr_table *tbl = from_timer(tbl, t, periodic_timer);
464 struct ip_vs_lblcr_table *tbl = svc->sched_data; 465 struct ip_vs_service *svc = tbl->svc;
465 unsigned long now = jiffies; 466 unsigned long now = jiffies;
466 int goal; 467 int goal;
467 int i, j; 468 int i, j;
@@ -532,12 +533,12 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
532 tbl->rover = 0; 533 tbl->rover = 0;
533 tbl->counter = 1; 534 tbl->counter = 1;
534 tbl->dead = 0; 535 tbl->dead = 0;
536 tbl->svc = svc;
535 537
536 /* 538 /*
537 * Hook periodic timer for garbage collection 539 * Hook periodic timer for garbage collection
538 */ 540 */
539 setup_timer(&tbl->periodic_timer, ip_vs_lblcr_check_expire, 541 timer_setup(&tbl->periodic_timer, ip_vs_lblcr_check_expire, 0);
540 (unsigned long)svc);
541 mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL); 542 mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL);
542 543
543 return 0; 544 return 0;
diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c
index 94d4e922af53..989ae647825e 100644
--- a/net/netrom/nr_loopback.c
+++ b/net/netrom/nr_loopback.c
@@ -18,7 +18,7 @@
18static void nr_loopback_timer(unsigned long); 18static void nr_loopback_timer(unsigned long);
19 19
20static struct sk_buff_head loopback_queue; 20static struct sk_buff_head loopback_queue;
21static DEFINE_TIMER(loopback_timer, nr_loopback_timer, 0, 0); 21static DEFINE_TIMER(loopback_timer, nr_loopback_timer);
22 22
23void __init nr_loopback_init(void) 23void __init nr_loopback_init(void)
24{ 24{