aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-02-28 13:13:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-02-28 13:13:16 -0500
commit642c4c75a765d7a3244ab39c8e6fb09be21eca5b (patch)
treece0be9b476f362835d3a3d6e4fd32801cd15c9fe /lib
parentf91b22c35f6b0ae06ec5b67922eca1999c3b6e0a (diff)
parent71da81324c83ef65bb196c7f874ac1c6996d8287 (diff)
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (44 commits) rcu: Fix accelerated GPs for last non-dynticked CPU rcu: Make non-RCU_PROVE_LOCKING rcu_read_lock_sched_held() understand boot rcu: Fix accelerated grace periods for last non-dynticked CPU rcu: Export rcu_scheduler_active rcu: Make rcu_read_lock_sched_held() take boot time into account rcu: Make lockdep_rcu_dereference() message less alarmist sched, cgroups: Fix module export rcu: Add RCU_CPU_STALL_VERBOSE to dump detailed per-task information rcu: Fix rcutorture mod_timer argument to delay one jiffy rcu: Fix deadlock in TREE_PREEMPT_RCU CPU stall detection rcu: Convert to raw_spinlocks rcu: Stop overflowing signed integers rcu: Use canonical URL for Mathieu's dissertation rcu: Accelerate grace period if last non-dynticked CPU rcu: Fix citation of Mathieu's dissertation rcu: Documentation update for CONFIG_PROVE_RCU security: Apply lockdep-based checking to rcu_dereference() uses idr: Apply lockdep-based diagnostics to rcu_dereference() uses radix-tree: Disable RCU lockdep checking in radix tree vfs: Abstract rcu_dereference_check for files-fdtable use ...
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug26
-rw-r--r--lib/debug_locks.c1
-rw-r--r--lib/idr.c8
-rw-r--r--lib/radix-tree.c24
4 files changed, 42 insertions, 17 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index d62e3cdab357..5e3407d997b2 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -499,6 +499,18 @@ config PROVE_LOCKING
499 499
500 For more details, see Documentation/lockdep-design.txt. 500 For more details, see Documentation/lockdep-design.txt.
501 501
502config PROVE_RCU
503 bool "RCU debugging: prove RCU correctness"
504 depends on PROVE_LOCKING
505 default n
506 help
507 This feature enables lockdep extensions that check for correct
508 use of RCU APIs. This is currently under development. Say Y
509 if you want to debug RCU usage or help work on the PROVE_RCU
510 feature.
511
512 Say N if you are unsure.
513
502config LOCKDEP 514config LOCKDEP
503 bool 515 bool
504 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 516 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
@@ -765,10 +777,22 @@ config RCU_CPU_STALL_DETECTOR
765 CPUs are delaying the current grace period, but only when 777 CPUs are delaying the current grace period, but only when
766 the grace period extends for excessive time periods. 778 the grace period extends for excessive time periods.
767 779
768 Say Y if you want RCU to perform such checks. 780 Say N if you want to disable such checks.
781
782 Say Y if you are unsure.
783
784config RCU_CPU_STALL_VERBOSE
785 bool "Print additional per-task information for RCU_CPU_STALL_DETECTOR"
786 depends on RCU_CPU_STALL_DETECTOR && TREE_PREEMPT_RCU
787 default n
788 help
789 This option causes RCU to printk detailed per-task information
790 for any tasks that are stalling the current RCU grace period.
769 791
770 Say N if you are unsure. 792 Say N if you are unsure.
771 793
794 Say Y if you want to enable such checks.
795
772config KPROBES_SANITY_TEST 796config KPROBES_SANITY_TEST
773 bool "Kprobes sanity tests" 797 bool "Kprobes sanity tests"
774 depends on DEBUG_KERNEL 798 depends on DEBUG_KERNEL
diff --git a/lib/debug_locks.c b/lib/debug_locks.c
index bc3b11731b9c..5bf0020b9248 100644
--- a/lib/debug_locks.c
+++ b/lib/debug_locks.c
@@ -23,6 +23,7 @@
23 * shut up after that. 23 * shut up after that.
24 */ 24 */
25int debug_locks = 1; 25int debug_locks = 1;
26EXPORT_SYMBOL_GPL(debug_locks);
26 27
27/* 28/*
28 * The locking-testsuite uses <debug_locks_silent> to get a 29 * The locking-testsuite uses <debug_locks_silent> to get a
diff --git a/lib/idr.c b/lib/idr.c
index 0dc782216d4b..2eb1dca03681 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -504,7 +504,7 @@ void *idr_find(struct idr *idp, int id)
504 int n; 504 int n;
505 struct idr_layer *p; 505 struct idr_layer *p;
506 506
507 p = rcu_dereference(idp->top); 507 p = rcu_dereference_raw(idp->top);
508 if (!p) 508 if (!p)
509 return NULL; 509 return NULL;
510 n = (p->layer+1) * IDR_BITS; 510 n = (p->layer+1) * IDR_BITS;
@@ -519,7 +519,7 @@ void *idr_find(struct idr *idp, int id)
519 while (n > 0 && p) { 519 while (n > 0 && p) {
520 n -= IDR_BITS; 520 n -= IDR_BITS;
521 BUG_ON(n != p->layer*IDR_BITS); 521 BUG_ON(n != p->layer*IDR_BITS);
522 p = rcu_dereference(p->ary[(id >> n) & IDR_MASK]); 522 p = rcu_dereference_raw(p->ary[(id >> n) & IDR_MASK]);
523 } 523 }
524 return((void *)p); 524 return((void *)p);
525} 525}
@@ -552,7 +552,7 @@ int idr_for_each(struct idr *idp,
552 struct idr_layer **paa = &pa[0]; 552 struct idr_layer **paa = &pa[0];
553 553
554 n = idp->layers * IDR_BITS; 554 n = idp->layers * IDR_BITS;
555 p = rcu_dereference(idp->top); 555 p = rcu_dereference_raw(idp->top);
556 max = 1 << n; 556 max = 1 << n;
557 557
558 id = 0; 558 id = 0;
@@ -560,7 +560,7 @@ int idr_for_each(struct idr *idp,
560 while (n > 0 && p) { 560 while (n > 0 && p) {
561 n -= IDR_BITS; 561 n -= IDR_BITS;
562 *paa++ = p; 562 *paa++ = p;
563 p = rcu_dereference(p->ary[(id >> n) & IDR_MASK]); 563 p = rcu_dereference_raw(p->ary[(id >> n) & IDR_MASK]);
564 } 564 }
565 565
566 if (p) { 566 if (p) {
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 92cdd9936e3d..6b9670d6bbf9 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -364,7 +364,7 @@ static void *radix_tree_lookup_element(struct radix_tree_root *root,
364 unsigned int height, shift; 364 unsigned int height, shift;
365 struct radix_tree_node *node, **slot; 365 struct radix_tree_node *node, **slot;
366 366
367 node = rcu_dereference(root->rnode); 367 node = rcu_dereference_raw(root->rnode);
368 if (node == NULL) 368 if (node == NULL)
369 return NULL; 369 return NULL;
370 370
@@ -384,7 +384,7 @@ static void *radix_tree_lookup_element(struct radix_tree_root *root,
384 do { 384 do {
385 slot = (struct radix_tree_node **) 385 slot = (struct radix_tree_node **)
386 (node->slots + ((index>>shift) & RADIX_TREE_MAP_MASK)); 386 (node->slots + ((index>>shift) & RADIX_TREE_MAP_MASK));
387 node = rcu_dereference(*slot); 387 node = rcu_dereference_raw(*slot);
388 if (node == NULL) 388 if (node == NULL)
389 return NULL; 389 return NULL;
390 390
@@ -568,7 +568,7 @@ int radix_tree_tag_get(struct radix_tree_root *root,
568 if (!root_tag_get(root, tag)) 568 if (!root_tag_get(root, tag))
569 return 0; 569 return 0;
570 570
571 node = rcu_dereference(root->rnode); 571 node = rcu_dereference_raw(root->rnode);
572 if (node == NULL) 572 if (node == NULL)
573 return 0; 573 return 0;
574 574
@@ -602,7 +602,7 @@ int radix_tree_tag_get(struct radix_tree_root *root,
602 BUG_ON(ret && saw_unset_tag); 602 BUG_ON(ret && saw_unset_tag);
603 return !!ret; 603 return !!ret;
604 } 604 }
605 node = rcu_dereference(node->slots[offset]); 605 node = rcu_dereference_raw(node->slots[offset]);
606 shift -= RADIX_TREE_MAP_SHIFT; 606 shift -= RADIX_TREE_MAP_SHIFT;
607 height--; 607 height--;
608 } 608 }
@@ -711,7 +711,7 @@ __lookup(struct radix_tree_node *slot, void ***results, unsigned long index,
711 } 711 }
712 712
713 shift -= RADIX_TREE_MAP_SHIFT; 713 shift -= RADIX_TREE_MAP_SHIFT;
714 slot = rcu_dereference(slot->slots[i]); 714 slot = rcu_dereference_raw(slot->slots[i]);
715 if (slot == NULL) 715 if (slot == NULL)
716 goto out; 716 goto out;
717 } 717 }
@@ -758,7 +758,7 @@ radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
758 unsigned long cur_index = first_index; 758 unsigned long cur_index = first_index;
759 unsigned int ret; 759 unsigned int ret;
760 760
761 node = rcu_dereference(root->rnode); 761 node = rcu_dereference_raw(root->rnode);
762 if (!node) 762 if (!node)
763 return 0; 763 return 0;
764 764
@@ -787,7 +787,7 @@ radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
787 slot = *(((void ***)results)[ret + i]); 787 slot = *(((void ***)results)[ret + i]);
788 if (!slot) 788 if (!slot)
789 continue; 789 continue;
790 results[ret + nr_found] = rcu_dereference(slot); 790 results[ret + nr_found] = rcu_dereference_raw(slot);
791 nr_found++; 791 nr_found++;
792 } 792 }
793 ret += nr_found; 793 ret += nr_found;
@@ -826,7 +826,7 @@ radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results,
826 unsigned long cur_index = first_index; 826 unsigned long cur_index = first_index;
827 unsigned int ret; 827 unsigned int ret;
828 828
829 node = rcu_dereference(root->rnode); 829 node = rcu_dereference_raw(root->rnode);
830 if (!node) 830 if (!node)
831 return 0; 831 return 0;
832 832
@@ -915,7 +915,7 @@ __lookup_tag(struct radix_tree_node *slot, void ***results, unsigned long index,
915 } 915 }
916 } 916 }
917 shift -= RADIX_TREE_MAP_SHIFT; 917 shift -= RADIX_TREE_MAP_SHIFT;
918 slot = rcu_dereference(slot->slots[i]); 918 slot = rcu_dereference_raw(slot->slots[i]);
919 if (slot == NULL) 919 if (slot == NULL)
920 break; 920 break;
921 } 921 }
@@ -951,7 +951,7 @@ radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
951 if (!root_tag_get(root, tag)) 951 if (!root_tag_get(root, tag))
952 return 0; 952 return 0;
953 953
954 node = rcu_dereference(root->rnode); 954 node = rcu_dereference_raw(root->rnode);
955 if (!node) 955 if (!node)
956 return 0; 956 return 0;
957 957
@@ -980,7 +980,7 @@ radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
980 slot = *(((void ***)results)[ret + i]); 980 slot = *(((void ***)results)[ret + i]);
981 if (!slot) 981 if (!slot)
982 continue; 982 continue;
983 results[ret + nr_found] = rcu_dereference(slot); 983 results[ret + nr_found] = rcu_dereference_raw(slot);
984 nr_found++; 984 nr_found++;
985 } 985 }
986 ret += nr_found; 986 ret += nr_found;
@@ -1020,7 +1020,7 @@ radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results,
1020 if (!root_tag_get(root, tag)) 1020 if (!root_tag_get(root, tag))
1021 return 0; 1021 return 0;
1022 1022
1023 node = rcu_dereference(root->rnode); 1023 node = rcu_dereference_raw(root->rnode);
1024 if (!node) 1024 if (!node)
1025 return 0; 1025 return 0;
1026 1026