Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365509
b: refs/heads/master
c: e626761
h: refs/heads/master
i:
  365507: 9565de6
v: v3
  • Loading branch information
Tejun Heo committed Mar 13, 2013
1 parent 5c06087 commit af6e996
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 226223ab3c4118ddd10688cc2c131135848371ab
refs/heads/master: e62676169118bc2d42e5008b3f8872646313f077
1 change: 1 addition & 0 deletions trunk/include/linux/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ extern bool cancel_delayed_work_sync(struct delayed_work *dwork);

extern void workqueue_set_max_active(struct workqueue_struct *wq,
int max_active);
extern bool current_is_workqueue_rescuer(void);
extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);
extern unsigned int work_busy(struct work_struct *work);

Expand Down
13 changes: 13 additions & 0 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -4071,6 +4071,19 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)
}
EXPORT_SYMBOL_GPL(workqueue_set_max_active);

/**
* current_is_workqueue_rescuer - is %current workqueue rescuer?
*
* Determine whether %current is a workqueue rescuer. Can be used from
* work functions to determine whether it's being run off the rescuer task.
*/
bool current_is_workqueue_rescuer(void)
{
struct worker *worker = current_wq_worker();

return worker && worker == worker->current_pwq->wq->rescuer;
}

/**
* workqueue_congested - test whether a workqueue is congested
* @cpu: CPU in question
Expand Down

0 comments on commit af6e996

Please sign in to comment.