Messages in this thread | | | Date | Tue, 23 Nov 2010 12:40:16 +0300 | From | Dan Carpenter <> | Subject | Re: [PATCH] generic-ipi: add lock context annotations |
| |
On Tue, Nov 23, 2010 at 09:49:56AM +0100, Jens Axboe wrote: > I guess what Peter means is that the fact that the function grabs the > lock is apparent in the code, if sparse was a bit "smarter", it would > see and note this itself.
The sparse warning messages should have been included in the commit message. Here they are:
kernel/smp.c:513:6: warning: context imbalance in 'ipi_call_lock' - wrong count at exit kernel/smp.c:518:6: warning: context imbalance in 'ipi_call_unlock' - unexpected unlock kernel/smp.c:523:6: warning: context imbalance in 'ipi_call_lock_irq' - wrong count at exit kernel/smp.c:528:6: warning: context imbalance in 'ipi_call_unlock_irq' - unexpected unlock
What happens is that sparse *does* see that the locks are unlocked and that's what it complains about.
Sparse works before the code is linked so this change doesn't affect anything outside kernel/smp.c. If we added these annotations to include/linux/smp.h then they would be used for checking kernel/smpboot.c
regards, dan carpenter
| |