diff options
| author | Jens Axboe <axboe@kernel.dk> | 2013-05-17 03:58:43 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2013-10-25 06:55:59 -0400 |
| commit | c84a83e2aaab02a5ca64a982aa55342784934479 (patch) | |
| tree | 405880cd8121ba0fb1905549cc992071d27c6ca4 /kernel | |
| parent | e3daab6ce467199ffea12fc1b2df8f61335ce1ca (diff) | |
smp: don't warn about csd->flags having CSD_FLAG_LOCK cleared for !wait
blk-mq reuses the request potentially immediately, since the most
cache hot is always given out first. This means that rq->csd could
be reused between csd->func() being called and csd_unlock() being
called. This isn't a problem, since we never use wait == 1 for
the smp call function. Add CSD_FLAG_WAIT to be able to tell the
difference, retaining the warning for other cases.
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/smp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/smp.c b/kernel/smp.c index 46d3d0b48a8d..dbc3d42d2c68 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS | 18 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS |
| 19 | enum { | 19 | enum { |
| 20 | CSD_FLAG_LOCK = 0x01, | 20 | CSD_FLAG_LOCK = 0x01, |
| 21 | CSD_FLAG_WAIT = 0x02, | ||
| 21 | }; | 22 | }; |
| 22 | 23 | ||
| 23 | struct call_function_data { | 24 | struct call_function_data { |
| @@ -124,7 +125,7 @@ static void csd_lock(struct call_single_data *csd) | |||
| 124 | 125 | ||
| 125 | static void csd_unlock(struct call_single_data *csd) | 126 | static void csd_unlock(struct call_single_data *csd) |
| 126 | { | 127 | { |
| 127 | WARN_ON(!(csd->flags & CSD_FLAG_LOCK)); | 128 | WARN_ON((csd->flags & CSD_FLAG_WAIT) && !(csd->flags & CSD_FLAG_LOCK)); |
| 128 | 129 | ||
| 129 | /* | 130 | /* |
| 130 | * ensure we're all done before releasing data: | 131 | * ensure we're all done before releasing data: |
| @@ -146,6 +147,9 @@ void generic_exec_single(int cpu, struct call_single_data *csd, int wait) | |||
| 146 | unsigned long flags; | 147 | unsigned long flags; |
| 147 | int ipi; | 148 | int ipi; |
| 148 | 149 | ||
| 150 | if (wait) | ||
| 151 | csd->flags |= CSD_FLAG_WAIT; | ||
| 152 | |||
| 149 | raw_spin_lock_irqsave(&dst->lock, flags); | 153 | raw_spin_lock_irqsave(&dst->lock, flags); |
| 150 | ipi = list_empty(&dst->list); | 154 | ipi = list_empty(&dst->list); |
| 151 | list_add_tail(&csd->list, &dst->list); | 155 | list_add_tail(&csd->list, &dst->list); |
