Skip to content

Commit b0b598e

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
filemap: remove use of wait bookmarks
The original problem of the overly long list of waiters on a locked page was solved properly by commit 9a1ea43 ("mm: put_and_wait_on_page_locked() while page is migrated"). In the meantime, using bookmarks for the writeback bit can cause livelocks, so we need to stop using them. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Bin Lai <[email protected]> Cc: Benjamin Segall <[email protected]> Cc: Daniel Bristot de Oliveira <[email protected]> Cc: Dietmar Eggemann <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt (Google) <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Vincent Guittot <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 9b91432 commit b0b598e

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

mm/filemap.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,32 +1133,13 @@ static void folio_wake_bit(struct folio *folio, int bit_nr)
11331133
wait_queue_head_t *q = folio_waitqueue(folio);
11341134
struct wait_page_key key;
11351135
unsigned long flags;
1136-
wait_queue_entry_t bookmark;
11371136

11381137
key.folio = folio;
11391138
key.bit_nr = bit_nr;
11401139
key.page_match = 0;
11411140

1142-
bookmark.flags = 0;
1143-
bookmark.private = NULL;
1144-
bookmark.func = NULL;
1145-
INIT_LIST_HEAD(&bookmark.entry);
1146-
11471141
spin_lock_irqsave(&q->lock, flags);
1148-
__wake_up_locked_key_bookmark(q, TASK_NORMAL, &key, &bookmark);
1149-
1150-
while (bookmark.flags & WQ_FLAG_BOOKMARK) {
1151-
/*
1152-
* Take a breather from holding the lock,
1153-
* allow pages that finish wake up asynchronously
1154-
* to acquire the lock and remove themselves
1155-
* from wait queue
1156-
*/
1157-
spin_unlock_irqrestore(&q->lock, flags);
1158-
cpu_relax();
1159-
spin_lock_irqsave(&q->lock, flags);
1160-
__wake_up_locked_key_bookmark(q, TASK_NORMAL, &key, &bookmark);
1161-
}
1142+
__wake_up_locked_key(q, TASK_NORMAL, &key);
11621143

11631144
/*
11641145
* It's possible to miss clearing waiters here, when we woke our page

0 commit comments

Comments
 (0)