Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210278
b: refs/heads/master
c: e41e704
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Aug 24, 2010
1 parent fce57e1 commit a5b56b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 972fa1c5316d18c8297123e08e9b6930ca34f888
refs/heads/master: e41e704bc4f49057fc68b643108366e6e6781aa3
2 changes: 2 additions & 0 deletions trunk/include/linux/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ enum {
WQ_HIGHPRI = 1 << 4, /* high priority */
WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */

WQ_DYING = 1 << 6, /* internal: workqueue is dying */

WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */
WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */
WQ_DFL_ACTIVE = WQ_MAX_ACTIVE / 2,
Expand Down
7 changes: 6 additions & 1 deletion trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ enum {
/*
* Structure fields follow one of the following exclusion rules.
*
* I: Set during initialization and read-only afterwards.
* I: Modifiable by initialization/destruction paths and read-only for
* everyone else.
*
* P: Preemption protected. Disabling preemption is enough and should
* only be modified and accessed from the local cpu.
Expand Down Expand Up @@ -944,6 +945,9 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct *wq,

debug_work_activate(work);

if (WARN_ON_ONCE(wq->flags & WQ_DYING))
return;

/* determine gcwq to use */
if (!(wq->flags & WQ_UNBOUND)) {
struct global_cwq *last_gcwq;
Expand Down Expand Up @@ -2828,6 +2832,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
{
unsigned int cpu;

wq->flags |= WQ_DYING;
flush_workqueue(wq);

/*
Expand Down

0 comments on commit a5b56b1

Please sign in to comment.