Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206239
b: refs/heads/master
c: f342179
h: refs/heads/master
i:
  206237: 898a040
  206235: d299faf
  206231: 01bcab8
  206223: bea4476
  206207: 935629f
v: v3
  • Loading branch information
Tejun Heo committed Jul 2, 2010
1 parent 9858490 commit 8e01549
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 61 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: bdbc5dd7de5d07d6c9d3536e598956165a031d4c
refs/heads/master: f34217977d717385a3e9fd7018ac39fade3964c0
15 changes: 14 additions & 1 deletion trunk/include/linux/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ enum {
WORK_NO_COLOR = WORK_NR_COLORS,

/* special cpu IDs */
WORK_CPU_NONE = NR_CPUS,
WORK_CPU_UNBOUND = NR_CPUS,
WORK_CPU_NONE = NR_CPUS + 1,
WORK_CPU_LAST = WORK_CPU_NONE,

/*
Expand Down Expand Up @@ -237,11 +238,17 @@ enum {
WQ_RESCUER = 1 << 3, /* has an rescue worker */
WQ_HIGHPRI = 1 << 4, /* high priority */
WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */
WQ_UNBOUND = 1 << 6, /* not bound to any cpu */

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,
};

/* unbound wq's aren't per-cpu, scale max_active according to #cpus */
#define WQ_UNBOUND_MAX_ACTIVE \
max_t(int, WQ_MAX_ACTIVE, num_possible_cpus() * WQ_MAX_UNBOUND_PER_CPU)

/*
* System-wide workqueues which are always present.
*
Expand All @@ -256,10 +263,16 @@ enum {
* system_nrt_wq is non-reentrant and guarantees that any given work
* item is never executed in parallel by multiple CPUs. Queue
* flushing might take relatively long.
*
* system_unbound_wq is unbound workqueue. Workers are not bound to
* any specific CPU, not concurrency managed, and all queued works are
* executed immediately as long as max_active limit is not reached and
* resources are available.
*/
extern struct workqueue_struct *system_wq;
extern struct workqueue_struct *system_long_wq;
extern struct workqueue_struct *system_nrt_wq;
extern struct workqueue_struct *system_unbound_wq;

extern struct workqueue_struct *
__alloc_workqueue_key(const char *name, unsigned int flags, int max_active,
Expand Down
Loading

0 comments on commit 8e01549

Please sign in to comment.