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] [day] [month] [year] [list]
Message-ID: <CAGWkznFLP7ACf0mxkSoLefewzaoRL38RJ13PXvFmZCgcvx+63A@mail.gmail.com>
Date: Tue, 2 Jan 2024 13:50:16 +0800
From: Zhaoyang Huang <huangzhaoyang@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Johannes Weiner <hannes@...xchg.org>, "zhaoyang.huang" <zhaoyang.huang@...soc.com>, 
	Roman Gushchin <roman.gushchin@...ux.dev>, linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
	steve.kang@...soc.com, Vlastimil Babka <vbabka@...e.cz>, 
	Mel Gorman <mgorman@...hsingularity.net>, Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: Re: [PATCHv6 1/1] mm: optimization on page allocation when CMA enabled

On Sat, Dec 30, 2023 at 3:40 AM Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Wed, 8 Nov 2023 16:55:19 +0800 Zhaoyang Huang <huangzhaoyang@...il.com> wrote:
>
> > > > +static bool use_cma_first(struct zone *zone, unsigned int order, unsigned int alloc_flags)
> > > > +{
> > > > +     unsigned long watermark;
> > > > +     bool cma_first = false;
> > > > +
> > > > +     watermark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK);
> > > > +     /* check if GFP_MOVABLE pass previous zone_watermark_ok via the help of CMA */
> > > > +     if (zone_watermark_ok(zone, order, watermark, 0, alloc_flags & (~ALLOC_CMA))) {
> > > > +             /*
> > > > +              * Balance movable allocations between regular and CMA areas by
> > > > +              * allocating from CMA when over half of the zone's free memory
> > > > +              * is in the CMA area.
> > > > +              */
> > ok, thanks for point out.
> > Could we simple it like this, which will mis-judge kmalloc within
> > ioctl as GFP_USER. I think it is ok as it is rare
> >              if (current_is_kswapd() || !current->mm)
> >                  gfp_flags = GFP_KERNEL;
> >              else
> >                  gfp_flags = GFP_USER;
> >             free_pages = zone_page_state(zone, NR_FREE_PAGES);
> >             free_pages -= zone->lowmem_reserve[gfp_zone(gfp_flags)];
> >             free_pages -= wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK);
> >             cma_first = free_pages > zone_page_state(zone, NR_FREE_PAGES) / 2);
> >
>
> This went all quiet.  Do we feel that "mm: optimization on page
> allocation when CMA enabled" should be merged as-is, or dropped in the
> expectation that something based on Johannes's suggestion will be
> developed?
I just establish a v6.6 environment and will provide comparison
results with and without the patch
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ