Messages in this thread | | | Date | Wed, 28 Sep 2005 23:09:17 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH 2/3 htlb-fault] Demand faulting for huge pages |
| |
Adam Litke <agl@us.ibm.com> wrote: > > +static struct page *find_get_huge_page(struct address_space *mapping, > + unsigned long idx) > +{ > + struct page *page = NULL; > + > +retry: > + page = find_get_page(mapping, idx); > + if (page) > + goto out; > + > + if (hugetlb_get_quota(mapping)) > + goto out; > + page = alloc_huge_page(); > + if (!page) { > + hugetlb_put_quota(mapping); > + goto out; > + } > + > + if (add_to_page_cache(page, mapping, idx, GFP_ATOMIC)) { > + put_page(page); > + hugetlb_put_quota(mapping); > + goto retry;
If add_to_page_cache() fails due to failure in radix_tree_preload(), this code will lock up.
A lame fix is to check for -ENOMEM and bale. A better fix would be to use GFP_KERNEL.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |