Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

2020-07-22 Thread Joonsoo Kim
2020년 7월 21일 (화) 오후 9:43, Matthew Wilcox 님이 작성: > > On Tue, Jul 21, 2020 at 02:38:56PM +0200, Vlastimil Babka wrote: > > On 7/21/20 2:05 PM, Matthew Wilcox wrote: > > > On Tue, Jul 21, 2020 at 12:28:49PM +0900, js1...@gmail.com wrote: > > >> @@ -4619,8 +4631,10 @@ __alloc_pages_slowpath(gfp_t

Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

2020-07-22 Thread Joonsoo Kim
2020년 7월 21일 (화) 오후 9:39, Vlastimil Babka 님이 작성: > > On 7/21/20 2:05 PM, Matthew Wilcox wrote: > > On Tue, Jul 21, 2020 at 12:28:49PM +0900, js1...@gmail.com wrote: > >> +static inline unsigned int current_alloc_flags(gfp_t gfp_mask, > >> +unsigned int

Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

2020-07-21 Thread Matthew Wilcox
On Tue, Jul 21, 2020 at 02:38:56PM +0200, Vlastimil Babka wrote: > On 7/21/20 2:05 PM, Matthew Wilcox wrote: > > On Tue, Jul 21, 2020 at 12:28:49PM +0900, js1...@gmail.com wrote: > >> @@ -4619,8 +4631,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int > >> order, > >>

Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

2020-07-21 Thread Vlastimil Babka
On 7/21/20 2:05 PM, Matthew Wilcox wrote: > On Tue, Jul 21, 2020 at 12:28:49PM +0900, js1...@gmail.com wrote: >> +static inline unsigned int current_alloc_flags(gfp_t gfp_mask, >> +unsigned int alloc_flags) >> +{ >> +#ifdef CONFIG_CMA >> +unsigned int pflags

Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

2020-07-21 Thread Matthew Wilcox
On Tue, Jul 21, 2020 at 12:28:49PM +0900, js1...@gmail.com wrote: > +static inline unsigned int current_alloc_flags(gfp_t gfp_mask, > + unsigned int alloc_flags) > +{ > +#ifdef CONFIG_CMA > + unsigned int pflags = current->flags; > + > + if (!(pflags &

Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

2020-07-21 Thread Vlastimil Babka
On 7/21/20 5:28 AM, js1...@gmail.com wrote: > From: Joonsoo Kim > > Currently, memalloc_nocma_{save/restore} API that prevents CMA area > in page allocation is implemented by using current_gfp_context(). However, > there are two problems of this implementation. > > First, this doesn't work for

[PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

2020-07-20 Thread js1304
From: Joonsoo Kim Currently, memalloc_nocma_{save/restore} API that prevents CMA area in page allocation is implemented by using current_gfp_context(). However, there are two problems of this implementation. First, this doesn't work for allocation fastpath. In the fastpath, original gfp_mask is