aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/marker.c
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-07-25 04:48:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:45 -0400
commit28325df0d9339b7f3aba9c45174d4586223ef46b (patch)
treeca5fcbc3b2bd63ee94b2ce2fe80752ea2d9c884f /kernel/marker.c
parent24879a8e3e68f146d4d85528cc0b5dea712b77c5 (diff)
markers: use rcu_barrier_sched() and call_rcu_sched()
rcu_barrier_sched() and call_rcu_sched() were introduced in 2.6.26 for the Markers. Change the marker code to use them. It can be seen as a fix since the marker code was using an ugly, temporary, #ifdef hack to work around CONFIG_PREEMPT_RCU. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Acked-by: Paul McKenney <paulmck@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/marker.c')
-rw-r--r--kernel/marker.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/kernel/marker.c b/kernel/marker.c
index 1abfb923b761..971da5317903 100644
--- a/kernel/marker.c
+++ b/kernel/marker.c
@@ -441,7 +441,7 @@ static int remove_marker(const char *name)
441 hlist_del(&e->hlist); 441 hlist_del(&e->hlist);
442 /* Make sure the call_rcu has been executed */ 442 /* Make sure the call_rcu has been executed */
443 if (e->rcu_pending) 443 if (e->rcu_pending)
444 rcu_barrier(); 444 rcu_barrier_sched();
445 kfree(e); 445 kfree(e);
446 return 0; 446 return 0;
447} 447}
@@ -476,7 +476,7 @@ static int marker_set_format(struct marker_entry **entry, const char *format)
476 hlist_del(&(*entry)->hlist); 476 hlist_del(&(*entry)->hlist);
477 /* Make sure the call_rcu has been executed */ 477 /* Make sure the call_rcu has been executed */
478 if ((*entry)->rcu_pending) 478 if ((*entry)->rcu_pending)
479 rcu_barrier(); 479 rcu_barrier_sched();
480 kfree(*entry); 480 kfree(*entry);
481 *entry = e; 481 *entry = e;
482 trace_mark(core_marker_format, "name %s format %s", 482 trace_mark(core_marker_format, "name %s format %s",
@@ -655,7 +655,7 @@ int marker_probe_register(const char *name, const char *format,
655 * make sure it's executed now. 655 * make sure it's executed now.
656 */ 656 */
657 if (entry->rcu_pending) 657 if (entry->rcu_pending)
658 rcu_barrier(); 658 rcu_barrier_sched();
659 old = marker_entry_add_probe(entry, probe, probe_private); 659 old = marker_entry_add_probe(entry, probe, probe_private);
660 if (IS_ERR(old)) { 660 if (IS_ERR(old)) {
661 ret = PTR_ERR(old); 661 ret = PTR_ERR(old);
@@ -670,10 +670,7 @@ int marker_probe_register(const char *name, const char *format,
670 entry->rcu_pending = 1; 670 entry->rcu_pending = 1;
671 /* write rcu_pending before calling the RCU callback */ 671 /* write rcu_pending before calling the RCU callback */
672 smp_wmb(); 672 smp_wmb();
673#ifdef CONFIG_PREEMPT_RCU 673 call_rcu_sched(&entry->rcu, free_old_closure);
674 synchronize_sched(); /* Until we have the call_rcu_sched() */
675#endif
676 call_rcu(&entry->rcu, free_old_closure);
677end: 674end:
678 mutex_unlock(&markers_mutex); 675 mutex_unlock(&markers_mutex);
679 return ret; 676 return ret;
@@ -704,7 +701,7 @@ int marker_probe_unregister(const char *name,
704 if (!entry) 701 if (!entry)
705 goto end; 702 goto end;
706 if (entry->rcu_pending) 703 if (entry->rcu_pending)
707 rcu_barrier(); 704 rcu_barrier_sched();
708 old = marker_entry_remove_probe(entry, probe, probe_private); 705 old = marker_entry_remove_probe(entry, probe, probe_private);
709 mutex_unlock(&markers_mutex); 706 mutex_unlock(&markers_mutex);
710 marker_update_probes(); /* may update entry */ 707 marker_update_probes(); /* may update entry */
@@ -716,10 +713,7 @@ int marker_probe_unregister(const char *name,
716 entry->rcu_pending = 1; 713 entry->rcu_pending = 1;
717 /* write rcu_pending before calling the RCU callback */ 714 /* write rcu_pending before calling the RCU callback */
718 smp_wmb(); 715 smp_wmb();
719#ifdef CONFIG_PREEMPT_RCU 716 call_rcu_sched(&entry->rcu, free_old_closure);
720 synchronize_sched(); /* Until we have the call_rcu_sched() */
721#endif
722 call_rcu(&entry->rcu, free_old_closure);
723 remove_marker(name); /* Ignore busy error message */ 717 remove_marker(name); /* Ignore busy error message */
724 ret = 0; 718 ret = 0;
725end: 719end:
@@ -786,7 +780,7 @@ int marker_probe_unregister_private_data(marker_probe_func *probe,
786 goto end; 780 goto end;
787 } 781 }
788 if (entry->rcu_pending) 782 if (entry->rcu_pending)
789 rcu_barrier(); 783 rcu_barrier_sched();
790 old = marker_entry_remove_probe(entry, NULL, probe_private); 784 old = marker_entry_remove_probe(entry, NULL, probe_private);
791 mutex_unlock(&markers_mutex); 785 mutex_unlock(&markers_mutex);
792 marker_update_probes(); /* may update entry */ 786 marker_update_probes(); /* may update entry */
@@ -797,10 +791,7 @@ int marker_probe_unregister_private_data(marker_probe_func *probe,
797 entry->rcu_pending = 1; 791 entry->rcu_pending = 1;
798 /* write rcu_pending before calling the RCU callback */ 792 /* write rcu_pending before calling the RCU callback */
799 smp_wmb(); 793 smp_wmb();
800#ifdef CONFIG_PREEMPT_RCU 794 call_rcu_sched(&entry->rcu, free_old_closure);
801 synchronize_sched(); /* Until we have the call_rcu_sched() */
802#endif
803 call_rcu(&entry->rcu, free_old_closure);
804 remove_marker(entry->name); /* Ignore busy error message */ 795 remove_marker(entry->name); /* Ignore busy error message */
805end: 796end:
806 mutex_unlock(&markers_mutex); 797 mutex_unlock(&markers_mutex);