summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-07-23 12:33:41 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-02 20:39:44 -0700
commitc6fe44d96fc1536af5b11cd859686453d1b7bfd1 (patch)
tree189b4815c4bc68a6bd65c833f6b38cc7ca4088fb /mm
parent2a9127fcf2296674d58024f83981f40b128fffea (diff)
downloadlwn-c6fe44d96fc1536af5b11cd859686453d1b7bfd1.tar.gz
lwn-c6fe44d96fc1536af5b11cd859686453d1b7bfd1.zip
list: add "list_del_init_careful()" to go with "list_empty_careful()"
That gives us ordering guarantees around the pair. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 8c3d3e233d37..991503bbf922 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1041,13 +1041,8 @@ static int wake_page_function(wait_queue_entry_t *wait, unsigned mode, int sync,
* since after list_del_init(&wait->entry) the wait entry
* might be de-allocated and the process might even have
* exited.
- *
- * We _really_ should have a "list_del_init_careful()" to
- * properly pair with the unlocked "list_empty_careful()"
- * in finish_wait().
*/
- smp_mb();
- list_del_init(&wait->entry);
+ list_del_init_careful(&wait->entry);
return ret;
}