generic: add regression test for DAX PTE/PMD races
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Wed, 17 May 2017 17:17:42 +0000 (11:17 -0600)
committerEryu Guan <eguan@redhat.com>
Thu, 18 May 2017 04:04:15 +0000 (12:04 +0800)
commit44f649f632a88963bd492c7457166a9905493cf9
tree9d7e133a11520e198271ed8be1ea4dff8bb0cd46
parent2508d61b63edd3ded471cb8528fee607e45a7467
generic: add regression test for DAX PTE/PMD races

This adds a regression test for the following kernel patches:

  mm: avoid spurious 'bad pmd' warning messages
  dax: Fix race between colliding PMD & PTE entries

The above patches fix two related PMD vs PTE races in the DAX code.
These can both be easily triggered by having two threads reading and
writing simultaneously to the same private mapping, with the key
being that private mapping reads can be handled with PMDs but
private mapping writes are always handled with PTEs so that we can
COW.

Without this 2-patch kernel series, the newly added test will result
in the following errors:

  run fstests generic/437 at 2017-05-16 16:53:43
  mm/pgtable-generic.c:39: bad pmd ffff8808daa49b88(84000001006000a5)
   ... a bunch of the bad pmd messages ...
  BUG: Bad rss-counter state mm:ffff8800a8c1b700 idx:1 val:1
  BUG: non-zero nr_ptes on freeing mm: 38
  XFS (pmem0p1): Unmounting Filesystem

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
.gitignore
src/Makefile
src/t_mmap_cow_race.c [new file with mode: 0644]
tests/generic/437 [new file with mode: 0755]
tests/generic/437.out [new file with mode: 0644]
tests/generic/group