lkml.org 
[lkml]   [2017]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [BUG] mm/vmalloc: ___might_sleep is called under a spinlock in __purge_vmap_area_lazy
From
Date
Thanks for your reply and explanation :)
I will improve my analysis.

Thanks,
Jia-Ju Bai

On 2017/10/9 12:10, Kirill A. Shutemov wrote:
> On Mon, Oct 09, 2017 at 12:00:33PM +0800, Jia-Ju Bai wrote:
>> The ___might_sleep is called under a spinlock, and the function call graph
>> is:
>> __purge_vmap_area_lazy (acquire the spinlock)
>> cond_resched_lock
>> ___might_sleep
>>
>> In this situation, ___might_sleep may prints error log message because a
>> spinlock is held.
>> A possible fix is to remove ___might_sleep in cond_resched_lock.
>>
>> This bug is found by my static analysis tool and my code review.
> This analysis doesn't makes sense.
>
> The point of cond_resched_lock() is that it drops the lock, if resched is
> required.
>
> ___might_sleep() is called with preempt_offset equal to
> PREEMPT_LOCK_OFFSET, so it won't report error if it's the only lock we
> hold.
>


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