Skip to content

Commit 4c3d043

Browse files
rhvgoyaldjbw
authored andcommitted
dax: Add a wakeup mode parameter to put_unlocked_entry()
As of now put_unlocked_entry() always wakes up next waiter. In next patches we want to wake up all waiters at one callsite. Hence, add a parameter to the function. This patch does not introduce any change of behavior. Reviewed-by: Greg Kurz <[email protected]> Reviewed-by: Jan Kara <[email protected]> Suggested-by: Dan Williams <[email protected]> Signed-off-by: Vivek Goyal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 698ab77 commit 4c3d043

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fs/dax.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,11 @@ static void wait_entry_unlocked(struct xa_state *xas, void *entry)
275275
finish_wait(wq, &ewait.wait);
276276
}
277277

278-
static void put_unlocked_entry(struct xa_state *xas, void *entry)
278+
static void put_unlocked_entry(struct xa_state *xas, void *entry,
279+
enum dax_wake_mode mode)
279280
{
280-
/* If we were the only waiter woken, wake the next one */
281281
if (entry && !dax_is_conflict(entry))
282-
dax_wake_entry(xas, entry, WAKE_NEXT);
282+
dax_wake_entry(xas, entry, mode);
283283
}
284284

285285
/*
@@ -633,7 +633,7 @@ struct page *dax_layout_busy_page_range(struct address_space *mapping,
633633
entry = get_unlocked_entry(&xas, 0);
634634
if (entry)
635635
page = dax_busy_page(entry);
636-
put_unlocked_entry(&xas, entry);
636+
put_unlocked_entry(&xas, entry, WAKE_NEXT);
637637
if (page)
638638
break;
639639
if (++scanned % XA_CHECK_SCHED)
@@ -675,7 +675,7 @@ static int __dax_invalidate_entry(struct address_space *mapping,
675675
mapping->nrexceptional--;
676676
ret = 1;
677677
out:
678-
put_unlocked_entry(&xas, entry);
678+
put_unlocked_entry(&xas, entry, WAKE_NEXT);
679679
xas_unlock_irq(&xas);
680680
return ret;
681681
}
@@ -954,7 +954,7 @@ static int dax_writeback_one(struct xa_state *xas, struct dax_device *dax_dev,
954954
return ret;
955955

956956
put_unlocked:
957-
put_unlocked_entry(xas, entry);
957+
put_unlocked_entry(xas, entry, WAKE_NEXT);
958958
return ret;
959959
}
960960

@@ -1695,7 +1695,7 @@ dax_insert_pfn_mkwrite(struct vm_fault *vmf, pfn_t pfn, unsigned int order)
16951695
/* Did we race with someone splitting entry or so? */
16961696
if (!entry || dax_is_conflict(entry) ||
16971697
(order == 0 && !dax_is_pte_entry(entry))) {
1698-
put_unlocked_entry(&xas, entry);
1698+
put_unlocked_entry(&xas, entry, WAKE_NEXT);
16991699
xas_unlock_irq(&xas);
17001700
trace_dax_insert_pfn_mkwrite_no_entry(mapping->host, vmf,
17011701
VM_FAULT_NOPAGE);

0 commit comments

Comments
 (0)