All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH] mm, sparse: do not swamp log with huge vmemmap allocation failures
Date: Mon, 06 Nov 2017 09:57:49 -0800	[thread overview]
Message-ID: <1509991069.2431.45.camel@perches.com> (raw)
In-Reply-To: <20171106173511.GA32336@cmpxchg.org>

[-- Attachment #1: Type: text/plain, Size: 3867 bytes --]

On Mon, 2017-11-06 at 12:35 -0500, Johannes Weiner wrote:
> On Mon, Nov 06, 2017 at 10:22:28AM +0100, Michal Hocko wrote:
> > From: Michal Hocko <mhocko@suse.com>
> > 
> > While doing a memory hotplug tests under a heavy memory pressure we have
> > noticed too many page allocation failures when allocating vmemmap memmap
> > backed by huge page
> > [146792.281354] kworker/u3072:1: page allocation failure: order:9, mode:0x24084c0(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO)
> > [...]
> > [146792.281394] Call Trace:
> > [146792.281430]  [<ffffffff81019a99>] dump_trace+0x59/0x310
> > [146792.281436]  [<ffffffff81019e3a>] show_stack_log_lvl+0xea/0x170
> > [146792.281440]  [<ffffffff8101abc1>] show_stack+0x21/0x40
> > [146792.281448]  [<ffffffff8130f040>] dump_stack+0x5c/0x7c
> > [146792.281464]  [<ffffffff8118c982>] warn_alloc_failed+0xe2/0x150
> > [146792.281471]  [<ffffffff8118cddd>] __alloc_pages_nodemask+0x3ed/0xb20
> > [146792.281489]  [<ffffffff811d3aaf>] alloc_pages_current+0x7f/0x100
> > [146792.281503]  [<ffffffff815dfa2c>] vmemmap_alloc_block+0x79/0xb6
> > [146792.281510]  [<ffffffff815dfbd3>] __vmemmap_alloc_block_buf+0x136/0x145
> > [146792.281524]  [<ffffffff815dd0c5>] vmemmap_populate+0xd2/0x2b9
> > [146792.281529]  [<ffffffff815dffd9>] sparse_mem_map_populate+0x23/0x30
> > [146792.281532]  [<ffffffff815df88d>] sparse_add_one_section+0x68/0x18e
> > [146792.281537]  [<ffffffff815d9f5a>] __add_pages+0x10a/0x1d0
> > [146792.281553]  [<ffffffff8106249a>] arch_add_memory+0x4a/0xc0
> > [146792.281559]  [<ffffffff815da1f9>] add_memory_resource+0x89/0x160
> > [146792.281564]  [<ffffffff815da33d>] add_memory+0x6d/0xd0
> > [146792.281585]  [<ffffffff813d36c4>] acpi_memory_device_add+0x181/0x251
> > [146792.281597]  [<ffffffff813946e5>] acpi_bus_attach+0xfd/0x19b
> > [146792.281602]  [<ffffffff81394866>] acpi_bus_scan+0x59/0x69
> > [146792.281604]  [<ffffffff813949de>] acpi_device_hotplug+0xd2/0x41f
> > [146792.281608]  [<ffffffff8138db67>] acpi_hotplug_work_fn+0x1a/0x23
> > [146792.281623]  [<ffffffff81093cee>] process_one_work+0x14e/0x410
> > [146792.281630]  [<ffffffff81094546>] worker_thread+0x116/0x490
> > [146792.281637]  [<ffffffff810999ed>] kthread+0xbd/0xe0
> > [146792.281651]  [<ffffffff815e4e7f>] ret_from_fork+0x3f/0x70
> > 
> > and we do see many of those because essentially every the allocation
> > failes for each memory section. This is overly excessive way to tell
> > user that there is nothing to really worry about because we do have
> > a fallback mechanism to use base pages. The only downside might be a
> > performance degradation due to TLB pressure.
> > 
> > This patch changes vmemmap_alloc_block to use __GFP_NOWARN and warn
> > explicitly once on the first allocation failure. This will reduce the
> > noise in the kernel log considerably, while we still have an indication
> > that a performance might be impacted.
> > 
> > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> > Signed-off-by: Michal Hocko <mhocko@suse.com>
> > ---
> > Hi,
> > this has somehow fell of my radar completely. The patch is essentially
> > what Johannes suggested [1] so I have added his s-o-b and added the
> > changelog into it.
> 
> Looks good to me.

I think it'd be better to change the ratelimit state
to something like once a minute
---
 mm/page_alloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 82e6d2c914ab..af3f92beec04 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3269,8 +3269,7 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...)
 {
 	struct va_format vaf;
 	va_list args;
-	static DEFINE_RATELIMIT_STATE(nopage_rs, DEFAULT_RATELIMIT_INTERVAL,
-				      DEFAULT_RATELIMIT_BURST);
+	static DEFINE_RATELIMIT_STATE(nopage_rs, HZ * 60, 1);
 
 	if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs))
 		return;

[-- Attachment #2: 1.difd --]
[-- Type: text/plain, Size: 584 bytes --]

 mm/page_alloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 82e6d2c914ab..af3f92beec04 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3269,8 +3269,7 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...)
 {
 	struct va_format vaf;
 	va_list args;
-	static DEFINE_RATELIMIT_STATE(nopage_rs, DEFAULT_RATELIMIT_INTERVAL,
-				      DEFAULT_RATELIMIT_BURST);
+	static DEFINE_RATELIMIT_STATE(nopage_rs, HZ * 60, 1);
 
 	if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs))
 		return;

  reply	other threads:[~2017-11-06 17:57 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06  9:22 [PATCH] mm, sparse: do not swamp log with huge vmemmap allocation failures Michal Hocko
2017-11-06  9:22 ` Michal Hocko
2017-11-06 17:35 ` Johannes Weiner
2017-11-06 17:35   ` Johannes Weiner
2017-11-06 17:57   ` Joe Perches [this message]
2017-11-06 18:14 ` Khalid Aziz
2017-11-06 18:14   ` Khalid Aziz
2017-11-06 18:18   ` Michal Hocko
2017-11-06 18:18     ` Michal Hocko
2017-11-06 20:17     ` Khalid Aziz
2017-11-06 20:17       ` Khalid Aziz
2017-11-07  9:06 ` Michal Hocko
2017-11-07  9:06   ` Michal Hocko
  -- strict thread matches above, loose matches on Subject: below --
2017-11-06 20:56 [RFC PATCH for 4.15 00/14] Restartable sequences and CPU op vector v10 Mathieu Desnoyers
2017-11-06 20:56 ` Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH v10 for 4.15 01/14] Restartable sequences system call Mathieu Desnoyers
2017-11-07  1:24   ` Boqun Feng
2017-11-07  1:24     ` Boqun Feng
2017-11-07  2:20     ` Mathieu Desnoyers
2017-11-07  2:20       ` Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH for 4.15 02/14] Restartable sequences: ARM 32 architecture support Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH for 4.15 03/14] Restartable sequences: wire up ARM 32 system call Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH for 4.15 04/14] Restartable sequences: x86 32/64 architecture support Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH for 4.15 05/14] Restartable sequences: wire up x86 32/64 system call Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH for 4.15 07/14] Restartable sequences: Wire up powerpc " Mathieu Desnoyers
2017-11-06 20:56   ` Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH v2 for 4.15 08/14] Provide cpu_opv " Mathieu Desnoyers
     [not found]   ` <20171106205644.29386-9-mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org>
2017-11-07  2:07     ` Boqun Feng
2017-11-07  2:07       ` Boqun Feng
2017-11-07  2:40       ` Mathieu Desnoyers
2017-11-07  2:40         ` Mathieu Desnoyers
     [not found]         ` <444885121.6172.1510022437259.JavaMail.zimbra-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org>
2017-11-07  3:03           ` Boqun Feng
2017-11-07  3:03             ` Boqun Feng
     [not found] ` <20171106205644.29386-1-mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org>
2017-11-06 20:56   ` [RFC PATCH for 4.15 06/14] Restartable sequences: powerpc architecture support Mathieu Desnoyers
2017-11-06 20:56     ` Mathieu Desnoyers
2017-11-06 20:56   ` [RFC PATCH for 4.15 09/14] cpu_opv: Wire up x86 32/64 system call Mathieu Desnoyers
2017-11-06 20:56     ` Mathieu Desnoyers
2017-11-06 20:56   ` [RFC PATCH for 4.15 10/14] cpu_opv: Wire up powerpc " Mathieu Desnoyers
2017-11-06 20:56     ` Mathieu Desnoyers
2017-11-07  0:37     ` Nicholas Piggin
2017-11-07  0:37       ` Nicholas Piggin
2017-11-07  0:47       ` Mathieu Desnoyers
2017-11-07  0:47         ` Mathieu Desnoyers
2017-11-07  1:21         ` Nicholas Piggin
2017-11-07  1:21           ` Nicholas Piggin
2017-11-06 20:56   ` [RFC PATCH v2 for 4.15 13/14] Restartable sequences: Provide self-tests Mathieu Desnoyers
2017-11-06 20:56     ` Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH for 4.15 11/14] cpu_opv: Wire up ARM32 system call Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH v2 for 4.15 12/14] cpu_opv: Implement selftests Mathieu Desnoyers
2017-11-06 20:56 ` [RFC PATCH for 4.15 14/14] Restartable sequences selftests: arm: workaround gcc asm size guess Mathieu Desnoyers
2017-11-06 20:56   ` Mathieu Desnoyers

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=1509991069.2431.45.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mhocko@suse.com \
    --cc=vbabka@suse.cz \
    /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.