Commit 60be6b9a41cb0da0df7a9f11486da56baebf04cd
Committed by
Linus Torvalds
1 parent
366c7f554e
Exists in
master
and in
20 other branches
[PATCH] lockdep: annotate on-stack completions
lockdep needs to have the waitqueue lock initialized for on-stack waitqueues implicitly initialized by DECLARE_COMPLETION(). Annotate on-stack completions accordingly. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 6 changed files with 7 additions and 5 deletions Side-by-side Diff
arch/x86_64/kernel/smpboot.c
... | ... | @@ -775,6 +775,8 @@ |
775 | 775 | }; |
776 | 776 | DECLARE_WORK(work, do_fork_idle, &c_idle); |
777 | 777 | |
778 | + lockdep_set_class(&c_idle.done.wait.lock, &waitqueue_lock_key); | |
779 | + | |
778 | 780 | /* allocate memory for gdts of secondary cpus. Hotplug is considered */ |
779 | 781 | if (!cpu_gdt_descr[cpu].address && |
780 | 782 | !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) { |
block/ll_rw_blk.c
... | ... | @@ -2516,7 +2516,7 @@ |
2516 | 2516 | int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk, |
2517 | 2517 | struct request *rq, int at_head) |
2518 | 2518 | { |
2519 | - DECLARE_COMPLETION(wait); | |
2519 | + DECLARE_COMPLETION_ONSTACK(wait); | |
2520 | 2520 | char sense[SCSI_SENSE_BUFFERSIZE]; |
2521 | 2521 | int err = 0; |
2522 | 2522 |
drivers/ide/ide-io.c
... | ... | @@ -1705,7 +1705,7 @@ |
1705 | 1705 | { |
1706 | 1706 | unsigned long flags; |
1707 | 1707 | ide_hwgroup_t *hwgroup = HWGROUP(drive); |
1708 | - DECLARE_COMPLETION(wait); | |
1708 | + DECLARE_COMPLETION_ONSTACK(wait); | |
1709 | 1709 | int where = ELEVATOR_INSERT_BACK, err; |
1710 | 1710 | int must_wait = (action == ide_wait || action == ide_head_wait); |
1711 | 1711 |
drivers/scsi/libata-core.c
... | ... | @@ -1001,7 +1001,7 @@ |
1001 | 1001 | struct ata_queued_cmd *qc; |
1002 | 1002 | unsigned int tag, preempted_tag; |
1003 | 1003 | u32 preempted_sactive, preempted_qc_active; |
1004 | - DECLARE_COMPLETION(wait); | |
1004 | + DECLARE_COMPLETION_ONSTACK(wait); | |
1005 | 1005 | unsigned long flags; |
1006 | 1006 | unsigned int err_mask; |
1007 | 1007 | int rc; |
drivers/spi/spi.c
kernel/kmod.c
... | ... | @@ -233,7 +233,7 @@ |
233 | 233 | int call_usermodehelper_keys(char *path, char **argv, char **envp, |
234 | 234 | struct key *session_keyring, int wait) |
235 | 235 | { |
236 | - DECLARE_COMPLETION(done); | |
236 | + DECLARE_COMPLETION_ONSTACK(done); | |
237 | 237 | struct subprocess_info sub_info = { |
238 | 238 | .complete = &done, |
239 | 239 | .path = path, |