Re: [PATCH 2/3] workqueue: Add an API to create a singlethread workqueue attached to the current task's cgroup

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

Hello, Michael.

On 05/27/2010 07:32 PM, Michael S. Tsirkin wrote:
...

The thing is that this kind of one-off usage becomes problemetic when
you're trying to change the implementation detail.  All current
workqueue users don't care which thread they run on and they shouldn't
as each work owns the context only for the duration the work is
executing.  If this sort of fundamental guidelines are followed, the
implementation can be improved in pretty much transparent way but when
you start depending on specific implementation details, things become
messy pretty quickly.

If this type of usage were more common, adding proper way to account
work usage according to cgroups would make sense but that's not the
case here and I removed the only exception case recently while trying
to implement cmwq and if this is added.  So, this would be the only
one which makes such extra assumptions in the whole kernel.  One way
or the other, workqueue needs to be improved and I don't really think
adding the single exception at this point is a good idea.

The thing I realized after stop_machine conversion was that there was
no reason to use workqueue there at all.  There already are more than
enough not-too-difficult synchronization constructs and if you're
using a thread for dedicated purposes, code complexity isn't that
different either way.  Plus, it would also be clearer that dedicated
threads are required there for what reason.  So, I strongly suggest
using a kthread.  If there are issues which are noticeably difficult
to solve with kthread, we can definitely talk about that and think
about things again.

Thank you.

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

Messages in current thread:
[PATCH 2/3] workqueue: Add an API to create a singlethread ..., Sridhar Samudrala, (Tue May 18, 5:04 pm)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ..., Michael S. Tsirkin, (Thu May 27, 2:14 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ..., Michael S. Tsirkin, (Thu May 27, 6:12 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ..., Sridhar Samudrala, (Thu May 27, 9:24 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ..., Michael S. Tsirkin, (Thu May 27, 9:41 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ..., Michael S. Tsirkin, (Thu May 27, 10:32 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ..., Tejun Heo, (Thu May 27, 2:20 pm)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ..., Michael S. Tsirkin, (Fri May 28, 8:08 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ..., Michael S. Tsirkin, (Sun May 30, 4:29 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ..., Michael S. Tsirkin, (Mon May 31, 8:22 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ..., Michael S. Tsirkin, (Mon May 31, 9:00 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost w ..., Michael S. Tsirkin, (Tue Jun 1, 3:17 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost w ..., Sridhar Samudrala, (Tue Jun 1, 10:19 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost p ..., Michael S. Tsirkin, (Thu Jun 24, 1:11 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost p ..., Sridhar Samudrala, (Thu Jun 24, 3:45 pm)
[PATCH] sched: export sched_set/getaffinity (was Re: [PATC ..., Michael S. Tsirkin, (Fri Jun 25, 3:10 am)
[PATCH repost] sched: export sched_set/getaffinity to modules, Michael S. Tsirkin, (Thu Jul 1, 4:07 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Thu Jul 1, 4:55 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Thu Jul 1, 5:23 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Thu Jul 1, 5:50 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Thu Jul 1, 6:08 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Thu Jul 1, 6:22 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Sridhar Samudrala, (Fri Jul 2, 11:01 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Sun Jul 4, 2:00 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Sridhar Samudrala, (Mon Jul 12, 11:59 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Tue Jul 13, 4:09 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Sridhar Samudrala, (Wed Jul 14, 4:26 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Thu Jul 22, 8:58 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Sat Jul 24, 12:14 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Sun Jul 25, 3:04 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 8:25 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 8:50 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 8:51 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 9:23 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 9:31 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 9:51 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 9:57 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Mon Jul 26, 10:12 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Sridhar Samudrala, (Mon Jul 26, 10:51 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Mon Jul 26, 12:55 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 12:57 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 12:59 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Mon Jul 26, 1:19 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Mon Jul 26, 1:27 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Mon Jul 26, 9:55 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Tue Jul 27, 8:41 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Tue Jul 27, 12:19 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ..., Michael S. Tsirkin, (Wed Jul 28, 3:48 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ..., Michael S. Tsirkin, (Sun Aug 1, 1:50 am)