Skip to content

Commit

Permalink
workqueue: rename cpu_workqueue to pool_workqueue
Browse files Browse the repository at this point in the history
workqueue has moved away from global_cwqs to worker_pools and with the
scheduled custom worker pools, wforkqueues will be associated with
pools which don't have anything to do with CPUs.  The workqueue code
went through significant amount of changes recently and mass renaming
isn't likely to hurt much additionally.  Let's replace 'cpu' with
'pool' so that it reflects the current design.

* s/struct cpu_workqueue_struct/struct pool_workqueue/
* s/cpu_wq/pool_wq/
* s/cwq/pwq/

This patch is purely cosmetic.

Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Tejun Heo committed Feb 14, 2013
1 parent 8d03ecf commit 112202d
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 229 deletions.
12 changes: 6 additions & 6 deletions include/linux/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void delayed_work_timer_fn(unsigned long __data);
enum {
WORK_STRUCT_PENDING_BIT = 0, /* work item is pending execution */
WORK_STRUCT_DELAYED_BIT = 1, /* work item is delayed */
WORK_STRUCT_CWQ_BIT = 2, /* data points to cwq */
WORK_STRUCT_PWQ_BIT = 2, /* data points to pwq */
WORK_STRUCT_LINKED_BIT = 3, /* next work is linked to this one */
#ifdef CONFIG_DEBUG_OBJECTS_WORK
WORK_STRUCT_STATIC_BIT = 4, /* static initializer (debugobjects) */
Expand All @@ -40,7 +40,7 @@ enum {

WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT,
WORK_STRUCT_DELAYED = 1 << WORK_STRUCT_DELAYED_BIT,
WORK_STRUCT_CWQ = 1 << WORK_STRUCT_CWQ_BIT,
WORK_STRUCT_PWQ = 1 << WORK_STRUCT_PWQ_BIT,
WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT,
#ifdef CONFIG_DEBUG_OBJECTS_WORK
WORK_STRUCT_STATIC = 1 << WORK_STRUCT_STATIC_BIT,
Expand All @@ -60,14 +60,14 @@ enum {
WORK_CPU_END = NR_CPUS + 1,

/*
* Reserve 7 bits off of cwq pointer w/ debugobjects turned
* off. This makes cwqs aligned to 256 bytes and allows 15
* workqueue flush colors.
* Reserve 7 bits off of pwq pointer w/ debugobjects turned off.
* This makes pwqs aligned to 256 bytes and allows 15 workqueue
* flush colors.
*/
WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT +
WORK_STRUCT_COLOR_BITS,

/* data contains off-queue information when !WORK_STRUCT_CWQ */
/* data contains off-queue information when !WORK_STRUCT_PWQ */
WORK_OFFQ_FLAG_BASE = WORK_STRUCT_FLAG_BITS,

WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE),
Expand Down
10 changes: 5 additions & 5 deletions include/trace/events/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DECLARE_EVENT_CLASS(workqueue_work,
/**
* workqueue_queue_work - called when a work gets queued
* @req_cpu: the requested cpu
* @cwq: pointer to struct cpu_workqueue_struct
* @pwq: pointer to struct pool_workqueue
* @work: pointer to struct work_struct
*
* This event occurs when a work is queued immediately or once a
Expand All @@ -36,10 +36,10 @@ DECLARE_EVENT_CLASS(workqueue_work,
*/
TRACE_EVENT(workqueue_queue_work,

TP_PROTO(unsigned int req_cpu, struct cpu_workqueue_struct *cwq,
TP_PROTO(unsigned int req_cpu, struct pool_workqueue *pwq,
struct work_struct *work),

TP_ARGS(req_cpu, cwq, work),
TP_ARGS(req_cpu, pwq, work),

TP_STRUCT__entry(
__field( void *, work )
Expand All @@ -52,9 +52,9 @@ TRACE_EVENT(workqueue_queue_work,
TP_fast_assign(
__entry->work = work;
__entry->function = work->func;
__entry->workqueue = cwq->wq;
__entry->workqueue = pwq->wq;
__entry->req_cpu = req_cpu;
__entry->cpu = cwq->pool->cpu;
__entry->cpu = pwq->pool->cpu;
),

TP_printk("work struct=%p function=%pf workqueue=%p req_cpu=%u cpu=%u",
Expand Down
Loading

0 comments on commit 112202d

Please sign in to comment.