The patch titled SRCU: report out-of-memory errors has been added to the -mm tree. Its filename is srcu-report-out-of-memory-errors.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: SRCU: report out-of-memory errors From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> Currently the init_srcu_struct() routine has no way to report out-of-memory errors. This patch (as761) makes it return -ENOMEM when the per-cpu data allocation fails. The patch also makes srcu_init_notifier_head() report a BUG if a notifier head can't be initialized. Perhaps it should return -ENOMEM instead, but in the most likely cases where this might occur I don't think any recovery is possible. Notifier chains generally are not created dynamically. Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/linux/srcu.h | 2 +- kernel/srcu.c | 5 +++-- kernel/sys.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff -puN include/linux/srcu.h~srcu-report-out-of-memory-errors include/linux/srcu.h --- a/include/linux/srcu.h~srcu-report-out-of-memory-errors +++ a/include/linux/srcu.h @@ -43,7 +43,7 @@ struct srcu_struct { #define srcu_barrier() #endif /* #else #ifndef CONFIG_PREEMPT */ -void init_srcu_struct(struct srcu_struct *sp); +int init_srcu_struct(struct srcu_struct *sp); void cleanup_srcu_struct(struct srcu_struct *sp); int srcu_read_lock(struct srcu_struct *sp); void srcu_read_unlock(struct srcu_struct *sp, int idx); diff -puN kernel/srcu.c~srcu-report-out-of-memory-errors kernel/srcu.c --- a/kernel/srcu.c~srcu-report-out-of-memory-errors +++ a/kernel/srcu.c @@ -42,11 +42,12 @@ * to any other function. Each srcu_struct represents a separate domain * of SRCU protection. */ -void init_srcu_struct(struct srcu_struct *sp) +int init_srcu_struct(struct srcu_struct *sp) { sp->completed = 0; - sp->per_cpu_ref = alloc_percpu(struct srcu_struct_array); mutex_init(&sp->mutex); + sp->per_cpu_ref = alloc_percpu(struct srcu_struct_array); + return (sp->per_cpu_ref ? 0 : -ENOMEM); } /* diff -puN kernel/sys.c~srcu-report-out-of-memory-errors kernel/sys.c --- a/kernel/sys.c~srcu-report-out-of-memory-errors +++ a/kernel/sys.c @@ -516,7 +516,7 @@ EXPORT_SYMBOL_GPL(srcu_notifier_call_cha void srcu_init_notifier_head(struct srcu_notifier_head *nh) { mutex_init(&nh->mutex); - init_srcu_struct(&nh->srcu); + BUG_ON(init_srcu_struct(&nh->srcu) < 0); nh->head = NULL; } _ Patches currently in -mm which might be from stern@xxxxxxxxxxxxxxxxxxx are e100-disable-interrupts-at-boot.patch usb-hub-driver-improve-use-of-ifdef-fix.patch properly-unregister-reboot-notifier-in-case-of-failure-in-ehci-hcd.patch uhci-dont-test-the-short-packet-detect-bit.patch block-layer-early-detection-of-medium-not-present.patch scsi-core-and-sd-early-detection-of-medium-not-present.patch sd-early-detection-of-medium-not-present.patch scsi-early-detection-of-medium-not-present-updated.patch add-srcu-based-notifier-chains.patch srcu-report-out-of-memory-errors.patch srcu-report-out-of-memory-errors-fixlet.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html