RCU updates for v2.6.36
Subsystems (9)
Linus,
Please pull the latest core-rcu-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core-rcu-for-linus
Thanks,
Ingo
------------------>
Mathieu Desnoyers (1):
tree/tiny rcu: Add debug RCU head objects
Paul E. McKenney (10):
powerpc: remove all rcu head initializations
fs: remove all rcu head initializations, except on_stack initializations
mm: remove all rcu head initializations
rcu: add an rcu_dereference_index_check()
rcu: add __rcu API for later sparse checking
lockdep: Add an in_workqueue_context() lockdep-based test function
vfs: add fs.h to define struct file
net: Make accesses to ->br_port safe for sparse RCU
mce: convert to rcu_dereference_index_check()
Revert "net: Make accesses to ->br_port safe for sparse RCU"
arch/powerpc/mm/pgtable.c | 1 - arch/x86/kernel/cpu/mcheck/mce.c | 2 +- fs/file.c | 3 - fs/partitions/check.c | 1 - include/linux/compiler.h | 2 + include/linux/fdtable.h | 1 + include/linux/rcupdate.h | 82 +++++++++++++++++++ include/linux/workqueue.h | 4 + kernel/rcupdate.c | 160 ++++++++++++++++++++++++++++++++++++++ kernel/rcutiny.c | 2 + kernel/rcutree.c | 2 + kernel/workqueue.c | 15 ++++ lib/Kconfig.debug | 6 ++ mm/backing-dev.c | 1 - mm/slob.c | 1 - 15 files changed, 275 insertions(+), 8 deletions(-)
arch/powerpc/mm/pgtable.c +0 -1
@@ -92,7 +92,6 @@ static void pte_free_rcu_callback(struct rcu_head *head)static void pte_free_submit (struct pte_freelist_batch *batch) { -INIT_RCU_HEAD (&batch->rcu);call_rcu (&batch->rcu, pte_free_rcu_callback); }
arch/x86/kernel/cpu/mcheck/mce.c +1 -1
@@ -51,7 +51,7 @@static DEFINE_MUTEX (mce_read_mutex);#define rcu_dereference_check_mce (p) \ - rcu_dereference_check((p), \ + rcu_dereference_index_check((p), \ rcu_read_lock_sched_held() || \ lockdep_is_held(&mce_read_mutex))
fs/file.c +0 -3
@@ -178,7 +178,6 @@ static struct fdtable * alloc_fdtable(unsigned int nr) fdt->open_fds = (fd_set *)data; data += nr /BITS_PER_BYTE ; fdt->close_on_exec = (fd_set *)data; -INIT_RCU_HEAD (&fdt->rcu); fdt->next =NULL ;return fdt;
@@ -312,7 +311,6 @@ struct files_struct *dup_fd(struct files_struct *oldf, int *errorp) new_fdt->close_on_exec = (fd_set *)&newf->close_on_exec_init; new_fdt->open_fds = (fd_set *)&newf->open_fds_init; new_fdt->fd = &newf->fd_array[0 ]; -INIT_RCU_HEAD (&new_fdt->rcu); new_fdt->next =NULL ;spin_lock (&oldf->file_lock);
@@ -430,7 +428,6 @@ struct files_struct init_files = { .fd = &init_files.fd_array[0], .close_on_exec = (fd_set *)&init_files.close_on_exec_init, .open_fds = (fd_set *)&init_files.open_fds_init, - .rcu = RCU_HEAD_INIT, }, .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock), };
fs/partitions/check.c +0 -1
@@ -459,7 +459,6 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, }/* everything is up and running, commence */ -INIT_RCU_HEAD (&p->rcu_head);rcu_assign_pointer (ptbl->part[partno], p);/* suppress uevent if the disk supresses it */
include/linux/compiler.h +2 -0
@@ -16,6 +16,7 @@# define __release (x) __context__(x,-1)# define __cond_lock (x,c) ((c) ? ({ __acquire(x); 1; }) : 0)# define __percpu __attribute__((noderef, address_space(3))) +# define __rcuextern void __chk_user_ptr (const volatile void __user *);extern void __chk_io_ptr (const volatile void __iomem *);#else
@@ -34,6 +35,7 @@ extern void __chk_io_ptr(const volatile void __iomem *);# define __release (x) (void)0# define __cond_lock (x,c) (c)# define __percpu +# define __rcu#endif #ifdef __KERNEL__
include/linux/fdtable.h +1 -0
@@ -11,6 +11,7 @@#include <linux/rcupdate.h> #include <linux/types.h> #include <linux/init.h> +#include <linux/fs.h> #include <asm/atomic.h>
include/linux/rcupdate.h +82 -0
104 lines not on this page · raw message
include/linux/workqueue.h +4 -0
@@ -297,4 +297,8 @@ static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)#else long work_on_cpu (unsigned int cpu,long (*fn)(void *),void *arg);#endif /* CONFIG_SMP */ + +#ifdef CONFIG_LOCKDEP +int in_workqueue_context (struct workqueue_struct *wq); +#endif #endif
kernel/rcupdate.c +160 -0
163 lines not on this page · raw message
kernel/rcutiny.c +2 -0
@@ -169,6 +169,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)while (list) { next = list->next;prefetch (next); +debug_rcu_head_unqueue (list); list->func (list); list = next; }
@@ -211,6 +212,7 @@ static void __call_rcu(struct rcu_head *head, {unsigned long flags; +debug_rcu_head_queue (head); head->func = func; head->next =NULL ;
kernel/rcutree.c +2 -0
@@ -1112,6 +1112,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)while (list) { next = list->next;prefetch (next); +debug_rcu_head_unqueue (list); list->func (list); list = next;if (++count >= rdp->blimit)
@@ -1388,6 +1389,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),unsigned long flags;struct rcu_data *rdp; +debug_rcu_head_queue (head); head->func = func; head->next =NULL ;
kernel/workqueue.c +15 -0
@@ -68,6 +68,21 @@ struct workqueue_struct {#endif }; +#ifdef CONFIG_LOCKDEP +/** +* in_workqueue_context() - in context of specified workqueue? +* @wq: the workqueue of interest +* +* Checks lockdep state to see if the current task is executing from +* within a workqueue item. This function exists only if lockdep is +* enabled. +*/ +int in_workqueue_context (struct workqueue_struct *wq) +{ +return lock_is_held (&wq->lockdep_map); +} +#endif +#ifdef CONFIG_DEBUG_OBJECTS_WORK static struct debug_obj_descr work_debug_descr;
lib/Kconfig.debug +6 -0
@@ -307,6 +307,12 @@ config DEBUG_OBJECTS_WORK work queue routines to track the life time of work objects and validate the work operations. +config DEBUG_OBJECTS_RCU_HEAD + bool "Debug RCU callbacks objects" + depends on DEBUG_OBJECTS && PREEMPT + help + Enable this to turn on debugging of RCU list heads (call_rcu() usage). + config DEBUG_OBJECTS_ENABLE_DEFAULT int "debug_objects bootup default value (0-1)" range 0 1
mm/backing-dev.c +0 -1
@@ -668,7 +668,6 @@ int bdi_init(struct backing_dev_info *bdi) bdi->max_ratio =100 ; bdi->max_prop_frac =PROP_FRAC_BASE ;spin_lock_init (&bdi->wb_lock); -INIT_RCU_HEAD (&bdi->rcu_head);INIT_LIST_HEAD (&bdi->bdi_list);INIT_LIST_HEAD (&bdi->wb_list);INIT_LIST_HEAD (&bdi->work_list);
mm/slob.c +0 -1
@@ -639,7 +639,6 @@ void kmem_cache_free(struct kmem_cache *c, void *b)if (unlikely (c->flags &SLAB_DESTROY_BY_RCU )) {struct slob_rcu *slob_rcu; slob_rcu = b + (c->size -sizeof (struct slob_rcu )); -INIT_RCU_HEAD (&slob_rcu->head); slob_rcu->size = c->size;call_rcu (&slob_rcu->head, kmem_rcu_free); }else {