lkml.org 
[lkml]   [2017]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: z3fold: suspicious return with spinlock held
On Sat, Mar 11, 2017 at 12:22:12AM +0300, Alexey Khoroshilov wrote:
> Hello!
>
> z3fold_reclaim_page() contains the only return that may
> leave the function with pool->lock spinlock held.
>
> 669 spin_lock(&pool->lock);
> 670 if (kref_put(&zhdr->refcount, release_z3fold_page)) {
> 671 atomic64_dec(&pool->pages_nr);
> 672 return 0;
> 673 }
>
> May be we need spin_unlock(&pool->lock); just before return?

I would tend to agree. sparse warns about this, and also about two
other locking problems ... which I'm not sure are really problems so
much as missing annotations?

mm/z3fold.c:467:35: warning: context imbalance in 'z3fold_alloc' - unexpected unlock
mm/z3fold.c:519:26: warning: context imbalance in 'z3fold_free' - different lock contexts for basic block
mm/z3fold.c:581:12: warning: context imbalance in 'z3fold_reclaim_page' - different lock contexts for basic block

\
 
 \ /
  Last update: 2017-03-10 22:34    [W:0.046 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site