block: remove the nr_task field from struct io_context
authorChristoph Hellwig <hch@lst.de>
Thu, 9 Dec 2021 06:31:21 +0000 (07:31 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 16 Dec 2021 17:59:01 +0000 (10:59 -0700)
Nothing ever looks at ->nr_tasks, so remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20211209063131.18537-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-ioc.c
include/linux/iocontext.h

index 536fb496ad7635ad00ceec67bf2ac1c4727ff19f..96336c2134efa11479be91863fb3b93cb316667a 100644 (file)
@@ -207,7 +207,6 @@ void exit_io_context(struct task_struct *task)
        task->io_context = NULL;
        task_unlock(task);
 
-       atomic_dec(&ioc->nr_tasks);
        put_io_context_active(ioc);
 }
 
@@ -259,7 +258,6 @@ static struct io_context *alloc_io_context(gfp_t gfp_flags, int node)
                return NULL;
 
        atomic_long_set(&ioc->refcount, 1);
-       atomic_set(&ioc->nr_tasks, 1);
        atomic_set(&ioc->active_ref, 1);
        spin_lock_init(&ioc->lock);
        INIT_RADIX_TREE(&ioc->icq_tree, GFP_ATOMIC);
@@ -339,7 +337,6 @@ int __copy_io(unsigned long clone_flags, struct task_struct *tsk)
        if (clone_flags & CLONE_IO) {
                atomic_long_inc(&ioc->refcount);
                atomic_inc(&ioc->active_ref);
-               atomic_inc(&ioc->nr_tasks);
                tsk->io_context = ioc;
        } else if (ioprio_valid(ioc->ioprio)) {
                tsk->io_context = alloc_io_context(GFP_KERNEL, NUMA_NO_NODE);
index c1229fbd6691c04bfe746b1d04014f0b637e43f1..82c7f4f5f4f590febcf3e67fa907453c3fe958f4 100644 (file)
@@ -99,7 +99,6 @@ struct io_cq {
 struct io_context {
        atomic_long_t refcount;
        atomic_t active_ref;
-       atomic_t nr_tasks;
 
        /* all the fields below are protected by this lock */
        spinlock_t lock;