From: Andrew Morton <akpm@linux-foundation.org>
To: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: 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: Tue, 6 Jul 2021 13:26:53 -0700 [thread overview]
Message-ID: <20210706132653.8374852963b25989e360d599@linux-foundation.org> (raw)
In-Reply-To: <20210705170537.43060-1-urezki@gmail.com>
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?
next prev parent reply other threads:[~2021-07-06 20:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-05 17:05 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 ` Andrew Morton [this message]
2021-07-07 8:42 ` [PATCH v2 1/2] mm/vmalloc: Use batched page requests in bulk-allocator Michal Hocko
2021-07-07 14:47 ` Uladzislau Rezki
2021-07-07 14:49 ` Uladzislau Rezki
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=20210706132653.8374852963b25989e360d599@linux-foundation.org \
--to=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=urezki@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox