[lkml]   [2010]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] generic-ipi: add lock context annotations
2010-11-23 (화), 12:40 +0300, Dan Carpenter: 
> 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

I tried to annotate declations in include/linux/smp.h but it didn't work
well. Maybe that's what we need to fix the sparse?

Anyway, Jens, do you want new patch which includes above warnings?


Namhyung Kim

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2010-11-24 06:27    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean