diff options
| author | Tejun Heo <[email protected]> | 2010-06-29 10:07:11 +0200 |
|---|---|---|
| committer | Tejun Heo <[email protected]> | 2010-06-29 10:07:11 +0200 |
| commit | 0f900049cbe2767d47c2a62b54f0e822e1d66840 (patch) | |
| tree | b7d2ce3e00ef49c038d0641a860b98b4c24fb203 /include/linux/errqueue.h | |
| parent | 1537663f5763892cacf1409ac0efef1b4f332d1e (diff) | |
workqueue: update cwq alignement
work->data field is used for two purposes. It points to cwq it's
queued on and the lower bits are used for flags. Currently, two bits
are reserved which is always safe as 4 byte alignment is guaranteed on
every architecture. However, future changes will need more flag bits.
On SMP, the percpu allocator is capable of honoring larger alignment
(there are other users which depend on it) and larger alignment works
just fine. On UP, percpu allocator is a thin wrapper around
kzalloc/kfree() and don't honor alignment request.
This patch introduces WORK_STRUCT_FLAG_BITS and implements
alloc/free_cwqs() which guarantees max(1 << WORK_STRUCT_FLAG_BITS,
__alignof__(unsigned long long) alignment both on SMP and UP. On SMP,
simply wrapping percpu allocator is enough. On UP, extra space is
allocated so that cwq can be aligned and the original pointer can be
stored after it which is used in the free path.
* Alignment problem on UP is reported by Michal Simek.
Signed-off-by: Tejun Heo <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Reported-by: Michal Simek <[email protected]>
Diffstat (limited to 'include/linux/errqueue.h')
0 files changed, 0 insertions, 0 deletions