File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -7190,7 +7190,8 @@ struct page *try_alloc_pages_noprof(int nid, unsigned int order)
71907190 * specify it here to highlight that try_alloc_pages()
71917191 * doesn't want to deplete reserves.
71927192 */
7193- gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC ;
7193+ gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC
7194+ | __GFP_ACCOUNT ;
71947195 unsigned int alloc_flags = ALLOC_TRYLOCK ;
71957196 struct alloc_context ac = { };
71967197 struct page * page ;
@@ -7234,6 +7235,11 @@ struct page *try_alloc_pages_noprof(int nid, unsigned int order)
72347235
72357236 /* Unlike regular alloc_pages() there is no __alloc_pages_slowpath(). */
72367237
7238+ if (memcg_kmem_online () && page &&
7239+ unlikely (__memcg_kmem_charge_page (page , alloc_gfp , order ) != 0 )) {
7240+ free_pages_nolock (page , order );
7241+ page = NULL ;
7242+ }
72377243 trace_mm_page_alloc (page , order , alloc_gfp , ac .migratetype );
72387244 kmsan_alloc_page (page , order , alloc_gfp );
72397245 return page ;
You can’t perform that action at this time.
0 commit comments