diff options
Diffstat (limited to 'mm/page_alloc.c')
| -rw-r--r-- | mm/page_alloc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 097893ffe194..d604d2596b7b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -3896,8 +3896,8 @@ EXPORT_SYMBOL(free_pages); | |||
| 3896 | * drivers to provide a backing region of memory for use as either an | 3896 | * drivers to provide a backing region of memory for use as either an |
| 3897 | * sk_buff->head, or to be used in the "frags" portion of skb_shared_info. | 3897 | * sk_buff->head, or to be used in the "frags" portion of skb_shared_info. |
| 3898 | */ | 3898 | */ |
| 3899 | static struct page *__page_frag_refill(struct page_frag_cache *nc, | 3899 | static struct page *__page_frag_cache_refill(struct page_frag_cache *nc, |
| 3900 | gfp_t gfp_mask) | 3900 | gfp_t gfp_mask) |
| 3901 | { | 3901 | { |
| 3902 | struct page *page = NULL; | 3902 | struct page *page = NULL; |
| 3903 | gfp_t gfp = gfp_mask; | 3903 | gfp_t gfp = gfp_mask; |
| @@ -3917,19 +3917,20 @@ static struct page *__page_frag_refill(struct page_frag_cache *nc, | |||
| 3917 | return page; | 3917 | return page; |
| 3918 | } | 3918 | } |
| 3919 | 3919 | ||
| 3920 | void __page_frag_drain(struct page *page, unsigned int order, | 3920 | void __page_frag_cache_drain(struct page *page, unsigned int count) |
| 3921 | unsigned int count) | ||
| 3922 | { | 3921 | { |
| 3923 | VM_BUG_ON_PAGE(page_ref_count(page) == 0, page); | 3922 | VM_BUG_ON_PAGE(page_ref_count(page) == 0, page); |
| 3924 | 3923 | ||
| 3925 | if (page_ref_sub_and_test(page, count)) { | 3924 | if (page_ref_sub_and_test(page, count)) { |
| 3925 | unsigned int order = compound_order(page); | ||
| 3926 | |||
| 3926 | if (order == 0) | 3927 | if (order == 0) |
| 3927 | free_hot_cold_page(page, false); | 3928 | free_hot_cold_page(page, false); |
| 3928 | else | 3929 | else |
| 3929 | __free_pages_ok(page, order); | 3930 | __free_pages_ok(page, order); |
| 3930 | } | 3931 | } |
| 3931 | } | 3932 | } |
| 3932 | EXPORT_SYMBOL(__page_frag_drain); | 3933 | EXPORT_SYMBOL(__page_frag_cache_drain); |
| 3933 | 3934 | ||
| 3934 | void *page_frag_alloc(struct page_frag_cache *nc, | 3935 | void *page_frag_alloc(struct page_frag_cache *nc, |
| 3935 | unsigned int fragsz, gfp_t gfp_mask) | 3936 | unsigned int fragsz, gfp_t gfp_mask) |
| @@ -3940,7 +3941,7 @@ void *page_frag_alloc(struct page_frag_cache *nc, | |||
| 3940 | 3941 | ||
| 3941 | if (unlikely(!nc->va)) { | 3942 | if (unlikely(!nc->va)) { |
| 3942 | refill: | 3943 | refill: |
| 3943 | page = __page_frag_refill(nc, gfp_mask); | 3944 | page = __page_frag_cache_refill(nc, gfp_mask); |
| 3944 | if (!page) | 3945 | if (!page) |
| 3945 | return NULL; | 3946 | return NULL; |
| 3946 | 3947 | ||
