[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9948.1178626415@redhat.com>
Date: Tue, 08 May 2007 13:13:35 +0100
From: David Howells <dhowells@...hat.com>
To: Nick Piggin <npiggin@...e.de>
Cc: linux-arch@...r.kernel.org,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>
Subject: Re: [rfc] optimise unlock_page
Nick Piggin <npiggin@...e.de> wrote:
> This patch trades a page flag for a significant improvement in the unlock_page
> fastpath. Various problems in the previous version were spotted by Hugh and
> Ben (and fixed in this one).
It looks reasonable at first glance, though it does consume yet another page
flag:-/ However, I think that's probably a worthy trade.
> }
> -
> +
> +static inline void unlock_page(struct page *page)
> +{
> + VM_BUG_ON(!PageLocked(page));
> + ClearPageLocked_Unlock(page);
> + if (unlikely(PageWaiters(page)))
> + __unlock_page(page);
> +}
> +
Please don't simply discard the documentation, we have little enough as it is:
> -/**
> - * unlock_page - unlock a locked page
> - * @page: the page
> - *
> - * Unlocks the page and wakes up sleepers in ___wait_on_page_locked().
> - * Also wakes sleepers in wait_on_page_writeback() because the wakeup
> - * mechananism between PageLocked pages and PageWriteback pages is shared.
> - * But that's OK - sleepers in wait_on_page_writeback() just go back to sleep.
> - *
> - * The mb is necessary to enforce ordering between the clear_bit and the read
> - * of the waitqueue (to avoid SMP races with a parallel wait_on_page_locked()).
David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists