linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Jia-Ju Bai <baijiaju1990@163.com>
Cc: akpm@linux-foundation.org, mhocko@suse.com, mingo@kernel.org,
	catalin.marinas@arm.com, labbott@redhat.com, thgarnie@google.com,
	kirill.shutemov@linux.intel.com, aryabinin@virtuozzo.com,
	ard.biesheuvel@linaro.org, zijun_hu@htc.com, linux-mm@kvack.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] mm/vmalloc: ___might_sleep is called under a spinlock in __purge_vmap_area_lazy
Date: Mon, 9 Oct 2017 07:10:01 +0300	[thread overview]
Message-ID: <20171009041001.p47yc6r7f3borhba@node.shutemov.name> (raw)
In-Reply-To: <70f9850a-b24c-8595-8a22-9b47e96d6338@163.com>

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.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-10-09  4:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  4:00 Jia-Ju Bai
2017-10-09  4:10 ` Kirill A. Shutemov [this message]
2017-10-09  4:48   ` Jia-Ju Bai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171009041001.p47yc6r7f3borhba@node.shutemov.name \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=baijiaju1990@163.com \
    --cc=catalin.marinas@arm.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mingo@kernel.org \
    --cc=thgarnie@google.com \
    --cc=zijun_hu@htc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox