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: <c331d19a-d467-4b9d-81b0-e3f727d17ace@intel.com>
Date:   Tue, 14 Nov 2023 19:23:25 +0800
From:   "Yin, Fengwei" <fengwei.yin@...el.com>
To:     "Huang, Ying" <ying.huang@...el.com>
CC:     Matthew Wilcox <willy@...radead.org>,
        "zhangpeng (AS)" <zhangpeng362@...wei.com>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>, <akpm@...ux-foundation.org>,
        <lstoakes@...il.com>, <hughd@...gle.com>, <david@...hat.com>,
        <vbabka@...e.cz>, <peterz@...radead.org>, <mgorman@...e.de>,
        <mingo@...hat.com>, <riel@...hat.com>, <hannes@...xchg.org>,
        Nanyong Sun <sunnanyong@...wei.com>,
        Kefeng Wang <wangkefeng.wang@...wei.com>
Subject: Re: [Question]: major faults are still triggered after mlockall when
 numa balancing



On 11/13/2023 10:02 AM, Huang, Ying wrote:
>>> There are other places in the kernel where the PTE is cleared, for
>>> example, move_ptes() in mremap.c.  IIUC, we need to audit all them.
>>>
>>> Another possible solution is to check PTE again with PTL held before
>>> reading in file data.  This will increase the overhead of major fault
>>> path.  Is it acceptable?
>> What if we check the PTE without page table lock acquired?
> The PTE is zeroed temporarily only with PTL held.  So, if we acquire the
> PTL in filemap_fault() and check the PTE, the PTE which is zeroed in
> do_numa_page() will be non-zero now.  So we can avoid the major fault.
Yes.

> 
> But, if we don't acquire the PTL, the PTE may still be zero.
For do_numa_page()/change_pte_range(), it does very limit thing during
PTE is cleared. Considering the code path of do_read_fault(), it's likely
the PTE is none-zero.

My concern to acquiring lock is that it brings extra PTL lock acquire/release
for other more common cases.

Regards
Yin, Fengwei

> 
> --
> Best Regards,
> Huang, Ying

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ