Re: [PATCH 2/2] mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over vmas

2021-04-06 Thread Yang Shi
On Mon, Apr 5, 2021 at 8:05 PM Xu, Yanfei wrote: > > > > On 4/6/21 10:51 AM, Xu, Yanfei wrote: > > > > > > On 4/6/21 2:20 AM, Yang Shi wrote: > >> [Please note: This e-mail is from an EXTERNAL e-mail address] > >> > >> On Sun, Apr 4, 2021 at 8:33 AM wrote: > >>> > >>> From: Yanfei Xu > >>> > >>>

Re: [PATCH 2/2] mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over vmas

2021-04-05 Thread Xu, Yanfei
On 4/6/21 10:51 AM, Xu, Yanfei wrote: On 4/6/21 2:20 AM, Yang Shi wrote: [Please note: This e-mail is from an EXTERNAL e-mail address] On Sun, Apr 4, 2021 at 8:33 AM wrote: From: Yanfei Xu We could check MMF_DISABLE_THP ahead of iterating over all of vma. Otherwise if some mm_struct c

Re: [PATCH 2/2] mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over vmas

2021-04-05 Thread Xu, Yanfei
On 4/6/21 2:20 AM, Yang Shi wrote: [Please note: This e-mail is from an EXTERNAL e-mail address] On Sun, Apr 4, 2021 at 8:33 AM wrote: From: Yanfei Xu We could check MMF_DISABLE_THP ahead of iterating over all of vma. Otherwise if some mm_struct contain a large number of vma, there will

Re: [PATCH 2/2] mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over vmas

2021-04-05 Thread Yang Shi
On Sun, Apr 4, 2021 at 8:33 AM wrote: > > From: Yanfei Xu > > We could check MMF_DISABLE_THP ahead of iterating over all of vma. > Otherwise if some mm_struct contain a large number of vma, there will > be amounts meaningless cpu cycles cost. > > BTW, drop an unnecessary cond_resched(), because t

[PATCH 2/2] mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over vmas

2021-04-04 Thread yanfei . xu
From: Yanfei Xu We could check MMF_DISABLE_THP ahead of iterating over all of vma. Otherwise if some mm_struct contain a large number of vma, there will be amounts meaningless cpu cycles cost. BTW, drop an unnecessary cond_resched(), because there is a another cond_resched() followed it and no c