lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ed29af1-1114-a085-d47d-21d646963ab7@infradead.org>
Date:   Wed, 10 Mar 2021 09:15:45 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Michal Hocko <mhocko@...e.com>,
        Muchun Song <songmuchun@...edance.com>
Cc:     corbet@....net, mike.kravetz@...cle.com, tglx@...utronix.de,
        mingo@...hat.com, bp@...en8.de, x86@...nel.org, hpa@...or.com,
        dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
        viro@...iv.linux.org.uk, akpm@...ux-foundation.org,
        paulmck@...nel.org, mchehab+huawei@...nel.org,
        pawan.kumar.gupta@...ux.intel.com, oneukum@...e.com,
        anshuman.khandual@....com, jroedel@...e.de, almasrymina@...gle.com,
        rientjes@...gle.com, willy@...radead.org, osalvador@...e.de,
        song.bao.hua@...ilicon.com, david@...hat.com,
        naoya.horiguchi@....com, joao.m.martins@...cle.com,
        duanxiongchun@...edance.com, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-fsdevel@...r.kernel.org, Miaohe Lin <linmiaohe@...wei.com>,
        Chen Huang <chenhuang5@...wei.com>,
        Bodeddula Balasubramaniam <bodeddub@...zon.com>
Subject: Re: [PATCH v18 6/9] mm: hugetlb: add a kernel parameter
 hugetlb_free_vmemmap

On 3/10/21 7:37 AM, Michal Hocko wrote:
> On Mon 08-03-21 18:28:04, Muchun Song wrote:
>> Add a kernel parameter hugetlb_free_vmemmap to enable the feature of
>> freeing unused vmemmap pages associated with each hugetlb page on boot.
>>
>> We disables PMD mapping of vmemmap pages for x86-64 arch when this
>> feature is enabled. Because vmemmap_remap_free() depends on vmemmap
>> being base page mapped.
>>
>> Signed-off-by: Muchun Song <songmuchun@...edance.com>
>> Reviewed-by: Oscar Salvador <osalvador@...e.de>
>> Reviewed-by: Barry Song <song.bao.hua@...ilicon.com>
>> Reviewed-by: Miaohe Lin <linmiaohe@...wei.com>
>> Tested-by: Chen Huang <chenhuang5@...wei.com>
>> Tested-by: Bodeddula Balasubramaniam <bodeddub@...zon.com>
>> ---
>>  Documentation/admin-guide/kernel-parameters.txt | 14 ++++++++++++++
>>  Documentation/admin-guide/mm/hugetlbpage.rst    |  3 +++
>>  arch/x86/mm/init_64.c                           |  8 ++++++--
>>  include/linux/hugetlb.h                         | 19 +++++++++++++++++++
>>  mm/hugetlb_vmemmap.c                            | 24 ++++++++++++++++++++++++
>>  5 files changed, 66 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
>> index 04545725f187..de91d54573c4 100644
>> --- a/Documentation/admin-guide/kernel-parameters.txt
>> +++ b/Documentation/admin-guide/kernel-parameters.txt
>> @@ -1557,6 +1557,20 @@
>>  			Documentation/admin-guide/mm/hugetlbpage.rst.
>>  			Format: size[KMG]
>>  
>> +	hugetlb_free_vmemmap=
>> +			[KNL] When CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is set,
>> +			this controls freeing unused vmemmap pages associated
>> +			with each HugeTLB page. When this option is enabled,
>> +			we disable PMD/huge page mapping of vmemmap pages which
>> +			increase page table pages. So if a user/sysadmin only
>> +			uses a small number of HugeTLB pages (as a percentage
>> +			of system memory), they could end up using more memory
>> +			with hugetlb_free_vmemmap on as opposed to off.
>> +			Format: { on | off (default) }
> 
> Please note this is an admin guide and for those this seems overly low
> level. I would use something like the following
> 			[KNL] Reguires CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
> 			enabled.
> 			Allows heavy hugetlb users to free up some more
> 			memory (6 * PAGE_SIZE for each 2MB hugetlb
> 			page).
> 			This feauture is not free though. Large page
> 			tables are not use to back vmemmap pages which

			       are not used

> 			can lead to a performance degradation for some
> 			workloads. Also there will be memory allocation
> 			required when hugetlb pages are freed from the
> 			pool which can lead to corner cases under heavy
> 			memory pressure.
>> +
>> +			on:  enable the feature
>> +			off: disable the feature
>> +
>>  	hung_task_panic=
>>  			[KNL] Should the hung task detector generate panics.
>>  			Format: 0 | 1


-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ