All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-mm@kvack.org
Subject: Re: [4.11-rc3] BUG: sleeping function called from invalid context at mm/vmalloc.c:1480
Date: Thu, 23 Mar 2017 08:29:49 -0700	[thread overview]
Message-ID: <20170323152949.GA29134@bombadil.infradead.org> (raw)
In-Reply-To: <201703232349.BGB95898.QHLVFFOMtFOOJS@I-love.SAKURA.ne.jp>

On Thu, Mar 23, 2017 at 11:49:06PM +0900, Tetsuo Handa wrote:
> [    2.609598] [drm] Initialized vmwgfx 2.12.0 20170221 for 0000:00:0f.0 on minor 0
> [    2.616064] BUG: sleeping function called from invalid context at mm/vmalloc.c:1480
[...]
> [    2.616289]  __might_sleep+0x4a/0x80
> [    2.616293]  remove_vm_area+0x22/0x90
> [    2.616296]  __vunmap+0x2e/0x110
> [    2.616299]  vfree+0x42/0x90
> [    2.616304]  kvfree+0x2c/0x40
> [    2.616312]  drm_ht_remove+0x1a/0x30 [drm]
> [    2.616317]  ttm_object_file_release+0x50/0x90 [ttm]

ttm_object_file_release() takes a spinlock, calls drm_ht_remove() which
calls kvfree().

Can somebody remind me what exactly might sleep in remove_vm_area()?
Is it the cache flush on some architectures?  It'd be really nice for
vfree() to be callable from atomic context.

Assuming we can't get rid of the thing which might sleep in
remove_vm_area(), I think we should add a might_sleep() in kvfree().
We need that big warning there so we don't get hard to debug problems
when kvmalloc had to fall back to vmalloc().

--
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-03-23 15:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 14:49 [4.11-rc3] BUG: sleeping function called from invalid context at mm/vmalloc.c:1480 Tetsuo Handa
2017-03-23 15:29 ` Matthew Wilcox [this message]

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=20170323152949.GA29134@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.