Message ID | 20201115065106.10244-1-dongli.zhang@oracle.com |
---|---|
State | Superseded |
Headers | show |
Series | [v2,1/1] page_frag: Recover from memory pressure | expand |
On Sat, Nov 14, 2020 at 10:51:06PM -0800, Dongli Zhang wrote:
> + if (nc->pfmemalloc) {
You missed the unlikely() change that Eric recommended.
On 11/15/20 4:18 AM, Matthew Wilcox wrote: > On Sat, Nov 14, 2020 at 10:51:06PM -0800, Dongli Zhang wrote: >> + if (nc->pfmemalloc) { > > You missed the unlikely() change that Eric recommended. > Thank you very much. I missed that email. I will send v3. Dongli Zhang
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 23f5066bd4a5..91129ce75ed4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5103,6 +5103,11 @@ void *page_frag_alloc(struct page_frag_cache *nc, if (!page_ref_sub_and_test(page, nc->pagecnt_bias)) goto refill; + if (nc->pfmemalloc) { + free_the_page(page, compound_order(page)); + goto refill; + } + #if (PAGE_SIZE < PAGE_FRAG_CACHE_MAX_SIZE) /* if size can vary use size else just use PAGE_SIZE */ size = nc->size;