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: <Zth-40Vzyh8zeDSu@kernel.org>
Date: Wed, 4 Sep 2024 18:38:11 +0300
From: Mike Rapoport <rppt@...nel.org>
To: Rong Qianfeng <11065417@...o.com>
Cc: Mel Gorman <mgorman@...hsingularity.net>, vbabka@...e.cz,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Zi Yan <ziy@...dia.com>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, opensource.kernel@...o.com,
	Rong Qianfeng <rongqianfeng@...o.com>
Subject: Re: [PATCH] mm: Skip the reserved bootmem for compaction

On Wed, Sep 04, 2024 at 07:59:37PM +0800, Rong Qianfeng wrote:
> Hi Mel,
> 
> 在 2024/9/4 19:13, Mel Gorman 写道:
> > On Mon, Sep 02, 2024 at 08:24:43PM +0800, Rong Qianfeng wrote:
> > > Reserved pages are basically non-lru pages. This kind of memory can't be
> > > used as migration sources and targets, skip it can bring some performance
> > > benefits.
> > > 
> > > Because some drivers may also use PG_reserved, we just set PB_migrate_skip
> > > for those clustered reserved bootmem during memory initialization.
> > > 
> > > Signed-off-by: Rong Qianfeng <rongqianfeng@...o.com>
> > I'm not convinced the savings due to skipping a few pages during the scan
> > would justify the additional code. There would have to be a large number
> > of reserved pages scattered throughout the zone to make a difference and
> > even that situation would be a big surprise. I'm not even sure this can be
> > explicitly tested unless you artifically create reserved pages throughout the
> > zone, which would not be convincing, or know if a driver that exhibits such
> > behaviour in which case my first question is -- what is that driver doing?!?
> 
> Thanks for taking the time to reply.
> 
> At first I thought that there was not much PageReserved pages, but when I
> looked at the memory initialization code, I found that no-map pages were
> also marked as PageReserved.  On mobile platforms, there is a lot of no-map
> pages (for example, ARM64 MT6991 no-map pages has 1065MB).  These
> pages are usually used by various hardware subsystems such as modem.  So
> I think it makes sense to skip these pages.
> 
> 
> //no-map and  reserved memory marked as PageReserved
> static void __init memmap_init_reserved_pages(void)
> {
> ...
>     for_each_mem_region(region) {
> ...
>         if (memblock_is_nomap(region))
>             reserve_bootmem_region(start, end, nid);  //for no-map memory

If nomap regions are a problem won't that be simpler to make all pageblocks
of a nomap region PB_migrate_skip here and leave other reserved pages
alone?

> 
>         memblock_set_node(start, end, &memblock.reserved, nid);
>     }
> 
>     for_each_reserved_mem_region(region) {
>         if (!memblock_is_reserved_noinit(region)) {
> ...
>             reserve_bootmem_region(start, end, nid); //for reserved memory
>         }
>     }
> 
> }
> 
> Best Regards,
> Qianfeng

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ