History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Two entries being added at the same time to the IFLA policy table, whilst parallel bug fixes to decnet routing dst handling overlapping with the dst gc removal in net-next.

David S. Miller committed 9 years ago

Commit 3d091982 parents 52f80dc 48b6bbe213 files · +2109 −1711Browse files

Showing the changes to kernel (8 of 213 files). Show all

Unified · Split

8 files
  1. kernel/irq/manage.c +3 −1
  2. kernel/livepatch/patch.c +6 −2
  3. kernel/livepatch/transition.c +31 −5
  4. kernel/sched/core.c +1 −1
  5. kernel/sched/fair.c +1 −1
  6. kernel/time/alarmtimer.c +11 −3
  7. kernel/time/tick-broadcast.c +3 −1
  8. kernel/time/tick-internal.h +0 −2
kernel/irq/manage.c+3−1
@@ -1312,8 +1312,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) · 1311 unmodified lines
1312 ret = __irq_set_trigger(desc,1312 ret = __irq_set_trigger(desc,
1313 new->flags & IRQF_TRIGGER_MASK);1313 new->flags & IRQF_TRIGGER_MASK);
1314 1314
1315 if (ret)1315 if (ret) {
1316 irq_release_resources(desc);
1316 goto out_mask;1317 goto out_mask;
1318 }
1317 }1319 }
1318 1320
1319 desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \1321 desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \
kernel/livepatch/patch.c+6−2
@@ -59,7 +59,11 @@ static void notrace klp_ftrace_handler(unsigned long ip, · 58 unmodified lines
59 59
60 ops = container_of(fops, struct klp_ops, fops);60 ops = container_of(fops, struct klp_ops, fops);
61 61
62 rcu_read_lock();62 /*
63 * A variant of synchronize_sched() is used to allow patching functions
64 * where RCU is not watching, see klp_synchronize_transition().
65 */
66 preempt_disable_notrace();
63 67
64 func = list_first_or_null_rcu(&ops->func_stack, struct klp_func,68 func = list_first_or_null_rcu(&ops->func_stack, struct klp_func,
65 stack_node);69 stack_node);
@@ -115,7 +119,7 @@ static void notrace klp_ftrace_handler(unsigned long ip, · 49 unmodified lines
115 119
116 klp_arch_set_pc(regs, (unsigned long)func->new_func);120 klp_arch_set_pc(regs, (unsigned long)func->new_func);
117unlock:121unlock:
118 rcu_read_unlock();122 preempt_enable_notrace();
119}123}
120 124
121/*125/*
kernel/livepatch/transition.c+31−5
@@ -48,6 +48,28 @@ static void klp_transition_work_fn(struct work_struct *work) · 47 unmodified lines
48}48}
49static DECLARE_DELAYED_WORK(klp_transition_work, klp_transition_work_fn);49static DECLARE_DELAYED_WORK(klp_transition_work, klp_transition_work_fn);
50 50
51/*
52 * This function is just a stub to implement a hard force
53 * of synchronize_sched(). This requires synchronizing
54 * tasks even in userspace and idle.
55 */
56static void klp_sync(struct work_struct *work)
57{
58}
59
60/*
61 * We allow to patch also functions where RCU is not watching,
62 * e.g. before user_exit(). We can not rely on the RCU infrastructure
63 * to do the synchronization. Instead hard force the sched synchronization.
64 *
65 * This approach allows to use RCU functions for manipulating func_stack
66 * safely.
67 */
68static void klp_synchronize_transition(void)
69{
70 schedule_on_each_cpu(klp_sync);
71}
72
51/*73/*
52 * The transition to the target patch state is complete. Clean up the data74 * The transition to the target patch state is complete. Clean up the data
53 * structures.75 * structures.
@@ -73,7 +95,7 @@ static void klp_complete_transition(void) · 19 unmodified lines
73 * func->transition gets cleared, the handler may choose a95 * func->transition gets cleared, the handler may choose a
74 * removed function.96 * removed function.
75 */97 */
76 synchronize_rcu();98 klp_synchronize_transition();
77 }99 }
78 100
79 if (klp_transition_patch->immediate)101 if (klp_transition_patch->immediate)
@@ -92,7 +114,7 @@ static void klp_complete_transition(void) · 12 unmodified lines
92 114
93 /* Prevent klp_ftrace_handler() from seeing KLP_UNDEFINED state */115 /* Prevent klp_ftrace_handler() from seeing KLP_UNDEFINED state */
94 if (klp_target_state == KLP_PATCHED)116 if (klp_target_state == KLP_PATCHED)
95 synchronize_rcu();117 klp_synchronize_transition();
96 118
97 read_lock(&tasklist_lock);119 read_lock(&tasklist_lock);
98 for_each_process_thread(g, task) {120 for_each_process_thread(g, task) {
@@ -136,7 +158,11 @@ void klp_cancel_transition(void) · 37 unmodified lines
136 */158 */
137void klp_update_patch_state(struct task_struct *task)159void klp_update_patch_state(struct task_struct *task)
138{160{
139 rcu_read_lock();161 /*
162 * A variant of synchronize_sched() is used to allow patching functions
163 * where RCU is not watching, see klp_synchronize_transition().
164 */
165 preempt_disable_notrace();
140 166
141 /*167 /*
142 * This test_and_clear_tsk_thread_flag() call also serves as a read168 * This test_and_clear_tsk_thread_flag() call also serves as a read
@@ -153,7 +179,7 @@ void klp_update_patch_state(struct task_struct *task) · 10 unmodified lines
153 if (test_and_clear_tsk_thread_flag(task, TIF_PATCH_PENDING))179 if (test_and_clear_tsk_thread_flag(task, TIF_PATCH_PENDING))
154 task->patch_state = READ_ONCE(klp_target_state);180 task->patch_state = READ_ONCE(klp_target_state);
155 181
156 rcu_read_unlock();182 preempt_enable_notrace();
157}183}
158 184
159/*185/*
@@ -539,7 +565,7 @@ void klp_reverse_transition(void) · 379 unmodified lines
539 clear_tsk_thread_flag(idle_task(cpu), TIF_PATCH_PENDING);565 clear_tsk_thread_flag(idle_task(cpu), TIF_PATCH_PENDING);
540 566
541 /* Let any remaining calls to klp_update_patch_state() complete */567 /* Let any remaining calls to klp_update_patch_state() complete */
542 synchronize_rcu();568 klp_synchronize_transition();
543 569
544 klp_start_transition();570 klp_start_transition();
545}571}
kernel/sched/core.c+1−1
@@ -5605,7 +5605,7 @@ void idle_task_exit(void) · 5604 unmodified lines
5605 BUG_ON(cpu_online(smp_processor_id()));5605 BUG_ON(cpu_online(smp_processor_id()));
5606 5606
5607 if (mm != &init_mm) {5607 if (mm != &init_mm) {
5608 switch_mm_irqs_off(mm, &init_mm, current);5608 switch_mm(mm, &init_mm, current);
5609 finish_arch_post_lock_switch();5609 finish_arch_post_lock_switch();
5610 }5610 }
5611 mmdrop(mm);5611 mmdrop(mm);
kernel/sched/fair.c+1−1
@@ -3563,7 +3563,7 @@ static inline void check_schedstat_required(void) · 3562 unmodified lines
3563 trace_sched_stat_runtime_enabled()) {3563 trace_sched_stat_runtime_enabled()) {
3564 printk_deferred_once("Scheduler tracepoints stat_sleep, stat_iowait, "3564 printk_deferred_once("Scheduler tracepoints stat_sleep, stat_iowait, "
3565 "stat_blocked and stat_runtime require the "3565 "stat_blocked and stat_runtime require the "
3566 "kernel parameter schedstats=enabled or "3566 "kernel parameter schedstats=enable or "
3567 "kernel.sched_schedstats=1\n");3567 "kernel.sched_schedstats=1\n");
3568 }3568 }
3569#endif3569#endif
kernel/time/alarmtimer.c+11−3
@@ -387,7 +387,7 @@ void alarm_start_relative(struct alarm *alarm, ktime_t start) · 386 unmodified lines
387{387{
388 struct alarm_base *base = &alarm_bases[alarm->type];388 struct alarm_base *base = &alarm_bases[alarm->type];
389 389
390 start = ktime_add(start, base->gettime());390 start = ktime_add_safe(start, base->gettime());
391 alarm_start(alarm, start);391 alarm_start(alarm, start);
392}392}
393EXPORT_SYMBOL_GPL(alarm_start_relative);393EXPORT_SYMBOL_GPL(alarm_start_relative);
@@ -475,7 +475,7 @@ u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval) · 81 unmodified lines
475 overrun++;475 overrun++;
476 }476 }
477 477
478 alarm->node.expires = ktime_add(alarm->node.expires, interval);478 alarm->node.expires = ktime_add_safe(alarm->node.expires, interval);
479 return overrun;479 return overrun;
480}480}
481EXPORT_SYMBOL_GPL(alarm_forward);481EXPORT_SYMBOL_GPL(alarm_forward);
@@ -660,13 +660,21 @@ static int alarm_timer_set(struct k_itimer *timr, int flags, · 178 unmodified lines
660 660
661 /* start the timer */661 /* start the timer */
662 timr->it.alarm.interval = timespec64_to_ktime(new_setting->it_interval);662 timr->it.alarm.interval = timespec64_to_ktime(new_setting->it_interval);
663
664 /*
665 * Rate limit to the tick as a hot fix to prevent DOS. Will be
666 * mopped up later.
667 */
668 if (timr->it.alarm.interval < TICK_NSEC)
669 timr->it.alarm.interval = TICK_NSEC;
670
663 exp = timespec64_to_ktime(new_setting->it_value);671 exp = timespec64_to_ktime(new_setting->it_value);
664 /* Convert (if necessary) to absolute time */672 /* Convert (if necessary) to absolute time */
665 if (flags != TIMER_ABSTIME) {673 if (flags != TIMER_ABSTIME) {
666 ktime_t now;674 ktime_t now;
667 675
668 now = alarm_bases[timr->it.alarm.alarmtimer.type].gettime();676 now = alarm_bases[timr->it.alarm.alarmtimer.type].gettime();
669 exp = ktime_add(now, exp);677 exp = ktime_add_safe(now, exp);
670 }678 }
671 679
672 alarm_start(&timr->it.alarm.alarmtimer, exp);680 alarm_start(&timr->it.alarm.alarmtimer, exp);
kernel/time/tick-broadcast.c+3−1
@@ -37,9 +37,11 @@ static int tick_broadcast_forced; · 36 unmodified lines
37static __cacheline_aligned_in_smp DEFINE_RAW_SPINLOCK(tick_broadcast_lock);37static __cacheline_aligned_in_smp DEFINE_RAW_SPINLOCK(tick_broadcast_lock);
38 38
39#ifdef CONFIG_TICK_ONESHOT39#ifdef CONFIG_TICK_ONESHOT
40static void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
40static void tick_broadcast_clear_oneshot(int cpu);41static void tick_broadcast_clear_oneshot(int cpu);
41static void tick_resume_broadcast_oneshot(struct clock_event_device *bc);42static void tick_resume_broadcast_oneshot(struct clock_event_device *bc);
42#else43#else
44static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { BUG(); }
43static inline void tick_broadcast_clear_oneshot(int cpu) { }45static inline void tick_broadcast_clear_oneshot(int cpu) { }
44static inline void tick_resume_broadcast_oneshot(struct clock_event_device *bc) { }46static inline void tick_resume_broadcast_oneshot(struct clock_event_device *bc) { }
45#endif47#endif
@@ -867,7 +869,7 @@ static void tick_broadcast_init_next_event(struct cpumask *mask, · 821 unmodified lines
867/**869/**
868 * tick_broadcast_setup_oneshot - setup the broadcast device870 * tick_broadcast_setup_oneshot - setup the broadcast device
869 */871 */
870void tick_broadcast_setup_oneshot(struct clock_event_device *bc)872static void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
871{873{
872 int cpu = smp_processor_id();874 int cpu = smp_processor_id();
873 875
kernel/time/tick-internal.h+0−2
@@ -126,7 +126,6 @@ static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } · 125 unmodified lines
126 126
127/* Functions related to oneshot broadcasting */127/* Functions related to oneshot broadcasting */
128#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT)128#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT)
129extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
130extern void tick_broadcast_switch_to_oneshot(void);129extern void tick_broadcast_switch_to_oneshot(void);
131extern void tick_shutdown_broadcast_oneshot(unsigned int cpu);130extern void tick_shutdown_broadcast_oneshot(unsigned int cpu);
132extern int tick_broadcast_oneshot_active(void);131extern int tick_broadcast_oneshot_active(void);
@@ -134,7 +133,6 @@ extern void tick_check_oneshot_broadcast_this_cpu(void); · 1 unmodified line
134bool tick_broadcast_oneshot_available(void);133bool tick_broadcast_oneshot_available(void);
135extern struct cpumask *tick_get_broadcast_oneshot_mask(void);134extern struct cpumask *tick_get_broadcast_oneshot_mask(void);
136#else /* !(BROADCAST && ONESHOT): */135#else /* !(BROADCAST && ONESHOT): */
137static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { BUG(); }
138static inline void tick_broadcast_switch_to_oneshot(void) { }136static inline void tick_broadcast_switch_to_oneshot(void) { }
139static inline void tick_shutdown_broadcast_oneshot(unsigned int cpu) { }137static inline void tick_shutdown_broadcast_oneshot(unsigned int cpu) { }
140static inline int tick_broadcast_oneshot_active(void) { return 0; }138static inline int tick_broadcast_oneshot_active(void) { return 0; }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t