From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754146AbdKFR5y (ORCPT ); Mon, 6 Nov 2017 12:57:54 -0500 Received: from smtprelay0217.hostedemail.com ([216.40.44.217]:37679 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753552AbdKFR5x (ORCPT ); Mon, 6 Nov 2017 12:57:53 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:800:871:960:973:988:989:1000:1260:1313:1314:1345:1359:1373:1437:1516:1518:1535:1543:1575:1594:1711:1730:1747:1764:1777:1792:2198:2199:2282:2393:2553:2559:2562:2693:2731:2899:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3874:4184:4250:4321:4605:5007:6119:6506:6747:6748:7281:7576:7903:7909:8660:10004:10400:10848:11026:11232:11233:11473:11604:11658:11914:12043:12296:12438:12555:12740:12895:12986:13148:13230:13439:14096:14180:14181:14659:14721:21060:21067:21080:21451:21611:21627:30045:30051:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:4,LUA_SUMMARY:none X-HE-Tag: sun88_a41298ee0d42 X-Filterd-Recvd-Size: 5989 Message-ID: <1509991069.2431.45.camel@perches.com> Subject: Re: [PATCH] mm, sparse: do not swamp log with huge vmemmap allocation failures From: Joe Perches To: Johannes Weiner , Michal Hocko Cc: Andrew Morton , Vlastimil Babka , linux-mm@kvack.org, LKML , Michal Hocko Date: Mon, 06 Nov 2017 09:57:49 -0800 In-Reply-To: <20171106173511.GA32336@cmpxchg.org> References: <20171106092228.31098-1-mhocko@kernel.org> <20171106173511.GA32336@cmpxchg.org> Content-Type: multipart/mixed; boundary="=-idGoc9ZTC8IXc9QLTUfg" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-idGoc9ZTC8IXc9QLTUfg Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit 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 > > > > 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] [] dump_trace+0x59/0x310 > > [146792.281436] [] show_stack_log_lvl+0xea/0x170 > > [146792.281440] [] show_stack+0x21/0x40 > > [146792.281448] [] dump_stack+0x5c/0x7c > > [146792.281464] [] warn_alloc_failed+0xe2/0x150 > > [146792.281471] [] __alloc_pages_nodemask+0x3ed/0xb20 > > [146792.281489] [] alloc_pages_current+0x7f/0x100 > > [146792.281503] [] vmemmap_alloc_block+0x79/0xb6 > > [146792.281510] [] __vmemmap_alloc_block_buf+0x136/0x145 > > [146792.281524] [] vmemmap_populate+0xd2/0x2b9 > > [146792.281529] [] sparse_mem_map_populate+0x23/0x30 > > [146792.281532] [] sparse_add_one_section+0x68/0x18e > > [146792.281537] [] __add_pages+0x10a/0x1d0 > > [146792.281553] [] arch_add_memory+0x4a/0xc0 > > [146792.281559] [] add_memory_resource+0x89/0x160 > > [146792.281564] [] add_memory+0x6d/0xd0 > > [146792.281585] [] acpi_memory_device_add+0x181/0x251 > > [146792.281597] [] acpi_bus_attach+0xfd/0x19b > > [146792.281602] [] acpi_bus_scan+0x59/0x69 > > [146792.281604] [] acpi_device_hotplug+0xd2/0x41f > > [146792.281608] [] acpi_hotplug_work_fn+0x1a/0x23 > > [146792.281623] [] process_one_work+0x14e/0x410 > > [146792.281630] [] worker_thread+0x116/0x490 > > [146792.281637] [] kthread+0xbd/0xe0 > > [146792.281651] [] 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 > > Signed-off-by: Michal Hocko > > --- > > 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; --=-idGoc9ZTC8IXc9QLTUfg Content-Disposition: attachment; filename="1.difd" Content-Type: text/plain; name="1.difd"; charset="ISO-8859-1" Content-Transfer-Encoding: base64 IG1tL3BhZ2VfYWxsb2MuYyB8IDMgKy0tCiAxIGZpbGUgY2hhbmdlZCwgMSBpbnNlcnRpb24oKyks IDIgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbW0vcGFnZV9hbGxvYy5jIGIvbW0vcGFnZV9h bGxvYy5jCmluZGV4IDgyZTZkMmM5MTRhYi4uYWYzZjkyYmVlYzA0IDEwMDY0NAotLS0gYS9tbS9w YWdlX2FsbG9jLmMKKysrIGIvbW0vcGFnZV9hbGxvYy5jCkBAIC0zMjY5LDggKzMyNjksNyBAQCB2 b2lkIHdhcm5fYWxsb2MoZ2ZwX3QgZ2ZwX21hc2ssIG5vZGVtYXNrX3QgKm5vZGVtYXNrLCBjb25z dCBjaGFyICpmbXQsIC4uLikKIHsKIAlzdHJ1Y3QgdmFfZm9ybWF0IHZhZjsKIAl2YV9saXN0IGFy Z3M7Ci0Jc3RhdGljIERFRklORV9SQVRFTElNSVRfU1RBVEUobm9wYWdlX3JzLCBERUZBVUxUX1JB VEVMSU1JVF9JTlRFUlZBTCwKLQkJCQkgICAgICBERUZBVUxUX1JBVEVMSU1JVF9CVVJTVCk7CisJ c3RhdGljIERFRklORV9SQVRFTElNSVRfU1RBVEUobm9wYWdlX3JzLCBIWiAqIDYwLCAxKTsKIAog CWlmICgoZ2ZwX21hc2sgJiBfX0dGUF9OT1dBUk4pIHx8ICFfX3JhdGVsaW1pdCgmbm9wYWdlX3Jz KSkKIAkJcmV0dXJuOwo= --=-idGoc9ZTC8IXc9QLTUfg--