linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>, linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Matt Mackall <mpm@selenic.com>, Cliff Wickman <cpw@sgi.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Pavel Emelyanov <xemul@parallels.com>,
	Rik van Riel <riel@redhat.com>,
	kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 08/11] madvise: redefine callback functions for page table walker
Date: Thu, 20 Mar 2014 21:47:04 -0400	[thread overview]
Message-ID: <532B9A18.8020606@oracle.com> (raw)
In-Reply-To: <1392068676-30627-9-git-send-email-n-horiguchi@ah.jp.nec.com>

On 02/10/2014 04:44 PM, Naoya Horiguchi wrote:
> swapin_walk_pmd_entry() is defined as pmd_entry(), but it has no code
> about pmd handling (except pmd_none_or_trans_huge_or_clear_bad, but the
> same check are now done in core page table walk code).
> So let's move this function on pte_entry() as swapin_walk_pte_entry().
>
> Signed-off-by: Naoya Horiguchi<n-horiguchi@ah.jp.nec.com>

This patch seems to generate:

[  305.267354] =================================
[  305.268051] [ INFO: inconsistent lock state ]
[  305.268678] 3.14.0-rc7-next-20140320-sasha-00015-gd752393-dirty #261 Tainted: G        W
[  305.269992] ---------------------------------
[  305.270152] inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage.
[  305.270152] trinity-c57/13619 [HC0[0]:SC0[0]:HE1:SE1] takes:
[  305.270152]  (&(ptlock_ptr(page))->rlock#2){+.+.?.}, at: walk_pte_range (include/linux/spinlock.h:303 mm/pagewalk.c:33)
[  305.270152] {IN-RECLAIM_FS-W} state was registered at:
[  305.270152]   mark_irqflags (kernel/locking/lockdep.c:2821)
[  305.270152]   __lock_acquire (kernel/locking/lockdep.c:3138)
[  305.270152]   lock_acquire (arch/x86/include/asm/current.h:14 kernel/locking/lockdep.c:3602)
[  305.270152]   _raw_spin_lock (include/linux/spinlock_api_smp.h:143 kernel/locking/spinlock.c:151)
[  305.270152]   __page_check_address (include/linux/spinlock.h:303 mm/rmap.c:624)
[  305.270152]   page_referenced_one (mm/rmap.c:706)
[  305.270152]   rmap_walk_anon (mm/rmap.c:1613)
[  305.270152]   rmap_walk (mm/rmap.c:1685)
[  305.270152]   page_referenced (mm/rmap.c:802)
[  305.270152]   shrink_active_list (mm/vmscan.c:1704)
[  305.270152]   balance_pgdat (mm/vmscan.c:2741 mm/vmscan.c:2996)
[  305.270152]   kswapd (mm/vmscan.c:3296)
[  305.270152]   kthread (kernel/kthread.c:216)
[  305.270152]   ret_from_fork (arch/x86/kernel/entry_64.S:555)
[  305.270152] irq event stamp: 20863
[  305.270152] hardirqs last  enabled at (20863): alloc_pages_vma (arch/x86/include/asm/paravirt.h:809 include/linux/seqlock.h:81 include/linux/seqlock.h:146 include/linux/cpus
et.h:98 mm/mempolicy.c:1990)
[  305.270152] hardirqs last disabled at (20862): alloc_pages_vma (include/linux/seqlock.h:79 include/linux/seqlock.h:146 include/linux/cpuset.h:98 mm/mempolicy.c:1990)
[  305.270152] softirqs last  enabled at (19858): __do_softirq (arch/x86/include/asm/preempt.h:22 kernel/softirq.c:298)
[  305.270152] softirqs last disabled at (19855): irq_exit (kernel/softirq.c:348 kernel/softirq.c:389)
[  305.270152]
[  305.270152] other info that might help us debug this:
[  305.270152]  Possible unsafe locking scenario:
[  305.270152]
[  305.270152]        CPU0
[  305.270152]        ----
[  305.270152]   lock(&(ptlock_ptr(page))->rlock#2);
[  305.270152]   <Interrupt>
[  305.270152]     lock(&(ptlock_ptr(page))->rlock#2);
[  305.270152]
[  305.270152]  *** DEADLOCK ***
[  305.270152]
[  305.270152] 2 locks held by trinity-c57/13619:
[  305.270152]  #0:  (&mm->mmap_sem){++++++}, at: SyS_madvise (arch/x86/include/asm/current.h:14 mm/madvise.c:492 mm/madvise.c:448)
[  305.270152]  #1:  (&(ptlock_ptr(page))->rlock#2){+.+.?.}, at: walk_pte_range (include/linux/spinlock.h:303 mm/pagewalk.c:33)
[  305.270152]
[  305.270152] stack backtrace:
[  305.270152] CPU: 23 PID: 13619 Comm: trinity-c57 Tainted: G        W     3.14.0-rc7-next-20140320-sasha-00015-gd752393-dirty #261
[  305.270152]  ffff8804ab8e0d28 ffff8804ab9c5968 ffffffff844b76e7 0000000000000001
[  305.270152]  ffff8804ab8e0000 ffff8804ab9c59c8 ffffffff811a55f7 0000000000000000
[  305.270152]  0000000000000001 ffff880400000001 ffffffff87e18ed8 000000000000000a
[  305.270152] Call Trace:
[  305.270152]  dump_stack (lib/dump_stack.c:52)
[  305.270152]  print_usage_bug (kernel/locking/lockdep.c:2254)
[  305.270152]  ? check_usage_forwards (kernel/locking/lockdep.c:2371)
[  305.270152]  mark_lock_irq (kernel/locking/lockdep.c:2465)
[  305.270152]  mark_lock (kernel/locking/lockdep.c:2920)
[  305.270152]  mark_held_locks (kernel/locking/lockdep.c:2523)
[  305.270152]  lockdep_trace_alloc (kernel/locking/lockdep.c:2745 kernel/locking/lockdep.c:2760)
[  305.270152]  __alloc_pages_nodemask (mm/page_alloc.c:2722)
[  305.270152]  ? mark_held_locks (kernel/locking/lockdep.c:2523)
[  305.270152]  ? alloc_pages_vma (arch/x86/include/asm/paravirt.h:809 include/linux/seqlock.h:81 include/linux/seqlock.h:146 include/linux/cpuset.h:98 mm/mempolicy.c:1990)
[  305.270152]  alloc_pages_vma (include/linux/mempolicy.h:76 mm/mempolicy.c:2006)
[  305.270152]  ? read_swap_cache_async (mm/swap_state.c:328)
[  305.270152]  ? __const_udelay (arch/x86/lib/delay.c:126)
[  305.270152]  read_swap_cache_async (mm/swap_state.c:328)
[  305.270152]  ? walk_pte_range (include/linux/spinlock.h:303 mm/pagewalk.c:33)
[  305.270152]  swapin_walk_pte_entry (mm/madvise.c:152)
[  305.270152]  walk_pte_range (mm/pagewalk.c:47)
[  305.270152]  ? sched_clock (arch/x86/include/asm/paravirt.h:192 arch/x86/kernel/tsc.c:305)
[  305.270152]  walk_pmd_range (mm/pagewalk.c:90)
[  305.270152]  ? sched_clock (arch/x86/include/asm/paravirt.h:192 arch/x86/kernel/tsc.c:305)
[  305.270152]  ? kvm_clock_read (arch/x86/include/asm/preempt.h:90 arch/x86/kernel/kvmclock.c:86)
[  305.270152]  walk_pud_range (mm/pagewalk.c:128)
[  305.270152]  walk_pgd_range (mm/pagewalk.c:165)
[  305.270152]  __walk_page_range (mm/pagewalk.c:259)
[  305.270152]  walk_page_range (mm/pagewalk.c:333)
[  305.270152]  madvise_willneed (mm/madvise.c:167 mm/madvise.c:211)
[  305.270152]  ? madvise_hwpoison (mm/madvise.c:140)
[  305.270152]  madvise_vma (mm/madvise.c:369)
[  305.270152]  ? find_vma (mm/mmap.c:2021)
[  305.270152]  SyS_madvise (mm/madvise.c:518 mm/madvise.c:448)
[  305.270152]  ia32_do_call (arch/x86/ia32/ia32entry.S:430)


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>

  reply	other threads:[~2014-03-21  1:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 21:44 [PATCH 00/11 v5] update page table walker Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 01/11] pagewalk: update page table walker core Naoya Horiguchi
2014-02-12  5:39   ` Joonsoo Kim
2014-02-12 15:40     ` Naoya Horiguchi
2014-02-20 23:47   ` Sasha Levin
2014-02-21  3:20     ` Naoya Horiguchi
2014-02-21  4:30     ` Sasha Levin
     [not found]     ` <5306c629.012ce50a.6c48.ffff9844SMTPIN_ADDED_BROKEN@mx.google.com>
2014-02-21  6:43       ` Sasha Levin
2014-02-21 16:35         ` Naoya Horiguchi
     [not found]         ` <1393000553-ocl81482@n-horiguchi@ah.jp.nec.com>
2014-02-21 16:50           ` Sasha Levin
2014-06-02 23:49   ` Dave Hansen
2014-06-03  0:29     ` Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 02/11] pagewalk: add walk_page_vma() Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 03/11] smaps: redefine callback functions for page table walker Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 04/11] clear_refs: " Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 05/11] pagemap: " Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 06/11] numa_maps: " Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 07/11] memcg: " Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 08/11] madvise: " Naoya Horiguchi
2014-03-21  1:47   ` Sasha Levin [this message]
2014-03-21  2:43     ` [PATCH] madvise: fix locking in force_swapin_readahead() (Re: [PATCH 08/11] madvise: redefine callback functions for page table walker) Naoya Horiguchi
2014-03-21  5:16       ` Hugh Dickins
2014-03-21  6:22         ` Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 09/11] arch/powerpc/mm/subpage-prot.c: use walk_page_vma() instead of walk_page_range() Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 10/11] pagewalk: remove argument hmask from hugetlb_entry() Naoya Horiguchi
2014-02-10 21:44 ` [PATCH 11/11] mempolicy: apply page table walker on queue_pages_range() Naoya Horiguchi
2014-02-21  6:30   ` Sasha Levin
2014-02-21 16:58     ` Naoya Horiguchi
     [not found]     ` <530785b2.d55c8c0a.3868.ffffa4e1SMTPIN_ADDED_BROKEN@mx.google.com>
2014-02-21 17:18       ` Sasha Levin
2014-02-21 17:25         ` Naoya Horiguchi
     [not found]         ` <1393003512-qjyhnu0@n-horiguchi@ah.jp.nec.com>
2014-02-23 13:04           ` Sasha Levin
2014-02-23 18:59             ` Naoya Horiguchi
2014-02-10 22:42 ` [PATCH 00/11 v5] update page table walker Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2014-01-13 16:54 [PATCH 00/11 v4] " Naoya Horiguchi
2014-01-13 16:54 ` [PATCH 08/11] madvise: redefine callback functions for " Naoya Horiguchi
2013-12-11 22:08 [PATCH 00/11 v3] update " Naoya Horiguchi
2013-12-11 22:09 ` [PATCH 08/11] madvise: redefine callback functions for " Naoya Horiguchi
2013-10-30 21:44 [PATCH 00/11 v2] update " Naoya Horiguchi
2013-10-30 21:44 ` [PATCH 08/11] madvise: redefine callback functions for " Naoya Horiguchi
2013-10-14 17:36 [PATCH 0/11] update " Naoya Horiguchi
2013-10-14 17:37 ` [PATCH 08/11] madvise: redefine callback functions for " Naoya Horiguchi

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=532B9A18.8020606@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cpw@sgi.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=mpm@selenic.com \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=riel@redhat.com \
    --cc=xemul@parallels.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;
as well as URLs for NNTP newsgroup(s).