From: "Williams, Dan J" <dan.j.williams@intel.com>
To: "hch@lst.de" <hch@lst.de>
Cc: "jglisse@redhat.com" <jglisse@redhat.com>,
"logang@deltatee.com" <logang@deltatee.com>,
"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: revamp vmem_altmap / dev_pagemap handling
Date: Fri, 8 Dec 2017 04:14:24 +0000 [thread overview]
Message-ID: <1512706457.2864.1.camel@intel.com> (raw)
In-Reply-To: <20171207150840.28409-1-hch@lst.de>
On Thu, 2017-12-07 at 07:08 -0800, Christoph Hellwig wrote:
> Hi all,
>
> this series started with two patches from Logan that now are in the
> middle of the series to kill the memremap-internal pgmap structure
> and to redo the dev_memreamp_pages interface to be better suitable
> for future PCI P2P uses. I reviewed them and noticed that there
> isn't really any good reason to keep struct vmem_altmap either,
> and that a lot of these alternative device page map access should
> be better abstracted out instead of being sprinkled all over the
> mm code.
>
> Please review carefully, this has only been tested with my legacy
> e820 NVDIMM system.
I get this lockdep report booting it on my test-VM. I'll take a closer
look next week... the fsdax-vs-hole-punch-vs-dma fix is on the top of
my queue.
[ 7.631431] =============================
[ 7.632668] WARNING: suspicious RCU usage
[ 7.633494] 4.15.0-rc2+ #942 Tainted: G O
[ 7.635262] -----------------------------
[ 7.636764] ./include/linux/rcupdate.h:302 Illegal context switch in RCU read-side critical section!
[ 7.640139]
[ 7.640139] other info that might help us debug this:
[ 7.640139]
[ 7.643382]
[ 7.643382] rcu_scheduler_active = 2, debug_locks = 1
[ 7.645814] 5 locks held by systemd-udevd/835:
[ 7.647546] #0: (&dev->mutex){....}, at: [<0000000064217991>] __driver_attach+0x58/0xe0
[ 7.650171] #1: (&dev->mutex){....}, at: [<00000000527f6e1a>] __driver_attach+0x66/0xe0
[ 7.652779] #2: (cpu_hotplug_lock.rw_sem){++++}, at: [<00000000a8b47692>] mem_hotplug_begin+0xa/0x20
[ 7.655677] #3: (mem_hotplug_lock.rw_sem){++++}, at: [<000000003d83cb2a>] percpu_down_write+0x27/0x120
[ 7.658649] #4: (rcu_read_lock){....}, at: [<00000000bcd32a45>] vmemmap_populate+0x0/0x373
[ 7.661133]
[ 7.661133] stack backtrace:
[ 7.662650] CPU: 22 PID: 835 Comm: systemd-udevd Tainted: G O 4.15.0-rc2+ #942
[ 7.665264] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
[ 7.668873] Call Trace:
[ 7.668879] dump_stack+0x7d/0xbe
[ 7.668885] ___might_sleep+0xe2/0x250
[ 7.668890] __alloc_pages_nodemask+0x107/0x3b0
[ 7.668901] vmemmap_alloc_block+0x5a/0xc1
[ 7.668904] vmemmap_populate+0x16c/0x373
[ 7.668915] sparse_mem_map_populate+0x23/0x33
[ 7.668917] sparse_add_one_section+0x45/0x179
[ 7.668924] __add_pages+0xc4/0x1f0
[ 7.668935] add_pages+0x15/0x70
[ 7.668939] devm_memremap_pages+0x293/0x440
[ 7.668954] pmem_attach_disk+0x4f4/0x620 [nd_pmem]
[ 7.668966] ? nd_dax_probe+0x105/0x140 [libnvdimm]
[ 7.668971] ? nd_dax_probe+0x105/0x140 [libnvdimm]
[ 7.668981] nvdimm_bus_probe+0x63/0x100 [libnvdimm]
[ 7.668988] driver_probe_device+0x2a8/0x490
[ 7.668993] __driver_attach+0xde/0xe0
[ 7.668997] ? driver_probe_device+0x490/0x490
[ 7.668998] bus_for_each_dev+0x6a/0xb0
[ 7.669002] bus_add_driver+0x16d/0x260
[ 7.669005] driver_register+0x57/0xc0
[ 7.669007] ? 0xffffffffa0083000
[ 7.669009] do_one_initcall+0x4e/0x18f
[ 7.669012] ? rcu_read_lock_sched_held+0x3f/0x70
[ 7.669014] ? kmem_cache_alloc_trace+0x2a0/0x310
[ 7.669020] do_init_module+0x5b/0x213
[ 7.669023] load_module+0x1873/0x1f10
[ 7.669029] ? show_coresize+0x30/0x30
[ 7.669035] ? vfs_read+0x131/0x150
[ 7.669052] ? SYSC_finit_module+0xd2/0x100
[ 7.669053] SYSC_finit_module+0xd2/0x100
[ 7.669067] do_syscall_64+0x66/0x230
[ 7.669070] entry_SYSCALL64_slow_path+0x25/0x25
[ 7.669072] RIP: 0033:0x7fc493dd8229
[ 7.669073] RSP: 002b:00007ffcaab453d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 7.669074] RAX: ffffffffffffffda RBX: 00005643cb407bb0 RCX: 00007fc493dd8229
[ 7.669075] RDX: 0000000000000000 RSI: 00007fc4949189c5 RDI: 000000000000000f
[ 7.669076] RBP: 00007fc4949189c5 R08: 0000000000000000 R09: 00007ffcaab454f0
[ 7.669076] R10: 000000000000000f R11: 0000000000000246 R12: 0000000000000000
[ 7.669077] R13: 00005643cb408010 R14: 0000000000020000 R15: 00005643c97c8dec
[ 7.669112] BUG: sleeping function called from invalid context at mm/page_alloc.c:4174
[ 7.669113] in_atomic(): 1, irqs_disabled(): 0, pid: 835, name: systemd-udevd
[ 7.669115] 5 locks held by systemd-udevd/835:
[ 7.669115] #0: (&dev->mutex){....}, at: [<0000000064217991>] __driver_attach+0x58/0xe0
[ 7.669120] #1: (&dev->mutex){....}, at: [<00000000527f6e1a>] __driver_attach+0x66/0xe0
[ 7.669123] #2: (cpu_hotplug_lock.rw_sem){++++}, at: [<00000000a8b47692>] mem_hotplug_begin+0xa/0x20
[ 7.669126] #3: (mem_hotplug_lock.rw_sem){++++}, at: [<000000003d83cb2a>] percpu_down_write+0x27/0x120
[ 7.669130] #4: (rcu_read_lock){....}, at: [<00000000bcd32a45>] vmemmap_populate+0x0/0x373
[ 7.669135] CPU: 22 PID: 835 Comm: systemd-udevd Tainted: G O 4.15.0-rc2+ #942
[ 7.669136] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
[ 7.669136] Call Trace:
[ 7.669139] dump_stack+0x7d/0xbe
[ 7.669142] ___might_sleep+0x21e/0x250
[ 7.669146] __alloc_pages_nodemask+0x107/0x3b0
[ 7.669154] vmemmap_alloc_block+0x5a/0xc1
[ 7.669157] vmemmap_populate+0x16c/0x373
[ 7.669167] sparse_mem_map_populate+0x23/0x33
[ 7.669170] sparse_add_one_section+0x45/0x179
[ 7.669176] __add_pages+0xc4/0x1f0
[ 7.669187] add_pages+0x15/0x70
[ 7.669189] devm_memremap_pages+0x293/0x440
[ 7.669199] pmem_attach_disk+0x4f4/0x620 [nd_pmem]
[ 7.669210] ? nd_dax_probe+0x105/0x140 [libnvdimm]
[ 7.669215] ? nd_dax_probe+0x105/0x140 [libnvdimm]
[ 7.669226] nvdimm_bus_probe+0x63/0x100 [libnvdimm]
[ 7.669232] driver_probe_device+0x2a8/0x490
[ 7.669237] __driver_attach+0xde/0xe0
[ 7.669240] ? driver_probe_device+0x490/0x490
[ 7.669242] bus_for_each_dev+0x6a/0xb0
[ 7.669247] bus_add_driver+0x16d/0x260
[ 7.669251] driver_register+0x57/0xc0
[ 7.669253] ? 0xffffffffa0083000
[ 7.669255] do_one_initcall+0x4e/0x18f
[ 7.669257] ? rcu_read_lock_sched_held+0x3f/0x70
[ 7.669259] ? kmem_cache_alloc_trace+0x2a0/0x310
[ 7.669267] do_init_module+0x5b/0x213
[ 7.669271] load_module+0x1873/0x1f10
[ 7.669276] ? show_coresize+0x30/0x30
[ 7.669283] ? vfs_read+0x131/0x150
[ 7.669309] ? SYSC_finit_module+0xd2/0x100
[ 7.669312] SYSC_finit_module+0xd2/0x100
[ 7.669332] do_syscall_64+0x66/0x230
[ 7.669336] entry_SYSCALL64_slow_path+0x25/0x25
[ 7.669337] RIP: 0033:0x7fc493dd8229
[ 7.669338] RSP: 002b:00007ffcaab453d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 7.669340] RAX: ffffffffffffffda RBX: 00005643cb407bb0 RCX: 00007fc493dd8229
[ 7.669341] RDX: 0000000000000000 RSI: 00007fc4949189c5 RDI: 000000000000000f
[ 7.669342] RBP: 00007fc4949189c5 R08: 0000000000000000 R09: 00007ffcaab454f0
[ 7.669344] R10: 000000000000000f R11: 0000000000000246 R12: 0000000000000000
[ 7.669345] R13: 00005643cb408010 R14: 0000000000020000 R15: 00005643c97c8dec
[ 7.680772] pmem2: detected capacity change from 0 to 33285996544
[ 7.834748] pmem0: detected capacity change from 0 to 4294967296
--
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>
prev parent reply other threads:[~2017-12-08 4:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 15:08 Christoph Hellwig
2017-12-07 15:08 ` [PATCH 01/14] mm: move get_dev_pagemap out of line Christoph Hellwig
2017-12-07 18:34 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 02/14] mm: optimize dev_pagemap reference counting around get_dev_pagemap Christoph Hellwig
2017-12-07 18:46 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 03/14] mm: better abstract out dev_pagemap freeing Christoph Hellwig
2017-12-07 18:49 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 04/14] mm: better abstract out dev_pagemap alloc Christoph Hellwig
2017-12-07 18:52 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 05/14] mm: better abstract out dev_pagemap offset calculation Christoph Hellwig
2017-12-07 18:54 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 06/14] mm: better abstract out dev_pagemap start_pfn Christoph Hellwig
2017-12-07 18:57 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 07/14] mm: split dev_pagemap memory map allocation from normal case Christoph Hellwig
2017-12-07 19:08 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 08/14] mm: merge vmem_altmap_alloc into dev_pagemap_alloc_block_buf Christoph Hellwig
2017-12-07 19:14 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 09/14] memremap: drop private struct page_map Christoph Hellwig
2017-12-07 15:08 ` [PATCH 10/14] memremap: change devm_memremap_pages interface to use struct dev_pagemap Christoph Hellwig
2017-12-08 4:03 ` Dan Williams
2017-12-07 15:08 ` [PATCH 11/14] memremap: simplify duplicate region handling in devm_memremap_pages Christoph Hellwig
2017-12-07 19:34 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 12/14] memremap: remove find_dev_pagemap Christoph Hellwig
2017-12-07 19:35 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 13/14] memremap: remove struct vmem_altmap Christoph Hellwig
2017-12-07 19:40 ` Logan Gunthorpe
2017-12-07 15:08 ` [PATCH 14/14] memremap: RCU protect data returned from dev_pagemap lookups Christoph Hellwig
2017-12-07 19:53 ` Logan Gunthorpe
2017-12-08 4:14 ` Williams, Dan J [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=1512706457.2864.1.camel@intel.com \
--to=dan.j.williams@intel.com \
--cc=hch@lst.de \
--cc=jglisse@redhat.com \
--cc=linux-mm@kvack.org \
--cc=linux-nvdimm@lists.01.org \
--cc=logang@deltatee.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