rcu: remove INIT_RCU_HEAD, RCU_HEAD_INIT, RCU_HEAD
Subsystems (9)
PATCH 1/1 rcu: remove INIT_RCU_HEAD, RCU_HEAD_INIT, RCU_HEAD
call_rcu() will unconditionally reinitialize RCU head anyway. New users of these macros constantly appear, so remove them.
Signed-off-by Alexey Dobriyan <[email protected]>
---
Documentation/DocBook/kernel-locking.tmpl | 8 -------- arch/powerpc/mm/pgtable.c | 1 - block/cfq-iosched.c | 1 - block/genhd.c | 1 - drivers/staging/batman-adv/hard-interface.c | 1 - fs/file.c | 3 --- fs/fs-writeback.c | 1 - fs/partitions/check.c | 1 - include/linux/init_task.h | 1 - include/linux/rcupdate.h | 6 ------ mm/backing-dev.c | 1 - mm/slob.c | 1 - security/selinux/avc.c | 1 - security/selinux/netnode.c | 2 -- 14 files changed, 29 deletions(-)
Documentation/DocBook/kernel-locking.tmpl +0 -8
@@ -1725,14 +1725,6 @@ the amount of locking which needs to be done. if (++cache_num > MAX_CACHE_SIZE) { struct object *i, *outcast = NULL; list_for_each_entry(i, &cache, list) { -@@ -85,6 +94,7 @@ - obj->popularity = 0; - atomic_set(&obj->refcnt, 1); /* The cache holds a reference */ - spin_lock_init(&obj->lock); -+ INIT_RCU_HEAD(&obj->rcu); - - spin_lock_irqsave(&cache_lock, flags); - __cache_add(obj); @@ -104,12 +114,11 @@ struct object *cache_find(int id) {
arch/powerpc/mm/pgtable.c +0 -1
@@ -91,7 +91,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); }
block/cfq-iosched.c +0 -1
@@ -3730,7 +3730,6 @@ static void *cfq_init_queue(struct request_queue *q)* second, in order to have larger depth for async operations. */ cfqd->last_delayed_sync = jiffies -HZ ; -INIT_RCU_HEAD (&cfqd->rcu);return cfqd; }
block/genhd.c +0 -1
@@ -987,7 +987,6 @@ int disk_expand_part_tbl(struct gendisk *disk, int partno)if (!new_ptbl)return -ENOMEM ; -INIT_RCU_HEAD (&new_ptbl->rcu_head); new_ptbl->len = target;for (i =0 ; i < len; i++)
drivers/staging/batman-adv/hard-interface.c +0 -1
@@ -301,7 +301,6 @@ int hardif_add_interface(char *dev, int if_num) batman_if->if_num = if_num; batman_if->dev = dev; batman_if->if_active =IF_INACTIVE ; -INIT_RCU_HEAD (&batman_if->rcu);printk (KERN_INFO "batman-adv:Adding interface: %s\n" , dev); avail_ifs++;
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/fs-writeback.c +0 -1
@@ -77,7 +77,6 @@ static inline bool bdi_work_on_stack(struct bdi_work *work)static inline void bdi_work_init (struct bdi_work *work,struct wb_writeback_args *args) { -INIT_RCU_HEAD (&work->rcu_head); work->args = *args; work->state =WS_USED ; }
fs/partitions/check.c +0 -1
@@ -455,7 +455,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/init_task.h +0 -1
@@ -57,7 +57,6 @@ extern struct group_info init_groups; { .first = &init_task.pids[PIDTYPE_PGID].node }, \ { .first = &init_task.pids[PIDTYPE_SID].node }, \ }, \ - .rcu = RCU_HEAD_INIT, \ .level = 0, \ .numbers = { { \ .nr = 0, \
include/linux/rcupdate.h +0 -6
@@ -71,12 +71,6 @@ extern void rcu_init(void);#error "Unknown RCU implementation specified to kernel configuration"#endif -#define RCU_HEAD_INIT { .next = NULL, .func = NULL } -#define RCU_HEAD (head) struct rcu_head head = RCU_HEAD_INIT -#define INIT_RCU_HEAD (ptr) do { \ - (ptr)->next = NULL; (ptr)->func = NULL; \ -} while (0) -#ifdef CONFIG_DEBUG_LOCK_ALLOC extern struct lockdep_map rcu_lock_map;# define rcu_read_acquire () \
mm/backing-dev.c +0 -1
@@ -655,7 +655,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
@@ -647,7 +647,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 {
security/selinux/avc.c +0 -1
@@ -288,7 +288,6 @@ static struct avc_node *avc_alloc_node(void)if (!node) goto out; -INIT_RCU_HEAD (&node->rhead);INIT_HLIST_NODE (&node->list);avc_cache_stats_incr (allocations);
security/selinux/netnode.c +0 -2
@@ -182,8 +182,6 @@ static void sel_netnode_insert(struct sel_netnode *node)BUG (); } -INIT_RCU_HEAD (&node->rcu); -/* we need to impose a limit on the growth of the hash table so check * this bucket to make sure it is within the specified bounds */ list_add_rcu (&node->list, &sel_netnode_hash[idx].list);
Quoted 2 lines · Alexey Dobriyan
call_rcu()will unconditionally reinitialize RCU head anyway. New users of these macros constantly appear, so remove them.
Some people have used these for debugging purposes, but I guess that they could use kmem_zalloc() and friends to get the same effect. So:
Quoted 193 lines
Signed-off-by Alexey Dobriyan <[email protected]>---
Documentation/DocBook/kernel-locking.tmpl | 8 -------- arch/powerpc/mm/pgtable.c | 1 - block/cfq-iosched.c | 1 - block/genhd.c | 1 - drivers/staging/batman-adv/hard-interface.c | 1 - fs/file.c | 3 --- fs/fs-writeback.c | 1 - fs/partitions/check.c | 1 - include/linux/init_task.h | 1 - include/linux/rcupdate.h | 6 ------ mm/backing-dev.c | 1 - mm/slob.c | 1 - security/selinux/avc.c | 1 - security/selinux/netnode.c | 2 -- 14 files changed, 29 deletions(-)Documentation/DocBook/kernel-locking.tmpl +0
-8@@ -1725,14 +1725,6 @@ the amount of locking which needs to be done. if (++cache_num > MAX_CACHE_SIZE) { struct object *i, *outcast = NULL; list_for_each_entry(i, &cache, list) { -@@ -85,6 +94,7 @@ - obj->popularity = 0; - atomic_set(&obj->refcnt, 1); /* The cache holds a reference */ - spin_lock_init(&obj->lock); -+ INIT_RCU_HEAD(&obj->rcu); - - spin_lock_irqsave(&cache_lock, flags); - __cache_add(obj); @@ -104,12 +114,11 @@ struct object *cache_find(int id) {arch/powerpc/mm/pgtable.c +0
-1@@ -91,7 +91,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); }block/cfq-iosched.c +0
-1@@ -3730,7 +3730,6 @@ static void *cfq_init_queue(struct request_queue *q)* second, in order to have larger depth for async operations. */ cfqd->last_delayed_sync = jiffies -HZ ; -INIT_RCU_HEAD (&cfqd->rcu);return cfqd; }block/genhd.c +0
-1@@ -987,7 +987,6 @@ int disk_expand_part_tbl(struct gendisk *disk, int partno)if (!new_ptbl)return -ENOMEM ; -INIT_RCU_HEAD (&new_ptbl->rcu_head); new_ptbl->len = target;for (i =0 ; i < len; i++)drivers/staging/batman-adv/hard-interface.c +0
-1@@ -301,7 +301,6 @@ int hardif_add_interface(char *dev, int if_num) batman_if->if_num = if_num; batman_if->dev = dev; batman_if->if_active =IF_INACTIVE ; -INIT_RCU_HEAD (&batman_if->rcu);printk (KERN_INFO "batman-adv:Adding interface: %s\n" , dev); avail_ifs++;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/fs-writeback.c +0
-1@@ -77,7 +77,6 @@ static inline bool bdi_work_on_stack(struct bdi_work *work)static inline void bdi_work_init (struct bdi_work *work,struct wb_writeback_args *args) { -INIT_RCU_HEAD (&work->rcu_head); work->args = *args; work->state =WS_USED ; }fs/partitions/check.c +0
-1@@ -455,7 +455,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/init_task.h +0
-1@@ -57,7 +57,6 @@ extern struct group_info init_groups; { .first = &init_task.pids[PIDTYPE_PGID].node }, \ { .first = &init_task.pids[PIDTYPE_SID].node }, \ }, \ - .rcu = RCU_HEAD_INIT, \ .level = 0, \ .numbers = { { \ .nr = 0, \include/linux/rcupdate.h +0
-6@@ -71,12 +71,6 @@ extern void rcu_init(void);#error "Unknown RCU implementation specified to kernel configuration"#endif -#define RCU_HEAD_INIT { .next = NULL, .func = NULL } -#define RCU_HEAD (head) struct rcu_head head = RCU_HEAD_INIT -#define INIT_RCU_HEAD (ptr) do { \ - (ptr)->next = NULL; (ptr)->func = NULL; \ -} while (0) -#ifdef CONFIG_DEBUG_LOCK_ALLOC extern struct lockdep_map rcu_lock_map;# define rcu_read_acquire () \mm/backing-dev.c +0
-1@@ -655,7 +655,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@@ -647,7 +647,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 {security/selinux/avc.c +0
-1@@ -288,7 +288,6 @@ static struct avc_node *avc_alloc_node(void)if (!node) goto out; -INIT_RCU_HEAD (&node->rhead);INIT_HLIST_NODE (&node->list);avc_cache_stats_incr (allocations);security/selinux/netnode.c +0
-3@@ -182,8 +182,6 @@ static void sel_netnode_insert(struct sel_netnode *node)BUG (); } -INIT_RCU_HEAD (&node->rcu); -/* we need to impose a limit on the growth of the hash table so check * this bucket to make sure it is within the specified bounds */ list_add_rcu (&node->list, &sel_netnode_hash[idx].list); --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/