lkml.org 
[lkml]   [2012]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[PATCHSET] kthread_worker: reimplement flush_kthread_work() to allow freeing during execution
Hello,

kthread_worker was introduced together with concurrency managed
workqueue to serve workqueue users which need a special dedicated
worker - e.g. RT scheduling. This is minimal queue / flush / flush
all iterface on top of kthread and each provided interface matches the
workqueue counterpart so that switching isn't difficult.

However, one noticeable difference was that kthread_worker doesn't
allow a work item to be freed while being executed. The intention was
to keep the code simpler but it didn't really and the restriction is
subtle and does prevent some valid use cases.

This two-patch series reimplements flush_kthread_work() so that it
uses an extra work item for flushing. While this takes a bit more
lines, this is easier to understand and removes the annoying
difference.

This patchset contains the following two patches.

0001-kthread_worker-reorganize-to-prepare-for-flush_kthre.patch
0002-kthread_worker-reimplement-flush_kthread_work-to-all.patch

The first one is a prep patch which makes no functional changes. The
second reimplements flush_kthread_work().

All current kthread_worker users are cc'd. If no one objects, I'll
push it through the workqueue branch. This patchset is also available
in the following git branch.

git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git review-kthread_worker-flush

diffstat follows. Thanks.

include/linux/kthread.h | 8 +---
kernel/kthread.c | 86 +++++++++++++++++++++++++++---------------------
2 files changed, 52 insertions(+), 42 deletions(-)

--
tejun


\
 
 \ /
  Last update: 2012-07-19 23:41    [W:0.165 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site