Scroll to navigation

UNLOCK_PAGE(9) Memory Management in Linux UNLOCK_PAGE(9)

NAME

unlock_page - unlock a locked page

SYNOPSIS

void unlock_page(struct page * page);

ARGUMENTS

struct page * page

the page

DESCRIPTION

Unlocks the page and wakes up sleepers in ___wait_on_page_locked. Also wakes sleepers in wait_on_page_writeback because the wakeup mechanism between PageLocked pages and PageWriteback pages is shared. But that's OK - sleepers in wait_on_page_writeback just go back to sleep.

Note that this depends on PG_waiters being the sign bit in the byte that contains PG_locked - thus the BUILD_BUG_ON. That allows us to clear the PG_locked bit and test PG_waiters at the same time fairly portably (architectures that do LL/SC can test any bit, while x86 can test the sign bit).

COPYRIGHT

June 2017 Kernel Hackers Manual 4.11