From: Sasha Levin <sasha.levin@oracle.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: linux-mm@kvack.org, Dave Hansen <dave.hansen@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
linux-kernel@vger.kernel.org, Dave Jones <davej@redhat.com>
Subject: Re: [PATCH 7/7] mincore: apply page table walker on do_mincore()
Date: Mon, 16 Jun 2014 17:14:51 -0400 [thread overview]
Message-ID: <539F5E4B.3090302@oracle.com> (raw)
In-Reply-To: <20140616164449.GB13264@nhori.bos.redhat.com>
On 06/16/2014 12:44 PM, Naoya Horiguchi wrote:
> Hi Sasha,
>
> Thanks for bug reporting.
>
> On Mon, Jun 16, 2014 at 11:24:16AM -0400, Sasha Levin wrote:
>> On 06/06/2014 06:58 PM, Naoya Horiguchi wrote:
>>> This patch makes do_mincore() use walk_page_vma(), which reduces many lines
>>> of code by using common page table walk code.
>>>
>>> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>>
>> Hi Naoya,
>>
>> This patch is causing a few issues on -next:
>>
>> [ 367.679282] BUG: sleeping function called from invalid context at mm/mincore.c:37
>
> cond_resched() in mincore_hugetlb() triggered this. This is done in common
> pagewalk code, so I should have removed it.
>
> ...
>> And:
>>
>> [ 391.118663] BUG: unable to handle kernel paging request at ffff880142aca000
>> [ 391.118663] IP: mincore_hole (mm/mincore.c:99 (discriminator 2))
>
> walk->pte_hole cannot assume walk->vma != NULL, so I should've checked it
> in mincore_hole() before using walk->vma.
>
> Could you try the following fixes?
That solved those two, but I'm seeing new ones:
[ 650.352956] BUG: unable to handle kernel paging request at ffff8802fdf03000
[ 650.352956] IP: mincore_hole (mm/mincore.c:101 (discriminator 2))
[ 650.352956] PGD 23bcd067 PUD 704b48067 PMD 704958067 PTE 80000002fdf03060
[ 650.352956] Oops: 0002 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[ 650.352956] Dumping ftrace buffer:
[ 650.352956] (ftrace buffer empty)
[ 650.352956] Modules linked in:
[ 650.352956] CPU: 12 PID: 15403 Comm: trinity-c363 Tainted: G W 3.15.0-next-20140616-sasha-00025-g0fd1f7d-dirty #657
[ 650.352956] task: ffff88027caf3000 ti: ffff880279d5c000 task.ti: ffff880279d5c000
[ 650.352956] RIP: mincore_hole (mm/mincore.c:101 (discriminator 2))
[ 650.352956] RSP: 0018:ffff880279d5fd48 EFLAGS: 00010202
[ 650.352956] RAX: 0000000000000001 RBX: 00007f2445400000 RCX: 0000000000000000
[ 650.352956] RDX: 0000000000000000 RSI: 00007f2445400000 RDI: 00007f2445200000
[ 650.352956] RBP: ffff880279d5fd88 R08: 0000000000000001 R09: ffff880000000100
[ 650.352956] R10: 0000000000000001 R11: 00007f2444126000 R12: 00007f2480000000
[ 650.352956] R13: ffff8802fdf03000 R14: 0000000000000200 R15: ffff8804e32f2000
[ 650.352956] FS: 00007f24899ec700(0000) GS:ffff8802ff000000(0000) knlGS:0000000000000000
[ 650.352956] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 650.352956] CR2: ffff8802fdf03000 CR3: 000000027c39b000 CR4: 00000000000006a0
[ 650.352956] DR0: 00000000006df000 DR1: 0000000000000000 DR2: 0000000000000000
[ 650.352956] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
[ 650.352956] Stack:
[ 650.352956] ffff880279d5fef0 0000000000000000 0000000000000000 00007f2445400000
[ 650.352956] 00007f2480000000 ffff880279d5fef0 00007f2445200000 ffff8804e30fd148
[ 650.352956] ffff880279d5fe38 ffffffff9c2d1c4d ffff880200000000 ffffffff9c1a0038
[ 650.352956] Call Trace:
[ 650.352956] walk_pgd_range (mm/pagewalk.c:73 mm/pagewalk.c:141 mm/pagewalk.c:170)
[ 650.352956] ? preempt_count_sub (kernel/sched/core.c:2602)
[ 650.352956] __walk_page_range (mm/pagewalk.c:264)
[ 650.352956] ? SyS_mincore (mm/mincore.c:160 mm/mincore.c:244 mm/mincore.c:212)
[ 650.352956] walk_page_vma (mm/pagewalk.c:376)
[ 650.352956] SyS_mincore (mm/mincore.c:177 mm/mincore.c:244 mm/mincore.c:212)
[ 650.352956] ? mincore_hugetlb (mm/mincore.c:143)
[ 650.352956] ? mincore_hole (mm/mincore.c:109)
[ 650.352956] ? mincore_page (mm/mincore.c:87)
[ 650.352956] ? copy_page_range (mm/mincore.c:24)
[ 650.352956] tracesys (arch/x86/kernel/entry_64.S:542)
[ 650.352956] Code: 87 a0 00 00 00 48 83 c3 01 48 8b b8 f8 01 00 00 e8 ab fe ff ff 48 8b 55 c8 88 02 49 63 c4 49 39 c6 77 cd eb 14 0f 1f 00 83 c0 01 <41> c6 44 15 00 00 48 63 d0 49 39 d6 77 ef 48 8b 55 c0 4c 8b 6a
All code
========
0: 87 a0 00 00 00 48 xchg %esp,0x48000000(%rax)
6: 83 c3 01 add $0x1,%ebx
9: 48 8b b8 f8 01 00 00 mov 0x1f8(%rax),%rdi
10: e8 ab fe ff ff callq 0xfffffffffffffec0
15: 48 8b 55 c8 mov -0x38(%rbp),%rdx
19: 88 02 mov %al,(%rdx)
1b: 49 63 c4 movslq %r12d,%rax
1e: 49 39 c6 cmp %rax,%r14
21: 77 cd ja 0xfffffffffffffff0
23: eb 14 jmp 0x39
25: 0f 1f 00 nopl (%rax)
28: 83 c0 01 add $0x1,%eax
2b:* 41 c6 44 15 00 00 movb $0x0,0x0(%r13,%rdx,1) <-- trapping instruction
31: 48 63 d0 movslq %eax,%rdx
34: 49 39 d6 cmp %rdx,%r14
37: 77 ef ja 0x28
39: 48 8b 55 c0 mov -0x40(%rbp),%rdx
3d: 4c 8b 6a 00 mov 0x0(%rdx),%r13
Code starting with the faulting instruction
===========================================
0: 41 c6 44 15 00 00 movb $0x0,0x0(%r13,%rdx,1)
6: 48 63 d0 movslq %eax,%rdx
9: 49 39 d6 cmp %rdx,%r14
c: 77 ef ja 0xfffffffffffffffd
e: 48 8b 55 c0 mov -0x40(%rbp),%rdx
12: 4c 8b 6a 00 mov 0x0(%rdx),%r13
[ 650.352956] RIP mincore_hole (mm/mincore.c:101 (discriminator 2))
[ 650.352956] RSP <ffff880279d5fd48>
[ 650.352956] CR2: ffff8802fdf03000
Thanks,
Sasha
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sasha.levin@oracle.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: linux-mm@kvack.org, Dave Hansen <dave.hansen@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
linux-kernel@vger.kernel.org, Dave Jones <davej@redhat.com>
Subject: Re: [PATCH 7/7] mincore: apply page table walker on do_mincore()
Date: Mon, 16 Jun 2014 17:14:51 -0400 [thread overview]
Message-ID: <539F5E4B.3090302@oracle.com> (raw)
In-Reply-To: <20140616164449.GB13264@nhori.bos.redhat.com>
On 06/16/2014 12:44 PM, Naoya Horiguchi wrote:
> Hi Sasha,
>
> Thanks for bug reporting.
>
> On Mon, Jun 16, 2014 at 11:24:16AM -0400, Sasha Levin wrote:
>> On 06/06/2014 06:58 PM, Naoya Horiguchi wrote:
>>> This patch makes do_mincore() use walk_page_vma(), which reduces many lines
>>> of code by using common page table walk code.
>>>
>>> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>>
>> Hi Naoya,
>>
>> This patch is causing a few issues on -next:
>>
>> [ 367.679282] BUG: sleeping function called from invalid context at mm/mincore.c:37
>
> cond_resched() in mincore_hugetlb() triggered this. This is done in common
> pagewalk code, so I should have removed it.
>
> ...
>> And:
>>
>> [ 391.118663] BUG: unable to handle kernel paging request at ffff880142aca000
>> [ 391.118663] IP: mincore_hole (mm/mincore.c:99 (discriminator 2))
>
> walk->pte_hole cannot assume walk->vma != NULL, so I should've checked it
> in mincore_hole() before using walk->vma.
>
> Could you try the following fixes?
That solved those two, but I'm seeing new ones:
[ 650.352956] BUG: unable to handle kernel paging request at ffff8802fdf03000
[ 650.352956] IP: mincore_hole (mm/mincore.c:101 (discriminator 2))
[ 650.352956] PGD 23bcd067 PUD 704b48067 PMD 704958067 PTE 80000002fdf03060
[ 650.352956] Oops: 0002 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[ 650.352956] Dumping ftrace buffer:
[ 650.352956] (ftrace buffer empty)
[ 650.352956] Modules linked in:
[ 650.352956] CPU: 12 PID: 15403 Comm: trinity-c363 Tainted: G W 3.15.0-next-20140616-sasha-00025-g0fd1f7d-dirty #657
[ 650.352956] task: ffff88027caf3000 ti: ffff880279d5c000 task.ti: ffff880279d5c000
[ 650.352956] RIP: mincore_hole (mm/mincore.c:101 (discriminator 2))
[ 650.352956] RSP: 0018:ffff880279d5fd48 EFLAGS: 00010202
[ 650.352956] RAX: 0000000000000001 RBX: 00007f2445400000 RCX: 0000000000000000
[ 650.352956] RDX: 0000000000000000 RSI: 00007f2445400000 RDI: 00007f2445200000
[ 650.352956] RBP: ffff880279d5fd88 R08: 0000000000000001 R09: ffff880000000100
[ 650.352956] R10: 0000000000000001 R11: 00007f2444126000 R12: 00007f2480000000
[ 650.352956] R13: ffff8802fdf03000 R14: 0000000000000200 R15: ffff8804e32f2000
[ 650.352956] FS: 00007f24899ec700(0000) GS:ffff8802ff000000(0000) knlGS:0000000000000000
[ 650.352956] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 650.352956] CR2: ffff8802fdf03000 CR3: 000000027c39b000 CR4: 00000000000006a0
[ 650.352956] DR0: 00000000006df000 DR1: 0000000000000000 DR2: 0000000000000000
[ 650.352956] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
[ 650.352956] Stack:
[ 650.352956] ffff880279d5fef0 0000000000000000 0000000000000000 00007f2445400000
[ 650.352956] 00007f2480000000 ffff880279d5fef0 00007f2445200000 ffff8804e30fd148
[ 650.352956] ffff880279d5fe38 ffffffff9c2d1c4d ffff880200000000 ffffffff9c1a0038
[ 650.352956] Call Trace:
[ 650.352956] walk_pgd_range (mm/pagewalk.c:73 mm/pagewalk.c:141 mm/pagewalk.c:170)
[ 650.352956] ? preempt_count_sub (kernel/sched/core.c:2602)
[ 650.352956] __walk_page_range (mm/pagewalk.c:264)
[ 650.352956] ? SyS_mincore (mm/mincore.c:160 mm/mincore.c:244 mm/mincore.c:212)
[ 650.352956] walk_page_vma (mm/pagewalk.c:376)
[ 650.352956] SyS_mincore (mm/mincore.c:177 mm/mincore.c:244 mm/mincore.c:212)
[ 650.352956] ? mincore_hugetlb (mm/mincore.c:143)
[ 650.352956] ? mincore_hole (mm/mincore.c:109)
[ 650.352956] ? mincore_page (mm/mincore.c:87)
[ 650.352956] ? copy_page_range (mm/mincore.c:24)
[ 650.352956] tracesys (arch/x86/kernel/entry_64.S:542)
[ 650.352956] Code: 87 a0 00 00 00 48 83 c3 01 48 8b b8 f8 01 00 00 e8 ab fe ff ff 48 8b 55 c8 88 02 49 63 c4 49 39 c6 77 cd eb 14 0f 1f 00 83 c0 01 <41> c6 44 15 00 00 48 63 d0 49 39 d6 77 ef 48 8b 55 c0 4c 8b 6a
All code
========
0: 87 a0 00 00 00 48 xchg %esp,0x48000000(%rax)
6: 83 c3 01 add $0x1,%ebx
9: 48 8b b8 f8 01 00 00 mov 0x1f8(%rax),%rdi
10: e8 ab fe ff ff callq 0xfffffffffffffec0
15: 48 8b 55 c8 mov -0x38(%rbp),%rdx
19: 88 02 mov %al,(%rdx)
1b: 49 63 c4 movslq %r12d,%rax
1e: 49 39 c6 cmp %rax,%r14
21: 77 cd ja 0xfffffffffffffff0
23: eb 14 jmp 0x39
25: 0f 1f 00 nopl (%rax)
28: 83 c0 01 add $0x1,%eax
2b:* 41 c6 44 15 00 00 movb $0x0,0x0(%r13,%rdx,1) <-- trapping instruction
31: 48 63 d0 movslq %eax,%rdx
34: 49 39 d6 cmp %rdx,%r14
37: 77 ef ja 0x28
39: 48 8b 55 c0 mov -0x40(%rbp),%rdx
3d: 4c 8b 6a 00 mov 0x0(%rdx),%r13
Code starting with the faulting instruction
===========================================
0: 41 c6 44 15 00 00 movb $0x0,0x0(%r13,%rdx,1)
6: 48 63 d0 movslq %eax,%rdx
9: 49 39 d6 cmp %rdx,%r14
c: 77 ef ja 0xfffffffffffffffd
e: 48 8b 55 c0 mov -0x40(%rbp),%rdx
12: 4c 8b 6a 00 mov 0x0(%rdx),%r13
[ 650.352956] RIP mincore_hole (mm/mincore.c:101 (discriminator 2))
[ 650.352956] RSP <ffff880279d5fd48>
[ 650.352956] CR2: ffff8802fdf03000
Thanks,
Sasha
next prev parent reply other threads:[~2014-06-16 21:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 22:58 [PATCH -mm 0/7] mm/pagewalk: standardize current users, move pmd locking, apply to mincore Naoya Horiguchi
2014-06-06 22:58 ` Naoya Horiguchi
2014-06-06 22:58 ` [PATCH 1/7] mm/pagewalk: remove pgd_entry() and pud_entry() Naoya Horiguchi
2014-06-06 22:58 ` Naoya Horiguchi
2014-06-06 22:58 ` [PATCH 2/7] mm/pagewalk: replace mm_walk->skip with more general mm_walk->control Naoya Horiguchi
2014-06-06 22:58 ` Naoya Horiguchi
2014-06-09 20:01 ` Dave Hansen
2014-06-09 20:01 ` Dave Hansen
2014-06-09 21:29 ` Naoya Horiguchi
[not found] ` <1402349339-n9udlcv2@n-horiguchi@ah.jp.nec.com>
2014-06-09 21:51 ` Dave Hansen
2014-06-09 21:51 ` Dave Hansen
2014-06-06 22:58 ` [PATCH 3/7] madvise: cleanup swapin_walk_pmd_entry() Naoya Horiguchi
2014-06-06 22:58 ` Naoya Horiguchi
2014-06-06 22:58 ` [PATCH 4/7] memcg: separate mem_cgroup_move_charge_pte_range() Naoya Horiguchi
2014-06-06 22:58 ` Naoya Horiguchi
2014-06-06 22:58 ` [PATCH 5/7] arch/powerpc/mm/subpage-prot.c: cleanup subpage_walk_pmd_entry() Naoya Horiguchi
2014-06-06 22:58 ` Naoya Horiguchi
2014-06-06 22:58 ` [PATCH 6/7] mm/pagewalk: move pmd_trans_huge_lock() from callbacks to common code Naoya Horiguchi
2014-06-06 22:58 ` Naoya Horiguchi
2014-06-09 20:04 ` Dave Hansen
2014-06-09 20:04 ` Dave Hansen
2014-06-09 21:35 ` Naoya Horiguchi
2014-06-06 22:58 ` [PATCH 7/7] mincore: apply page table walker on do_mincore() Naoya Horiguchi
2014-06-06 22:58 ` Naoya Horiguchi
2014-06-12 22:04 ` Andrew Morton
2014-06-12 22:04 ` Andrew Morton
2014-06-12 23:33 ` Naoya Horiguchi
2014-06-16 15:24 ` Sasha Levin
2014-06-16 15:24 ` Sasha Levin
2014-06-16 16:44 ` Naoya Horiguchi
2014-06-16 16:44 ` Naoya Horiguchi
2014-06-16 21:14 ` Sasha Levin [this message]
2014-06-16 21:14 ` Sasha Levin
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=539F5E4B.3090302@oracle.com \
--to=sasha.levin@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=davej@redhat.com \
--cc=hughd@google.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=n-horiguchi@ah.jp.nec.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 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.