Re: [patch 2] mm: speculative get_page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nick Piggin wrote:
William Lee Irwin III wrote:

On Mon, Jun 27, 2005 at 04:32:38PM +1000, Nick Piggin wrote:

+static inline struct page *page_cache_get_speculative(struct page **pagep)
+{
+    struct page *page;
+
+    preempt_disable();
+    page = *pagep;
+    if (!page)
+        goto out_failed;
+
+    if (unlikely(get_page_testone(page))) {
+        /* Picked up a freed page */
+        __put_page(page);
+        goto out_failed;
+    }



So you pick up 0->1 refcount transitions.


Yep ie. a page that's freed or being freed.


Oh, one thing it does need is a check for PageFree(), so it also
picks up 1->2 and other transitions without freeing the free page
if the put()s are done out of order. Maybe that's what you were
alluding to.

I'll add that.

--
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux