Commit d302b497 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] remove io context refcounting debug

This removes the remains of some debugging stuff which was never really
enabled properly - it never reported memory leaks.  Its not useful for
anyone but me. 

A proper solution involves counting all requests in flight and all
threads but we'll probably put that just into mm.
parent d549b9ab
......@@ -173,13 +173,10 @@ static kmem_cache_t *arq_pool;
/*
* IO Context helper functions
*/
/* Debug */
static atomic_t nr_as_io_requests = ATOMIC_INIT(0);
/* Called to deallocate the as_io_context */
static void free_as_io_context(struct as_io_context *aic)
{
atomic_dec(&nr_as_io_requests);
kfree(aic);
}
......@@ -195,7 +192,6 @@ static struct as_io_context *alloc_as_io_context(void)
ret = kmalloc(sizeof(*ret), GFP_ATOMIC);
if (ret) {
atomic_inc(&nr_as_io_requests);
ret->dtor = free_as_io_context;
ret->exit = exit_as_io_context;
ret->state = 1 << AS_TASK_RUNNING;
......
......@@ -2576,8 +2576,6 @@ int __init blk_dev_init(void)
return 0;
}
static atomic_t nr_io_contexts = ATOMIC_INIT(0);
/*
* IO Context helper functions
*/
......@@ -2592,7 +2590,6 @@ void put_io_context(struct io_context *ioc)
if (ioc->aic && ioc->aic->dtor)
ioc->aic->dtor(ioc->aic);
kfree(ioc);
atomic_dec(&nr_io_contexts);
}
}
......@@ -2633,7 +2630,6 @@ struct io_context *get_io_context(int gfp_flags)
if (ret == NULL) {
ret = kmalloc(sizeof(*ret), GFP_ATOMIC);
if (ret) {
atomic_inc(&nr_io_contexts);
atomic_set(&ret->refcount, 1);
ret->pid = tsk->pid;
ret->last_waited = jiffies; /* doesn't matter... */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment