Adam Litke <[email protected]> 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 [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]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|