From: Uladzislau Rezki <urezki@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
Mel Gorman <mgorman@suse.de>,
Christoph Hellwig <hch@infradead.org>,
Matthew Wilcox <willy@infradead.org>,
Nicholas Piggin <npiggin@gmail.com>,
Hillf Danton <hdanton@sina.com>, Michal Hocko <mhocko@suse.com>,
Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v2 1/2] mm/vmalloc: Use batched page requests in bulk-allocator
Date: Wed, 7 Jul 2021 16:49:21 +0200 [thread overview]
Message-ID: <20210707144921.GC1863@pc638.lan> (raw)
In-Reply-To: <20210706132653.8374852963b25989e360d599@linux-foundation.org>
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@gmail.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@gmail.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
next prev parent reply other threads:[~2021-07-07 14:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-05 17:05 [PATCH v2 1/2] mm/vmalloc: Use batched page requests in bulk-allocator Uladzislau Rezki (Sony)
2021-07-05 17:05 ` [PATCH v2 2/2] mm/vmalloc: Remove gfpflags_allow_blocking() check Uladzislau Rezki (Sony)
2021-07-07 8:51 ` Michal Hocko
2021-07-07 14:43 ` Uladzislau Rezki
2021-07-06 20:26 ` [PATCH v2 1/2] mm/vmalloc: Use batched page requests in bulk-allocator Andrew Morton
2021-07-07 8:42 ` Michal Hocko
2021-07-07 14:47 ` Uladzislau Rezki
2021-07-07 14:49 ` Uladzislau Rezki [this message]
2021-07-07 8:50 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210707144921.GC1863@pc638.lan \
--to=urezki@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=npiggin@gmail.com \
--cc=oleksiy.avramchenko@sonymobile.com \
--cc=rostedt@goodmis.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.