diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig.debug | 26 | ||||
| -rw-r--r-- | lib/debug_locks.c | 1 | ||||
| -rw-r--r-- | lib/hweight.c | 7 | ||||
| -rw-r--r-- | lib/idr.c | 8 | ||||
| -rw-r--r-- | lib/radix-tree.c | 24 |
5 files changed, 49 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 | ||
| 502 | config 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 | |||
| 502 | config LOCKDEP | 514 | config 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 | |||
| 784 | config 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 | |||
| 772 | config KPROBES_SANITY_TEST | 796 | config 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 | */ |
| 25 | int debug_locks = 1; | 25 | int debug_locks = 1; |
| 26 | EXPORT_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/hweight.c b/lib/hweight.c index 389424ecb129..63ee4eb1228d 100644 --- a/lib/hweight.c +++ b/lib/hweight.c | |||
| @@ -11,11 +11,18 @@ | |||
| 11 | 11 | ||
| 12 | unsigned int hweight32(unsigned int w) | 12 | unsigned int hweight32(unsigned int w) |
| 13 | { | 13 | { |
| 14 | #ifdef ARCH_HAS_FAST_MULTIPLIER | ||
| 15 | w -= (w >> 1) & 0x55555555; | ||
| 16 | w = (w & 0x33333333) + ((w >> 2) & 0x33333333); | ||
| 17 | w = (w + (w >> 4)) & 0x0f0f0f0f; | ||
| 18 | return (w * 0x01010101) >> 24; | ||
| 19 | #else | ||
| 14 | unsigned int res = w - ((w >> 1) & 0x55555555); | 20 | unsigned int res = w - ((w >> 1) & 0x55555555); |
| 15 | res = (res & 0x33333333) + ((res >> 2) & 0x33333333); | 21 | res = (res & 0x33333333) + ((res >> 2) & 0x33333333); |
| 16 | res = (res + (res >> 4)) & 0x0F0F0F0F; | 22 | res = (res + (res >> 4)) & 0x0F0F0F0F; |
| 17 | res = res + (res >> 8); | 23 | res = res + (res >> 8); |
| 18 | return (res + (res >> 16)) & 0x000000FF; | 24 | return (res + (res >> 16)) & 0x000000FF; |
| 25 | #endif | ||
| 19 | } | 26 | } |
| 20 | EXPORT_SYMBOL(hweight32); | 27 | EXPORT_SYMBOL(hweight32); |
| 21 | 28 | ||
| @@ -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 | ||
