Skip to content

Commit 41e4e7f

Browse files
Matthew Wilcox (Oracle)opsiff
authored andcommitted
filemap: remove use of wait bookmarks
mainline inclusion from mainline-v6.7-rc1 category: bugfix 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/20231010035829.544242-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Bin Lai <sclaibin@gmail.com> Cc: Benjamin Segall <bsegall@google.com> Cc: Daniel Bristot de Oliveira <bristot@redhat.com> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt (Google) <rostedt@goodmis.org> Cc: Valentin Schneider <vschneid@redhat.com> Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit b0b598e) Change-Id: I1566d45a8673091974f7d35272b5d251d27b030b
1 parent db5216c commit 41e4e7f

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

mm/filemap.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,32 +1163,13 @@ static void folio_wake_bit(struct folio *folio, int bit_nr)
11631163
wait_queue_head_t *q = folio_waitqueue(folio);
11641164
struct wait_page_key key;
11651165
unsigned long flags;
1166-
wait_queue_entry_t bookmark;
11671166

11681167
key.folio = folio;
11691168
key.bit_nr = bit_nr;
11701169
key.page_match = 0;
11711170

1172-
bookmark.flags = 0;
1173-
bookmark.private = NULL;
1174-
bookmark.func = NULL;
1175-
INIT_LIST_HEAD(&bookmark.entry);
1176-
11771171
spin_lock_irqsave(&q->lock, flags);
1178-
__wake_up_locked_key_bookmark(q, TASK_NORMAL, &key, &bookmark);
1179-
1180-
while (bookmark.flags & WQ_FLAG_BOOKMARK) {
1181-
/*
1182-
* Take a breather from holding the lock,
1183-
* allow pages that finish wake up asynchronously
1184-
* to acquire the lock and remove themselves
1185-
* from wait queue
1186-
*/
1187-
spin_unlock_irqrestore(&q->lock, flags);
1188-
cpu_relax();
1189-
spin_lock_irqsave(&q->lock, flags);
1190-
__wake_up_locked_key_bookmark(q, TASK_NORMAL, &key, &bookmark);
1191-
}
1172+
__wake_up_locked_key(q, TASK_NORMAL, &key);
11921173

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

0 commit comments

Comments
 (0)