Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vhost kthread

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tejun Heo
Date: Monday, May 31, 2010 - 8:07 am

Hello,

On 05/31/2010 04:39 PM, Oleg Nesterov wrote:

Yeap, I think so too.  In vhost's case tho, as it exports a lot of
workqueue characteristics to vhost users, it's a bit more complex than
I wish it were.  It can probably be simplified more if someone who
knows the code better takes a look or maybe we need to make this kind
of things easier by providing a generic helpers if more cases like
this spring up, but if that happens probably the RTTD would be somehow
teaching workqueue how to deal with cgroups.  As this is the first
case, I guess open coding is okay for now.


Heh... right, I was looking at __wait_event() and thinking "ooh... we
can skip lock in the fast path".  :-)


I might have slightly over engineered this part not knowing the
expected workload.  ->queue_seq/->done_seq pair is to guarantee that
flushers never get starved.  Without sequencing queueings and
executions, flushers should wait for !pending && !active which can
take some time to come if the poll in question is very busy.


So that either kthread_stop()'s should_stop = 1 in kthread_stop() is
visible to kthread_should_stop() or task state is set to RUNNING.


But then kthread_stop() can happen between kthread_should_stop() and
__set_current_state(TASK_INTERRUPTIBLE) and poller can just sleep in
schedule() not knowing that.

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 ..., 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 ..., Tejun Heo, (Mon May 31, 8:07 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)