linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-mm@kvack.org
Subject: Re: Sleeping BUG in khugepaged for i586
Date: Mon, 5 Jun 2017 14:44:01 -0700	[thread overview]
Message-ID: <20170605144401.5a7e62887b476f0732560fa0@linux-foundation.org> (raw)
In-Reply-To: <968ae9a9-5345-18ca-c7ce-d9beaf9f43b6@lwfinger.net>

On Sat, 3 Jun 2017 14:24:26 -0500 Larry Finger <Larry.Finger@lwfinger.net> wrote:

> I recently turned on locking diagnostics for a Dell Latitude D600 laptop, which 
> requires a 32-bit kernel. In the log I found the following:
> 
> BUG: sleeping function called from invalid context at mm/khugepaged.c:655
> in_atomic(): 1, irqs_disabled(): 0, pid: 20, name: khugepaged
> 1 lock held by khugepaged/20:
>   #0:  (&mm->mmap_sem){++++++}, at: [<c03d6609>] 
> collapse_huge_page.isra.47+0x439/0x1240
> CPU: 0 PID: 20 Comm: khugepaged Tainted: G        W 
> 4.12.0-rc1-wl-12125-g952a068 #80
> Hardware name: Dell Computer Corporation Latitude D600 
> /03U652, BIOS A05 05/29/2003
> Call Trace:
>   dump_stack+0x76/0xb2
>   ___might_sleep+0x174/0x230
>   collapse_huge_page.isra.47+0xacf/0x1240
>   khugepaged_scan_mm_slot+0x41e/0xc00
>   ? _raw_spin_lock+0x46/0x50
>   khugepaged+0x277/0x4f0
>   ? prepare_to_wait_event+0xe0/0xe0
>   kthread+0xeb/0x120
>   ? khugepaged_scan_mm_slot+0xc00/0xc00
>   ? kthread_create_on_node+0x30/0x30
>   ret_from_fork+0x21/0x30
> 
> I have no idea when this problem was introduced. Of course, I will test any 
> proposed fixes.
> 

Odd.  There's nothing wrong with cond_resched() while holding mmap_sem.
It looks like khugepaged forgot to do a spin_unlock somewhere and we
leaked a preempt_count.

--
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-06-05 21:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-03 19:24 Sleeping BUG in khugepaged for i586 Larry Finger
2017-06-05 21:44 ` Andrew Morton [this message]
2017-06-06 14:02   ` Vlastimil Babka
2017-06-06 15:01     ` Larry Finger
2017-06-07  7:19       ` Vlastimil Babka
2017-06-07 20:56         ` David Rientjes
2017-06-08 14:48           ` Michal Hocko
2017-06-08 17:05             ` Matthew Wilcox
2017-06-08 20:18               ` Michal Hocko
2017-06-08 20:30                 ` Michal Hocko
2017-06-09  6:48                   ` Vlastimil Babka
2017-06-09  7:43                     ` Michal Hocko
2017-06-09 14:28                     ` Larry Finger
2017-06-09 22:38                   ` David Rientjes
2017-06-10  8:09                     ` Michal Hocko
2017-06-11 23:28                       ` David Rientjes
2017-06-12  6:29                         ` Michal Hocko
2017-06-15  0:28                           ` David Rientjes
2017-06-15  1:12             ` David Rientjes
2017-06-15  8:32               ` Michal Hocko
2017-06-23 12:08             ` Michal Hocko
2017-06-23 13:13               ` Vlastimil Babka
2017-06-23 13:25                 ` Michal Hocko
2017-06-23 15:28                   ` Larry Finger
2017-06-08 15:29           ` Larry Finger

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=20170605144401.5a7e62887b476f0732560fa0@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).