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]
Date:   Wed, 7 Jul 2021 16:49:21 +0200
From:   Uladzislau Rezki <urezki@...il.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     "Uladzislau Rezki (Sony)" <urezki@...il.com>, linux-mm@...ck.org,
        LKML <linux-kernel@...r.kernel.org>,
        Mel Gorman <mgorman@...e.de>,
        Christoph Hellwig <hch@...radead.org>,
        Matthew Wilcox <willy@...radead.org>,
        Nicholas Piggin <npiggin@...il.com>,
        Hillf Danton <hdanton@...a.com>,
        Michal Hocko <mhocko@...e.com>,
        Oleksiy Avramchenko <oleksiy.avramchenko@...ymobile.com>,
        Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH v2 1/2] mm/vmalloc: Use batched page requests in
 bulk-allocator

On Tue, Jul 06, 2021 at 01:26:53PM -0700, Andrew Morton wrote:
> On Mon,  5 Jul 2021 19:05:36 +0200 "Uladzislau Rezki (Sony)" <urezki@...il.com> wrote:
> 
> > In case of simultaneous vmalloc allocations, for example it is 1GB and
> > 12 CPUs my system is able to hit "BUG: soft lockup" for !CONFIG_PREEMPT
> > kernel.
> > 
> > <snip>
> > ...
> >
> > are obtained, i.e. do batched page requests adding cond_resched() meanwhile
> > to reschedule. Batched value is hard-coded and is 100 pages per call.
> > 
> > Signed-off-by: Uladzislau Rezki (Sony) <urezki@...il.com>
> 
> Can we please have a Fixes: for this?
> 
> Is this fix important enough for 4.14-rcx?  I think so...
> 
> > --- a/mm/vmalloc.c
> > +++ b/mm/vmalloc.c
> > @@ -2785,10 +2785,32 @@ vm_area_alloc_pages(gfp_t gfp, int nid,
> >  	 * to fails, fallback to a single page allocator that is
> >  	 * more permissive.
> >  	 */
> > -	if (!order)
> > -		nr_allocated = alloc_pages_bulk_array_node(
> > -			gfp, nid, nr_pages, pages);
> > -	else
> > +	if (!order) {
> > +		while (nr_allocated < nr_pages) {
> > +			int nr, nr_pages_request;
> > +
> > +			/*
> > +			 * A maximum allowed request is hard-coded and is 100
> > +			 * pages per call. That is done in order to prevent a
> > +			 * long preemption off scenario in the bulk-allocator
> > +			 * so the range is [1:100].
> > +			 */
> > +			nr_pages_request = min(100, (int)(nr_pages - nr_allocated));
> 
> Yes, they types are all over the place.
> 
> nr_pages: unsigned long
> nr_allocated: unsigned int
> nr, nr_pages_request: int
> 
> Can we please choose the most appropriate type and use that
> consistently?
> 
Let me think over it to see what i can do.

--
Vlad Rezki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ