Re: [PATCH] increment nr_tasks in io_context when CLONE_IO is set

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nikanth Karthikesan <knikanth@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, April 15, 2008 - 3:24 am

On Tue, Apr 15 2008, Nikanth Karthikesan wrote:

Fix is correct, however it would be more appropriate in ioc_task_link()
instead.

diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index cac4b36..2b7a118 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -91,8 +91,10 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
 	 * if ref count is zero, don't allow sharing (ioc is going away, it's
 	 * a race).
 	 */
-	if (ioc && atomic_inc_not_zero(&ioc->refcount))
+	if (ioc && atomic_inc_not_zero(&ioc->refcount)) {
+		atomic_inc(&ioc->nr_tasks);
 		return ioc;
+	}
 
 	return NULL;
 }

-- 
Jens Axboe

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] increment nr_tasks in io_context when CLONE_IO is set, Nikanth Karthikesan, (Mon Apr 14, 11:50 pm)
Re: [PATCH] increment nr_tasks in io_context when CLONE_IO i..., Jens Axboe, (Tue Apr 15, 3:24 am)