Re: [PATCH v2] mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call

2021-01-19 Thread Mike Kravetz
On 1/15/21 1:44 AM, Miaohe Lin wrote: > Hi: > > On 2021/1/15 17:28, Oscar Salvador wrote: >> On Fri, Jan 15, 2021 at 04:20:13AM -0500, Miaohe Lin wrote: >>> When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding >>> and releasing hugetlb_lock. We should avoid this unnecessary

Re: [PATCH v2] mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call

2021-01-15 Thread Miaohe Lin
Hi: On 2021/1/15 17:28, Oscar Salvador wrote: > On Fri, Jan 15, 2021 at 04:20:13AM -0500, Miaohe Lin wrote: >> When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding >> and releasing hugetlb_lock. We should avoid this unnecessary hugetlb_lock >> lock/unlock cycle which is happ

Re: [PATCH v2] mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call

2021-01-15 Thread Oscar Salvador
On Fri, Jan 15, 2021 at 04:20:13AM -0500, Miaohe Lin wrote: > When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding > and releasing hugetlb_lock. We should avoid this unnecessary hugetlb_lock > lock/unlock cycle which is happening on 'most' hugetlb munmap operations by > check

[PATCH v2] mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call

2021-01-15 Thread Miaohe Lin
When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding and releasing hugetlb_lock. We should avoid this unnecessary hugetlb_lock lock/unlock cycle which is happening on 'most' hugetlb munmap operations by check delta against 0 at the beginning of hugetlb_acct_memory. Reviewed-