Skip to content

Commit

Permalink
fs/dax: Fix pmd vs pte conflict detection
Browse files Browse the repository at this point in the history
Users reported a v5.3 performance regression and inability to establish
huge page mappings. A revised version of the ndctl "dax.sh" huge page
unit test identifies commit 23c84eb "dax: Fix missed wakeup with
PMD faults" as the source.

Update get_unlocked_entry() to check for NULL entries before checking
the entry order, otherwise NULL is misinterpreted as a present pte
conflict. The 'order' check needs to happen before the locked check as
an unlocked entry at the wrong order must fallback to lookup the correct
order.

Reported-by: Jeff Smits <[email protected]>
Reported-by: Doug Nelson <[email protected]>
Cc: <[email protected]>
Fixes: 23c84eb ("dax: Fix missed wakeup with PMD faults")
Reviewed-by: Jan Kara <[email protected]>
Cc: Jeff Moyer <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Link: https://lore.kernel.org/r/157167532455.3945484.11971474077040503994.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
djbw committed Oct 23, 2019
1 parent 4f5cafb commit 6370740
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/dax.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ static void *get_unlocked_entry(struct xa_state *xas, unsigned int order)

for (;;) {
entry = xas_find_conflict(xas);
if (!entry || WARN_ON_ONCE(!xa_is_value(entry)))
return entry;
if (dax_entry_order(entry) < order)
return XA_RETRY_ENTRY;
if (!entry || WARN_ON_ONCE(!xa_is_value(entry)) ||
!dax_is_locked(entry))
if (!dax_is_locked(entry))
return entry;

wq = dax_entry_waitqueue(xas, entry, &ewait.key);
Expand Down

0 comments on commit 6370740

Please sign in to comment.