Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-16 Thread Wei Yang
On Thu, Aug 13, 2020 at 01:46:38PM +0200, Michal Hocko wrote: >On Tue 11-08-20 14:43:28, Mike Kravetz wrote: >> On 8/10/20 11:54 PM, Michal Hocko wrote: >> > >> > I have managed to forgot all the juicy details since I have made that >> > change. All that remains is that the surplus pages

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-13 Thread Michal Hocko
On Tue 11-08-20 14:43:28, Mike Kravetz wrote: > On 8/10/20 11:54 PM, Michal Hocko wrote: > > > > I have managed to forgot all the juicy details since I have made that > > change. All that remains is that the surplus pages accounting was quite > > tricky and back then I didn't figure out a simpler

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-11 Thread Baoquan He
On 08/11/20 at 02:43pm, Mike Kravetz wrote: > Here is a patch to do that. However, we are optimizing a return path in > a race condition that we are unlikely to ever hit. I 'tested' it by > allocating > an 'extra' page and freeing it via this method in alloc_surplus_huge_page. > > From

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-11 Thread Baoquan He
On 08/11/20 at 08:54am, Michal Hocko wrote: > On Tue 11-08-20 09:51:48, Baoquan He wrote: > > On 08/10/20 at 05:19pm, Mike Kravetz wrote: > > > On 8/9/20 7:17 PM, Baoquan He wrote: > > > > On 08/07/20 at 05:12pm, Wei Yang wrote: > > > >> Let's always increase surplus_huge_pages and so that

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-11 Thread Mike Kravetz
On 8/11/20 4:19 PM, Wei Yang wrote: > On Tue, Aug 11, 2020 at 02:43:28PM -0700, Mike Kravetz wrote: >> Subject: [PATCH] hugetlb: optimize race error return in >> alloc_surplus_huge_page >> >> The routine alloc_surplus_huge_page() could race with with a pool >> size change. If this happens, the

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-11 Thread Wei Yang
On Tue, Aug 11, 2020 at 02:43:28PM -0700, Mike Kravetz wrote: >On 8/10/20 11:54 PM, Michal Hocko wrote: >> >> I have managed to forgot all the juicy details since I have made that >> change. All that remains is that the surplus pages accounting was quite >> tricky and back then I didn't figure

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-11 Thread Mike Kravetz
On 8/10/20 11:54 PM, Michal Hocko wrote: > > I have managed to forgot all the juicy details since I have made that > change. All that remains is that the surplus pages accounting was quite > tricky and back then I didn't figure out a simpler method that would > achieve the consistent look at

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-11 Thread Michal Hocko
On Tue 11-08-20 09:51:48, Baoquan He wrote: > On 08/10/20 at 05:19pm, Mike Kravetz wrote: > > On 8/9/20 7:17 PM, Baoquan He wrote: > > > On 08/07/20 at 05:12pm, Wei Yang wrote: > > >> Let's always increase surplus_huge_pages and so that free_huge_page > > >> could decrease it at free time. > > >>

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-10 Thread Baoquan He
On 08/10/20 at 05:19pm, Mike Kravetz wrote: > On 8/9/20 7:17 PM, Baoquan He wrote: > > On 08/07/20 at 05:12pm, Wei Yang wrote: > >> Let's always increase surplus_huge_pages and so that free_huge_page > >> could decrease it at free time. > >> > >> Signed-off-by: Wei Yang > >> --- > >>

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-10 Thread Mike Kravetz
On 8/9/20 7:17 PM, Baoquan He wrote: > On 08/07/20 at 05:12pm, Wei Yang wrote: >> Let's always increase surplus_huge_pages and so that free_huge_page >> could decrease it at free time. >> >> Signed-off-by: Wei Yang >> --- >> mm/hugetlb.c | 14 ++ >> 1 file changed, 6 insertions(+), 8

Re: [PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-09 Thread Baoquan He
On 08/07/20 at 05:12pm, Wei Yang wrote: > Let's always increase surplus_huge_pages and so that free_huge_page > could decrease it at free time. > > Signed-off-by: Wei Yang > --- > mm/hugetlb.c | 14 ++ > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/mm/hugetlb.c

[PATCH 10/10] mm/hugetlb: not necessary to abuse temporary page to workaround the nasty free_huge_page

2020-08-07 Thread Wei Yang
Let's always increase surplus_huge_pages and so that free_huge_page could decrease it at free time. Signed-off-by: Wei Yang --- mm/hugetlb.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 1f2010c9dd8d..a0eb81e0e4c5 100644 ---