Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-07-30 Thread Matthew Wilcox
On Fri, Jul 27, 2018 at 11:20:35AM -0600, Ross Zwisler wrote:
> Okay, the next failure I'm hitting is with DAX + XFS + generic/344.  It
> doesn't happen every time, but I can usually recreate it within 10 iterations
> of the test.  Here's the failure:

Thanks.  I've made some progress with this; the WARNing is coming from
a vm_insert_* mkwrite call.  Inserting sufficient debugging code has
let me determine we still have a zero_pfn in the page table when we're
trying to insert a new PFN.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-07-27 Thread Ross Zwisler
On Wed, Jul 25, 2018 at 02:03:23PM -0700, Matthew Wilcox wrote:
> On Wed, Jun 27, 2018 at 01:44:38PM -0600, Ross Zwisler wrote:
> > On Wed, Jun 27, 2018 at 04:05:29AM -0700, Matthew Wilcox wrote:
> > > On Tue, Jun 19, 2018 at 10:16:38AM -0700, Matthew Wilcox wrote:
> > > > I think I see a bug.  No idea if it's the one you're hitting ;-)
> > > > 
> > > > I had been intending to not use the 'entry' to decide whether we were
> > > > waiting on a 2MB or 4kB page, but rather the xas.  I shelved that idea,
> > > > but not before dropping the DAX_PMD flag being passed from the PMD
> > > > pagefault caller.  So if I put that back ...
> > > 
> > > Did you get a chance to test this?
> > 
> > With this patch it doesn't deadlock, but the test dies with a SIGBUS and we
> > hit a WARN_ON in the DAX code:
> > 
> > WARNING: CPU: 5 PID: 1678 at fs/dax.c:226 get_unlocked_entry+0xf7/0x120
> > 
> > I don't have a lot of time this week to debug further.  The quickest path to
> > victory is probably for you to get this reproducing in your test setup.  
> > Does
> > XFS + DAX + generic/340 pass for you?
> 
> I now have generic/340 passing.  I've pushed a new version to
> git://git.infradead.org/users/willy/linux-dax.git xarray

Okay, the next failure I'm hitting is with DAX + XFS + generic/344.  It
doesn't happen every time, but I can usually recreate it within 10 iterations
of the test.  Here's the failure:

generic/344 21s ...[ 1852.564559] run fstests generic/344 at 2018-07-27 11:19:05
[ 1853.033177] XFS (pmem0p2): Unmounting Filesystem
[ 1853.134497] XFS (pmem0p2): DAX enabled. Warning: EXPERIMENTAL, use at your 
own risk
[ 1853.135335] XFS (pmem0p2): Mounting V5 Filesystem
[ 1853.138119] XFS (pmem0p2): Ending clean mount
[ 1862.251185] WARNING: CPU: 10 PID: 15695 at mm/memory.c:1801 
insert_pfn+0x229/0x240
[ 1862.252023] Modules linked in: dax_pmem device_dax nd_pmem nd_btt nfit 
libnvdimm
[ 1862.252853] CPU: 10 PID: 15695 Comm: holetest Tainted: GW 
4.18.0-rc6-00077-gc79b37ebab6d-dirty #1
[ 1862.253979] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 
rel-1.11.1-0-g0551a4be2c-prebuilt.qemu-project.org 04/01/2014
[ 1862.255232] RIP: 0010:insert_pfn+0x229/0x240
[ 1862.255734] Code: 21 fa 4c 89 4d b0 48 89 45 c0 c6 05 3c 47 74 01 01 e8 db 
c2 e2 ff 0f 0b 44 8b 45 ac 4c 8b 4d b0 4c 8b 55 b8 48 8b 45 c0 eb 92 <0f> 0b e9 
45 fe ff ff 41 bf f4 ff ff ff e9 43 fe ff ff e8 50 c5 e2
[ 1862.257526] RSP: :c9000e197af8 EFLAGS: 00010216
[ 1862.257994] RAX: 2df7 RBX: 8800368ffe00 RCX: 0002
[ 1862.258673] RDX: 000f RSI: 000a RDI: 82df7225
[ 1862.259319] RBP: c9000e197b50 R08: 0001 R09: 8800b8fecd48
[ 1862.260097] R10: c9000e197a30 R11: 88010d649a80 R12: 8800bb616e80
[ 1862.260843] R13: 7fc2137c R14: 004521d4 R15: fff0
[ 1862.261563] FS:  7fc2157ff700() GS:88011580() 
knlGS:
[ 1862.262420] CS:  0010 DS:  ES:  CR0: 80050033
[ 1862.263003] CR2: 7fc2137c0c00 CR3: b866e000 CR4: 06e0
[ 1862.263631] Call Trace:
[ 1862.263862]  ? trace_hardirqs_on_caller+0xf4/0x190
[ 1862.264300]  __vm_insert_mixed+0x83/0xd0
[ 1862.264657]  vmf_insert_mixed_mkwrite+0x13/0x40
[ 1862.265066]  dax_iomap_pte_fault+0x760/0x1140
[ 1862.265478]  dax_iomap_fault+0x37/0x40
[ 1862.265816]  __xfs_filemap_fault+0x2de/0x310
[ 1862.266207]  xfs_filemap_page_mkwrite+0x15/0x20
[ 1862.266610]  xfs_filemap_pfn_mkwrite+0xe/0x10
[ 1862.267044]  do_wp_page+0x1bb/0x660
[ 1862.267435]  __handle_mm_fault+0xc78/0x1320
[ 1862.267912]  handle_mm_fault+0x1ba/0x3c0
[ 1862.268359]  __do_page_fault+0x2b4/0x590
[ 1862.268799]  do_page_fault+0x38/0x2c0
[ 1862.269218]  do_async_page_fault+0x2c/0xb0
[ 1862.269674]  ? async_page_fault+0x8/0x30
[ 1862.270081]  async_page_fault+0x1e/0x30
[ 1862.270431] RIP: 0033:0x401442
[ 1862.270709] Code: 1d 20 00 85 f6 0f 85 7d 00 00 00 48 85 db 7e 20 4b 8d 04 
34 31 d2 66 90 48 8b 0d 21 1d 20 00 48 0f af ca 48 83 c2 01 48 39 d3 <48> 89 2c 
08 75 e8 8b 0d de 1c 20 00 31 c0 85 c9 74 0a 8b 15 d6 1c
[ 1862.272811] RSP: 002b:7fc2157feec0 EFLAGS: 00010216
[ 1862.273392] RAX: 7fc213600c00 RBX: 1000 RCX: 001c
[ 1862.274182] RDX: 01c1 RSI:  RDI: 0001
[ 1862.274961] RBP: 7fc2157ff700 R08: 7fc2157ff700 R09: 7fc2157ff700
[ 1862.275740] R10: 7fc2157ff9d0 R11: 0202 R12: 7fc21360
[ 1862.276519] R13: 7ffe07faa240 R14: 0c00 R15: 7ffe07faa170
[ 1862.277296] irq event stamp: 13256
[ 1862.277666] hardirqs last  enabled at (13255): [] 
_raw_spin_unlock_irq+0x2c/0x60
[ 1862.278630] hardirqs last disabled at (13256): [] 
error_entry+0x93/0x110
[ 1862.279510] softirqs last  enabled at (13250): [] 
__do_softirq+0x3bf/0x520
[ 1862.280410] softirqs last disabled at (13229): [] 
irq_exit+0xe8/0xf0
[ 1862.281251] ---[ end trace 

Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-07-25 Thread Ross Zwisler
On Wed, Jul 25, 2018 at 02:03:23PM -0700, Matthew Wilcox wrote:
> On Wed, Jun 27, 2018 at 01:44:38PM -0600, Ross Zwisler wrote:
> > On Wed, Jun 27, 2018 at 04:05:29AM -0700, Matthew Wilcox wrote:
> > > On Tue, Jun 19, 2018 at 10:16:38AM -0700, Matthew Wilcox wrote:
> > > > I think I see a bug.  No idea if it's the one you're hitting ;-)
> > > > 
> > > > I had been intending to not use the 'entry' to decide whether we were
> > > > waiting on a 2MB or 4kB page, but rather the xas.  I shelved that idea,
> > > > but not before dropping the DAX_PMD flag being passed from the PMD
> > > > pagefault caller.  So if I put that back ...
> > > 
> > > Did you get a chance to test this?
> > 
> > With this patch it doesn't deadlock, but the test dies with a SIGBUS and we
> > hit a WARN_ON in the DAX code:
> > 
> > WARNING: CPU: 5 PID: 1678 at fs/dax.c:226 get_unlocked_entry+0xf7/0x120
> > 
> > I don't have a lot of time this week to debug further.  The quickest path to
> > victory is probably for you to get this reproducing in your test setup.  
> > Does
> > XFS + DAX + generic/340 pass for you?
> 
> I now have generic/340 passing.  I've pushed a new version to
> git://git.infradead.org/users/willy/linux-dax.git xarray

Thanks, I'll throw it in my test setup.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-07-25 Thread Matthew Wilcox
On Wed, Jun 27, 2018 at 01:44:38PM -0600, Ross Zwisler wrote:
> On Wed, Jun 27, 2018 at 04:05:29AM -0700, Matthew Wilcox wrote:
> > On Tue, Jun 19, 2018 at 10:16:38AM -0700, Matthew Wilcox wrote:
> > > I think I see a bug.  No idea if it's the one you're hitting ;-)
> > > 
> > > I had been intending to not use the 'entry' to decide whether we were
> > > waiting on a 2MB or 4kB page, but rather the xas.  I shelved that idea,
> > > but not before dropping the DAX_PMD flag being passed from the PMD
> > > pagefault caller.  So if I put that back ...
> > 
> > Did you get a chance to test this?
> 
> With this patch it doesn't deadlock, but the test dies with a SIGBUS and we
> hit a WARN_ON in the DAX code:
> 
> WARNING: CPU: 5 PID: 1678 at fs/dax.c:226 get_unlocked_entry+0xf7/0x120
> 
> I don't have a lot of time this week to debug further.  The quickest path to
> victory is probably for you to get this reproducing in your test setup.  Does
> XFS + DAX + generic/340 pass for you?

I now have generic/340 passing.  I've pushed a new version to
git://git.infradead.org/users/willy/linux-dax.git xarray


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-06-28 Thread Ross Zwisler
On Thu, Jun 28, 2018 at 01:39:09AM -0700, Matthew Wilcox wrote:
> On Wed, Jun 27, 2018 at 01:44:38PM -0600, Ross Zwisler wrote:
> > On Wed, Jun 27, 2018 at 04:05:29AM -0700, Matthew Wilcox wrote:
> > > On Tue, Jun 19, 2018 at 10:16:38AM -0700, Matthew Wilcox wrote:
> > > > I think I see a bug.  No idea if it's the one you're hitting ;-)
> > > > 
> > > > I had been intending to not use the 'entry' to decide whether we were
> > > > waiting on a 2MB or 4kB page, but rather the xas.  I shelved that idea,
> > > > but not before dropping the DAX_PMD flag being passed from the PMD
> > > > pagefault caller.  So if I put that back ...
> > > 
> > > Did you get a chance to test this?
> > 
> > With this patch it doesn't deadlock, but the test dies with a SIGBUS and we
> > hit a WARN_ON in the DAX code:
> > 
> > WARNING: CPU: 5 PID: 1678 at fs/dax.c:226 get_unlocked_entry+0xf7/0x120
> > 
> > I don't have a lot of time this week to debug further.  The quickest path to
> > victory is probably for you to get this reproducing in your test setup.  
> > Does
> > XFS + DAX + generic/340 pass for you?
> 
> I won't be back in front of my test box until Tuesday, but that test
> does work for me because I couldn't get your instructions to give me a
> 2MB aligned DAX setup.  I had to settle for 4k, so none of the 2MB stuff
> has been tested properly.

Ah.  I've documented both my qemu setup and my filesystem setup here:

https://nvdimm.wiki.kernel.org/pmem_in_qemu
https://nvdimm.wiki.kernel.org/2mib_fs_dax

This should be enough to get you up and running in QEMU and able to reliably
get filesystem DAX PMD faults.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-06-27 Thread Ross Zwisler
On Wed, Jun 27, 2018 at 04:05:29AM -0700, Matthew Wilcox wrote:
> On Tue, Jun 19, 2018 at 10:16:38AM -0700, Matthew Wilcox wrote:
> > I think I see a bug.  No idea if it's the one you're hitting ;-)
> > 
> > I had been intending to not use the 'entry' to decide whether we were
> > waiting on a 2MB or 4kB page, but rather the xas.  I shelved that idea,
> > but not before dropping the DAX_PMD flag being passed from the PMD
> > pagefault caller.  So if I put that back ...
> 
> Did you get a chance to test this?

With this patch it doesn't deadlock, but the test dies with a SIGBUS and we
hit a WARN_ON in the DAX code:

WARNING: CPU: 5 PID: 1678 at fs/dax.c:226 get_unlocked_entry+0xf7/0x120

I don't have a lot of time this week to debug further.  The quickest path to
victory is probably for you to get this reproducing in your test setup.  Does
XFS + DAX + generic/340 pass for you?

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-06-27 Thread Matthew Wilcox
On Tue, Jun 19, 2018 at 10:16:38AM -0700, Matthew Wilcox wrote:
> I think I see a bug.  No idea if it's the one you're hitting ;-)
> 
> I had been intending to not use the 'entry' to decide whether we were
> waiting on a 2MB or 4kB page, but rather the xas.  I shelved that idea,
> but not before dropping the DAX_PMD flag being passed from the PMD
> pagefault caller.  So if I put that back ...

Did you get a chance to test this?

> diff --git a/fs/dax.c b/fs/dax.c
> index 9919b6b545fb..75cc160d2f0b 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -367,13 +367,13 @@ static struct page *dax_busy_page(void *entry)
>   * a VM_FAULT code, encoded as an xarray internal entry.  The ERR_PTR values
>   * overlap with xarray value entries.
>   */
> -static
> -void *grab_mapping_entry(struct xa_state *xas, struct address_space *mapping)
> +static void *grab_mapping_entry(struct xa_state *xas,
> + struct address_space *mapping, unsigned long size)
>  {
>   bool pmd_downgrade = false; /* splitting 2MiB entry into 4k entries? */
>   void *locked = dax_make_entry(pfn_to_pfn_t(0),
> - DAX_EMPTY | DAX_LOCKED);
> - void *unlocked = dax_make_entry(pfn_to_pfn_t(0), DAX_EMPTY);
> + size | DAX_EMPTY | DAX_LOCKED);
> + void *unlocked = dax_make_entry(pfn_to_pfn_t(0), size | DAX_EMPTY);
>   void *entry;
>  
>  retry:
> @@ -1163,7 +1163,7 @@ static vm_fault_t dax_iomap_pte_fault(struct vm_fault 
> *vmf, pfn_t *pfnp,
>   if (write && !vmf->cow_page)
>   flags |= IOMAP_WRITE;
>  
> - entry = grab_mapping_entry(, mapping);
> + entry = grab_mapping_entry(, mapping, 0);
>   if (xa_is_internal(entry)) {
>   ret = xa_to_internal(entry);
>   goto out;
> @@ -1396,7 +1396,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault 
> *vmf, pfn_t *pfnp,
>* page is already in the tree, for instance), it will return
>* VM_FAULT_FALLBACK.
>*/
> - entry = grab_mapping_entry(, mapping);
> + entry = grab_mapping_entry(, mapping, DAX_PMD);
>   if (xa_is_internal(entry)) {
>   result = xa_to_internal(entry);
>   goto fallback;
> 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-06-19 Thread Matthew Wilcox
On Tue, Jun 19, 2018 at 10:40:37AM -0600, Ross Zwisler wrote:
> On Tue, Jun 19, 2018 at 02:22:30AM -0700, Matthew Wilcox wrote:
> > On Mon, Jun 18, 2018 at 09:12:57PM -0600, Ross Zwisler wrote:
> > > Hit another deadlock.  This one reproduces 100% of the time in my setup 
> > > with
> > > XFS + DAX + generic/340.  It doesn't reproduce for me at all with
> > > next-20180615.  Here's the output from "echo w > /proc/sysrq-trigger":
> > 
> > *sigh*.  I wonder what the differences are between our setups ...
> > 
> > > [   92.849119] sysrq: SysRq : Show Blocked State
> > > [   92.850506]   taskPC stack   pid father
> > > [   92.852299] holetestD0  1651   1466 0x
> > > [   92.853912] Call Trace:
> > > [   92.854610]  __schedule+0x2c5/0xad0
> > > [   92.855612]  schedule+0x36/0x90
> > > [   92.856602]  get_unlocked_entry+0xce/0x120
> > > [   92.857756]  ? dax_insert_entry+0x2b0/0x2b0
> > > [   92.858931]  grab_mapping_entry+0x19e/0x250
> > > [   92.860119]  dax_iomap_pte_fault+0x115/0x1140
> > > [   92.860836]  dax_iomap_fault+0x37/0x40
> > ...
> > > This looks very similar to the one I reported last week with generic/269.
> > 
> > Yeah, another missing wakeup, no doubt.  Can you bisect this?  That was
> > how I found the last one; bisected it to a single patch and stared very
> > hard at the patch until I saw it.  I'm not going to be in a position to
> > tinker with my DAX setup until the first week of July.
> 
> It bisected to this commit:
> 
> b4b4daa7e8fb0ad0fee35d3e28d00e97c849a6cb is the first bad commit
> commit b4b4daa7e8fb0ad0fee35d3e28d00e97c849a6cb
> Author: Matthew Wilcox 
> Date:   Thu Mar 29 22:58:27 2018 -0400
> 
> dax: Convert page fault handlers to XArray
> 
> This is the last part of DAX to be converted to the XArray so
> remove all the old helper functions.
> 
> Signed-off-by: Matthew Wilcox 

I think I see a bug.  No idea if it's the one you're hitting ;-)

I had been intending to not use the 'entry' to decide whether we were
waiting on a 2MB or 4kB page, but rather the xas.  I shelved that idea,
but not before dropping the DAX_PMD flag being passed from the PMD
pagefault caller.  So if I put that back ...


diff --git a/fs/dax.c b/fs/dax.c
index 9919b6b545fb..75cc160d2f0b 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -367,13 +367,13 @@ static struct page *dax_busy_page(void *entry)
  * a VM_FAULT code, encoded as an xarray internal entry.  The ERR_PTR values
  * overlap with xarray value entries.
  */
-static
-void *grab_mapping_entry(struct xa_state *xas, struct address_space *mapping)
+static void *grab_mapping_entry(struct xa_state *xas,
+   struct address_space *mapping, unsigned long size)
 {
bool pmd_downgrade = false; /* splitting 2MiB entry into 4k entries? */
void *locked = dax_make_entry(pfn_to_pfn_t(0),
-   DAX_EMPTY | DAX_LOCKED);
-   void *unlocked = dax_make_entry(pfn_to_pfn_t(0), DAX_EMPTY);
+   size | DAX_EMPTY | DAX_LOCKED);
+   void *unlocked = dax_make_entry(pfn_to_pfn_t(0), size | DAX_EMPTY);
void *entry;
 
 retry:
@@ -1163,7 +1163,7 @@ static vm_fault_t dax_iomap_pte_fault(struct vm_fault 
*vmf, pfn_t *pfnp,
if (write && !vmf->cow_page)
flags |= IOMAP_WRITE;
 
-   entry = grab_mapping_entry(, mapping);
+   entry = grab_mapping_entry(, mapping, 0);
if (xa_is_internal(entry)) {
ret = xa_to_internal(entry);
goto out;
@@ -1396,7 +1396,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault 
*vmf, pfn_t *pfnp,
 * page is already in the tree, for instance), it will return
 * VM_FAULT_FALLBACK.
 */
-   entry = grab_mapping_entry(, mapping);
+   entry = grab_mapping_entry(, mapping, DAX_PMD);
if (xa_is_internal(entry)) {
result = xa_to_internal(entry);
goto fallback;


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-06-19 Thread Ross Zwisler
On Tue, Jun 19, 2018 at 02:22:30AM -0700, Matthew Wilcox wrote:
> On Mon, Jun 18, 2018 at 09:12:57PM -0600, Ross Zwisler wrote:
> > Hit another deadlock.  This one reproduces 100% of the time in my setup with
> > XFS + DAX + generic/340.  It doesn't reproduce for me at all with
> > next-20180615.  Here's the output from "echo w > /proc/sysrq-trigger":
> 
> *sigh*.  I wonder what the differences are between our setups ...
> 
> > [   92.849119] sysrq: SysRq : Show Blocked State
> > [   92.850506]   taskPC stack   pid father
> > [   92.852299] holetestD0  1651   1466 0x
> > [   92.853912] Call Trace:
> > [   92.854610]  __schedule+0x2c5/0xad0
> > [   92.855612]  schedule+0x36/0x90
> > [   92.856602]  get_unlocked_entry+0xce/0x120
> > [   92.857756]  ? dax_insert_entry+0x2b0/0x2b0
> > [   92.858931]  grab_mapping_entry+0x19e/0x250
> > [   92.860119]  dax_iomap_pte_fault+0x115/0x1140
> > [   92.860836]  dax_iomap_fault+0x37/0x40
> ...
> > This looks very similar to the one I reported last week with generic/269.
> 
> Yeah, another missing wakeup, no doubt.  Can you bisect this?  That was
> how I found the last one; bisected it to a single patch and stared very
> hard at the patch until I saw it.  I'm not going to be in a position to
> tinker with my DAX setup until the first week of July.

It bisected to this commit:

b4b4daa7e8fb0ad0fee35d3e28d00e97c849a6cb is the first bad commit
commit b4b4daa7e8fb0ad0fee35d3e28d00e97c849a6cb
Author: Matthew Wilcox 
Date:   Thu Mar 29 22:58:27 2018 -0400

dax: Convert page fault handlers to XArray

This is the last part of DAX to be converted to the XArray so
remove all the old helper functions.

Signed-off-by: Matthew Wilcox 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-06-19 Thread Matthew Wilcox
On Mon, Jun 18, 2018 at 09:12:57PM -0600, Ross Zwisler wrote:
> Hit another deadlock.  This one reproduces 100% of the time in my setup with
> XFS + DAX + generic/340.  It doesn't reproduce for me at all with
> next-20180615.  Here's the output from "echo w > /proc/sysrq-trigger":

*sigh*.  I wonder what the differences are between our setups ...

> [   92.849119] sysrq: SysRq : Show Blocked State
> [   92.850506]   taskPC stack   pid father
> [   92.852299] holetestD0  1651   1466 0x
> [   92.853912] Call Trace:
> [   92.854610]  __schedule+0x2c5/0xad0
> [   92.855612]  schedule+0x36/0x90
> [   92.856602]  get_unlocked_entry+0xce/0x120
> [   92.857756]  ? dax_insert_entry+0x2b0/0x2b0
> [   92.858931]  grab_mapping_entry+0x19e/0x250
> [   92.860119]  dax_iomap_pte_fault+0x115/0x1140
> [   92.860836]  dax_iomap_fault+0x37/0x40
...
> This looks very similar to the one I reported last week with generic/269.

Yeah, another missing wakeup, no doubt.  Can you bisect this?  That was
how I found the last one; bisected it to a single patch and stared very
hard at the patch until I saw it.  I'm not going to be in a position to
tinker with my DAX setup until the first week of July.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-06-18 Thread Ross Zwisler
On Sat, Jun 16, 2018 at 06:59:38PM -0700, Matthew Wilcox wrote:
> The XArray is a replacement for the radix tree.  For the moment it uses
> the same data structures, enabling a gradual replacement.  This patch
> set implements the XArray and converts the page cache to use it.
> 
> A version of these patches has been running under xfstests for over
> 48 hours, so I have some confidence in them.  The DAX changes have now
> also had a reasonable test outing.  This is based on next-20180615 and
> is available as a git tree at
> git://git.infradead.org/users/willy/linux-dax.git xarray-20180615
> 
> I shall create a git branch from -rc1 and ask for that to be included in
> -next.  I'm a little concerned I still have no reviews on some of the
> later patches.
> 
> Changes since v13:
>  - Actually fixed bug in workingset conversion that led to exceptional
>entries not being deleted from the XArray.  Not sure how I dropped
>that patch for v13.  Thanks to David Sterba for noticing.
>  - Fixed bug in DAX writeback conversion that failed to wake up waiters.
>Thanks to Ross for testing, and to Dan & Jeff for helping me get a
>setup working to reproduce the problem.
>  - Converted the new dax_lock_page / dax_unlock_page functions.
>  - Moved XArray test suite entirely into the test_xarray kernel module
>to match other test suites.  It can still be built in userspace as
>part of the radix tree test suite.
>  - Changed email address.
>  - Moved a few functions into different patches to make the test-suite
>additions more logical.
>  - Fixed a bug in XA_BUG_ON (oh the irony) where it evaluated the
>condition twice.
>  - Constified xa_head() / xa_parent() / xa_entry() and their _locked
>variants.
>  - Moved xa_parent() to xarray.h so it can be used from the workingset code.
>  - Call the xarray testsuite from the radix tree test suite to ensure
>that I remember to run both test suites ;-)
>  - Added some more tests to the test suite.

Hit another deadlock.  This one reproduces 100% of the time in my setup with
XFS + DAX + generic/340.  It doesn't reproduce for me at all with
next-20180615.  Here's the output from "echo w > /proc/sysrq-trigger":

[   92.849119] sysrq: SysRq : Show Blocked State
[   92.850506]   taskPC stack   pid father
[   92.852299] holetestD0  1651   1466 0x
[   92.853912] Call Trace:
[   92.854610]  __schedule+0x2c5/0xad0
[   92.855612]  schedule+0x36/0x90
[   92.856602]  get_unlocked_entry+0xce/0x120
[   92.857756]  ? dax_insert_entry+0x2b0/0x2b0
[   92.858931]  grab_mapping_entry+0x19e/0x250
[   92.860119]  dax_iomap_pte_fault+0x115/0x1140
[   92.860836]  dax_iomap_fault+0x37/0x40
[   92.861235]  __xfs_filemap_fault+0x2de/0x310
[   92.861681]  xfs_filemap_fault+0x2c/0x30
[   92.862113]  __do_fault+0x26/0x160
[   92.862531]  __handle_mm_fault+0xc96/0x1320
[   92.863059]  handle_mm_fault+0x1ba/0x3c0
[   92.863534]  __do_page_fault+0x2b4/0x590
[   92.864029]  do_page_fault+0x38/0x2c0
[   92.864472]  do_async_page_fault+0x2c/0xb0
[   92.864985]  ? async_page_fault+0x8/0x30
[   92.865459]  async_page_fault+0x1e/0x30
[   92.865941] RIP: 0033:0x401442
[   92.866322] Code: Bad RIP value.
[   92.866739] RSP: 002b:7fa29c9feec0 EFLAGS: 00010212
[   92.867366] RAX: 7fa29ca00400 RBX: 1000 RCX: 8000
[   92.868219] RDX: 0009 RSI:  RDI: 
[   92.869082] RBP: 7fa29c9ff700 R08: 7fa29c9ff700 R09: 7fa29c9ff700
[   92.869939] R10: 0070 R11: 7fa29e571ba0 R12: 7fa29ca0
[   92.870804] R13: 7fffd5f24160 R14: 0400 R15: 7fffd5f240b0

This looks very similar to the one I reported last week with generic/269.

- Ross

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-06-16 Thread Matthew Wilcox
The XArray is a replacement for the radix tree.  For the moment it uses
the same data structures, enabling a gradual replacement.  This patch
set implements the XArray and converts the page cache to use it.

A version of these patches has been running under xfstests for over
48 hours, so I have some confidence in them.  The DAX changes have now
also had a reasonable test outing.  This is based on next-20180615 and
is available as a git tree at
git://git.infradead.org/users/willy/linux-dax.git xarray-20180615

I shall create a git branch from -rc1 and ask for that to be included in
-next.  I'm a little concerned I still have no reviews on some of the
later patches.

Changes since v13:
 - Actually fixed bug in workingset conversion that led to exceptional
   entries not being deleted from the XArray.  Not sure how I dropped
   that patch for v13.  Thanks to David Sterba for noticing.
 - Fixed bug in DAX writeback conversion that failed to wake up waiters.
   Thanks to Ross for testing, and to Dan & Jeff for helping me get a
   setup working to reproduce the problem.
 - Converted the new dax_lock_page / dax_unlock_page functions.
 - Moved XArray test suite entirely into the test_xarray kernel module
   to match other test suites.  It can still be built in userspace as
   part of the radix tree test suite.
 - Changed email address.
 - Moved a few functions into different patches to make the test-suite
   additions more logical.
 - Fixed a bug in XA_BUG_ON (oh the irony) where it evaluated the
   condition twice.
 - Constified xa_head() / xa_parent() / xa_entry() and their _locked
   variants.
 - Moved xa_parent() to xarray.h so it can be used from the workingset code.
 - Call the xarray testsuite from the radix tree test suite to ensure
   that I remember to run both test suites ;-)
 - Added some more tests to the test suite.

Matthew Wilcox (74):
  Update email address
  radix tree test suite: Enable ubsan
  dax: Fix use of zero page
  xarray: Replace exceptional entries
  xarray: Change definition of sibling entries
  xarray: Add definition of struct xarray
  xarray: Define struct xa_node
  xarray: Add documentation
  xarray: Add XArray load operation
  xarray: Add XArray tags
  xarray: Add XArray unconditional store operations
  xarray: Add XArray conditional store operations
  xarray: Add XArray iterators
  xarray: Extract entries from an XArray
  xarray: Destroy an XArray
  xarray: Step through an XArray
  xarray: Add xas_for_each_conflict
  xarray: Add xas_create_range
  xarray: Add MAINTAINERS entry
  page cache: Rearrange address_space
  page cache: Convert hole search to XArray
  page cache: Add and replace pages using the XArray
  page cache: Convert page deletion to XArray
  page cache: Convert find_get_entry to XArray
  page cache: Convert find_get_entries to XArray
  page cache: Convert find_get_pages_range to XArray
  page cache: Convert find_get_pages_contig to XArray
  page cache; Convert find_get_pages_range_tag to XArray
  page cache: Convert find_get_entries_tag to XArray
  page cache: Convert filemap_map_pages to XArray
  radix tree test suite: Convert regression1 to XArray
  page cache: Convert delete_batch to XArray
  page cache: Remove stray radix comment
  page cache: Convert filemap_range_has_page to XArray
  mm: Convert page-writeback to XArray
  mm: Convert workingset to XArray
  mm: Convert truncate to XArray
  mm: Convert add_to_swap_cache to XArray
  mm: Convert delete_from_swap_cache to XArray
  mm: Convert __do_page_cache_readahead to XArray
  mm: Convert page migration to XArray
  mm: Convert huge_memory to XArray
  mm: Convert collapse_shmem to XArray
  mm: Convert khugepaged_scan_shmem to XArray
  mm: Convert is_page_cache_freeable to XArray
  pagevec: Use xa_tag_t
  shmem: Convert shmem_radix_tree_replace to XArray
  shmem: Convert shmem_confirm_swap to XArray
  shmem: Convert find_swap_entry to XArray
  shmem: Convert shmem_add_to_page_cache to XArray
  shmem: Convert shmem_alloc_hugepage to XArray
  shmem: Convert shmem_free_swap to XArray
  shmem: Convert shmem_partial_swap_usage to XArray
  memfd: Convert memfd_wait_for_pins to XArray
  memfd: Convert memfd_tag_pins to XArray
  shmem: Comment fixups
  btrfs: Convert page cache to XArray
  fs: Convert buffer to XArray
  fs: Convert writeback to XArray
  nilfs2: Convert to XArray
  f2fs: Convert to XArray
  dax: Rename some functions
  dax: Hash on XArray instead of mapping
  dax: Convert dax_insert_pfn_mkwrite to XArray
  dax: Convert dax_layout_busy_page to XArray
  dax: Convert __dax_invalidate_entry to XArray
  dax: Convert dax writeback to XArray
  dax: Convert dax_lock_page to XArray
  dax: Convert page fault handlers to XArray
  page cache: Finish XArray conversion
  radix tree: Remove radix_tree_update_node_t
  radix tree: Remove split/join code
  radix tree: Remove radix_tree_maybe_preload_order
  radix tree: Remove radix_tree_clear_tags

 .clang-format |1 -
 .mailmap