aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug22
-rw-r--r--lib/idr.c14
-rw-r--r--lib/smp_processor_id.c2
3 files changed, 14 insertions, 24 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 883ecea22f37..4934eaa21e1e 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -608,6 +608,15 @@ config DEBUG_NOTIFIERS
608 This is a relatively cheap check but if you care about maximum 608 This is a relatively cheap check but if you care about maximum
609 performance, say N. 609 performance, say N.
610 610
611#
612# Select this config option from the architecture Kconfig, if it
613# it is preferred to always offer frame pointers as a config
614# option on the architecture (regardless of KERNEL_DEBUG):
615#
616config ARCH_WANT_FRAME_POINTERS
617 bool
618 help
619
611config FRAME_POINTER 620config FRAME_POINTER
612 bool "Compile the kernel with frame pointers" 621 bool "Compile the kernel with frame pointers"
613 depends on DEBUG_KERNEL && \ 622 depends on DEBUG_KERNEL && \
@@ -671,19 +680,6 @@ config RCU_TORTURE_TEST_RUNNABLE
671 680
672config RCU_CPU_STALL_DETECTOR 681config RCU_CPU_STALL_DETECTOR
673 bool "Check for stalled CPUs delaying RCU grace periods" 682 bool "Check for stalled CPUs delaying RCU grace periods"
674 depends on CLASSIC_RCU
675 default n
676 help
677 This option causes RCU to printk information on which
678 CPUs are delaying the current grace period, but only when
679 the grace period extends for excessive time periods.
680
681 Say Y if you want RCU to perform such checks.
682
683 Say N if you are unsure.
684
685config RCU_CPU_STALL_DETECTOR
686 bool "Check for stalled CPUs delaying RCU grace periods"
687 depends on CLASSIC_RCU || TREE_RCU 683 depends on CLASSIC_RCU || TREE_RCU
688 default n 684 default n
689 help 685 help
diff --git a/lib/idr.c b/lib/idr.c
index 1c4f9281f412..c11c5765cdef 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -121,7 +121,7 @@ int idr_pre_get(struct idr *idp, gfp_t gfp_mask)
121{ 121{
122 while (idp->id_free_cnt < IDR_FREE_MAX) { 122 while (idp->id_free_cnt < IDR_FREE_MAX) {
123 struct idr_layer *new; 123 struct idr_layer *new;
124 new = kmem_cache_alloc(idr_layer_cache, gfp_mask); 124 new = kmem_cache_zalloc(idr_layer_cache, gfp_mask);
125 if (new == NULL) 125 if (new == NULL)
126 return (0); 126 return (0);
127 move_to_free_list(idp, new); 127 move_to_free_list(idp, new);
@@ -292,7 +292,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id)
292 * and go back to the idr_pre_get() call. If the idr is full, it will 292 * and go back to the idr_pre_get() call. If the idr is full, it will
293 * return -ENOSPC. 293 * return -ENOSPC.
294 * 294 *
295 * @id returns a value in the range 0 ... 0x7fffffff 295 * @id returns a value in the range @starting_id ... 0x7fffffff
296 */ 296 */
297int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id) 297int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id)
298{ 298{
@@ -623,16 +623,10 @@ void *idr_replace(struct idr *idp, void *ptr, int id)
623} 623}
624EXPORT_SYMBOL(idr_replace); 624EXPORT_SYMBOL(idr_replace);
625 625
626static void idr_cache_ctor(void *idr_layer)
627{
628 memset(idr_layer, 0, sizeof(struct idr_layer));
629}
630
631void __init idr_init_cache(void) 626void __init idr_init_cache(void)
632{ 627{
633 idr_layer_cache = kmem_cache_create("idr_layer_cache", 628 idr_layer_cache = kmem_cache_create("idr_layer_cache",
634 sizeof(struct idr_layer), 0, SLAB_PANIC, 629 sizeof(struct idr_layer), 0, SLAB_PANIC, NULL);
635 idr_cache_ctor);
636} 630}
637 631
638/** 632/**
@@ -723,7 +717,7 @@ EXPORT_SYMBOL(ida_pre_get);
723 * and go back to the ida_pre_get() call. If the ida is full, it will 717 * and go back to the ida_pre_get() call. If the ida is full, it will
724 * return -ENOSPC. 718 * return -ENOSPC.
725 * 719 *
726 * @p_id returns a value in the range 0 ... 0x7fffffff. 720 * @p_id returns a value in the range @starting_id ... 0x7fffffff.
727 */ 721 */
728int ida_get_new_above(struct ida *ida, int starting_id, int *p_id) 722int ida_get_new_above(struct ida *ida, int starting_id, int *p_id)
729{ 723{
diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
index 0f8fc22ed103..4689cb073da4 100644
--- a/lib/smp_processor_id.c
+++ b/lib/smp_processor_id.c
@@ -22,7 +22,7 @@ notrace unsigned int debug_smp_processor_id(void)
22 * Kernel threads bound to a single CPU can safely use 22 * Kernel threads bound to a single CPU can safely use
23 * smp_processor_id(): 23 * smp_processor_id():
24 */ 24 */
25 if (cpus_equal(current->cpus_allowed, cpumask_of_cpu(this_cpu))) 25 if (cpumask_equal(&current->cpus_allowed, cpumask_of(this_cpu)))
26 goto out; 26 goto out;
27 27
28 /* 28 /*