Re: [PATCH v3 5/6] selftests: prctl: introduce tests for disabling THPs completely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05.08.25 16:26, Usama Arif wrote:


On 05/08/2025 13:55, David Hildenbrand wrote:
On 05.08.25 14:46, Usama Arif wrote:


On 05/08/2025 13:39, David Hildenbrand wrote:
+FIXTURE_SETUP(prctl_thp_disable_completely)
+{
+    if (!thp_available())
+        SKIP(return, "Transparent Hugepages not available\n");
+
+    self->pmdsize = read_pmd_pagesize();
+    if (!self->pmdsize)
+        SKIP(return, "Unable to read PMD size\n");
+
+    thp_save_settings();
+    thp_read_settings(&self->settings);
+    self->settings.thp_enabled = variant->thp_policy;
+    self->settings.hugepages[sz2ord(self->pmdsize, getpagesize())].enabled = THP_INHERIT;

Oh, one more thing: should we set all other sizes also to THP_INHERIT or (for simplicity) THP_NEVER?


hmm do we need to? I am hoping that we should always get the PMD size THP no matter what the policy
for others is in the scenario we have?

Assuming 64K is set to "always", couldn't it mislead us in the "madvise"/"never" test cases in some scenarios?


I tried it with 64K to always and seems to be ok. check_huge_anon checks AnonHugepages from smaps which
only indicates the pmd mapped THPs only. So I think should be ok?

Ah, yes. If that's the case, then we can focus on PMD only and not care about how the others are configured.

--
Cheers,

David / dhildenb





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux