Futex update III: don't use put_page...
PATCH 1/1 Futex update III: don't use put_page...
I know nothing of VM, but put_page on a page on the LRU list hits a BUG() inside __free_pages_ok(). Andrew Morton said this was right.
Name: Unpin page bug fix.
Author: Rusty Russell
Status: Tested on 2.5.20
D: This uses page_cache_release() instead of put_page(), as it might
D: be a pagecache page.
kernel/futex.c +10 -1
@@ -33,6 +33,7 @@#include <linux/futex.h> #include <linux/highmem.h> #include <linux/time.h> +#include <linux/pagemap.h> #include <asm/uaccess.h> /* These mutexes are a very simple counter: the winner is the one who
@@ -69,6 +70,14 @@return &futex_queues[hash_long (h,FUTEX_HASHBITS )]; } +static inline void unpin_page (struct page *page) +{ +/* Avoid releasing the page which is on the LRU list. I don't +know if this is correct, but it stops the BUG() in +__free_pages_ok(). */ +page_cache_release (page); +} + static int futex_wake(struct list_head *head, struct page *page, unsigned int offset,
@@ -218,7 +227,7 @@default : ret = -EINVAL ; } -put_page (page); +unpin_page (page);return ret; }
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.