From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78E8DC48BE6 for ; Mon, 14 Jun 2021 07:38:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1A7AB606A5 for ; Mon, 14 Jun 2021 07:38:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A7AB606A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2F7D36B006C; Mon, 14 Jun 2021 03:38:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A85B6B006E; Mon, 14 Jun 2021 03:38:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FB016B0070; Mon, 14 Jun 2021 03:38:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id D1B5E6B006C for ; Mon, 14 Jun 2021 03:38:20 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5DB81180AD806 for ; Mon, 14 Jun 2021 07:38:20 +0000 (UTC) X-FDA: 78251526360.01.853C96E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 11DB542D for ; Mon, 14 Jun 2021 07:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623656299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R4JweKietmrpHO3kHqxbaCMf9WXh4WBEfPXNjcfKC8o=; b=TcFZAh8AywpOB0Ahd23FzWrYfuPGY/jduqXLsqWLAn8b3VR/NSbo1OrxxRkmgjPQVylNlg Ik0Jno8yBcZej3OpWT+y4BEEfNuleGJr/lUIHvnkNXrIs9I1qiB05FDWHDUr/ogGMqBQs+ s37dS8q8H879KLKJ3wlJko7PCnbptTs= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-_nfy4_l1PcGPXQoExoVauA-1; Mon, 14 Jun 2021 03:38:17 -0400 X-MC-Unique: _nfy4_l1PcGPXQoExoVauA-1 Received: by mail-wr1-f71.google.com with SMTP id g14-20020a5d698e0000b0290117735bd4d3so6597566wru.13 for ; Mon, 14 Jun 2021 00:38:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=R4JweKietmrpHO3kHqxbaCMf9WXh4WBEfPXNjcfKC8o=; b=X6j9sH4AezAm/k/eOv5yHK2TtHbSz5oTES4Ze1W2nqH8cWY0Px4WKT9bfnR8exrSY3 1Geu6meziWeLj8v6jJowDI5p/T+jtjDI8dCvapqAPEzAZoK7iR9O8PFkztWUejS8xAF2 q7ys9Ba1S7YvJedwiRU7thY+VJGtqaib1IUcK4H5UWUk5BMzUyxsgioPrjRXid42z+7g n5WRN/KEZBuc5Pm2LXepERwwqtmj8axRVaQTdbhqaIbgnsUOfagrQrj8/XlG2FFwdudq O6G5yaBf/P9S2tsnyr7Gn75oip8s3v+8S5tUuf2S109IcGpJNyxxaNDRV+Q2ptJoHqGT s6dg== X-Gm-Message-State: AOAM532O9hHuxUCtpVKSF3xOq6M1Q37PJSjc523gUfbZhybpFm6NnJk2 OtAbnS2t8IXmszDImXRAtWF7SOsR7ehfybG4rG7GrDsIr5cMI5erANc8DHKkNKnK83/76WWtzlL GH18dvYiwcmQ= X-Received: by 2002:a7b:c193:: with SMTP id y19mr15277300wmi.172.1623656296646; Mon, 14 Jun 2021 00:38:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiDCyK5qKp7sWrxYZFklPpDnGx/uaKSOKDgbTy9j/tF+JnQhm1Y4ZozM2kmm0E0zLgTVtwow== X-Received: by 2002:a7b:c193:: with SMTP id y19mr15277278wmi.172.1623656296417; Mon, 14 Jun 2021 00:38:16 -0700 (PDT) Received: from [192.168.3.132] (p5b0c66ca.dip0.t-ipconnect.de. [91.12.102.202]) by smtp.gmail.com with ESMTPSA id q20sm19456718wrf.45.2021.06.14.00.38.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Jun 2021 00:38:16 -0700 (PDT) To: Hillf Danton , Nathan Chancellor Cc: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , linux-hyperv@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador References: <20210612021115.2136-1-hdanton@sina.com> From: David Hildenbrand Organization: Red Hat Subject: Re: vmemmap alloc failure in hot_add_req() Message-ID: <951ddbaf-3d74-7043-4866-3809ff991cfd@redhat.com> Date: Mon, 14 Jun 2021 09:38:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210612021115.2136-1-hdanton@sina.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=TcFZAh8A; spf=none (imf20.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 11DB542D X-Stat-Signature: szyodt3oeoq13kigqyuy61x8db5k73xy X-HE-Tag: 1623656288-225181 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12.06.21 04:11, Hillf Danton wrote: > On Fri, 11 Jun 2021 12:48:26 -0700 Nathan Chancellor wrote: >> Hi all, >> >> I am occasionally seeing a kernel warning when running virtual machine= s >> in Hyper-V, which usually happens a minute or so after boot. It does n= ot >> happen on every boot and it is reproducible on at least v5.10. I think >> it might have something to do with constant reboots, which I do when >> testing various kernels. >> >> The stack trace is as follows: >> >> [ 49.215291] kworker/0:1: vmemmap alloc failure: order:9, mode:0x4cc= 0(GFP_KERNEL|__GFP_RETRY_MAYFAIL), nodemask=3D(null),cpuset=3D/,mems_allo= wed=3D0 >> [ 49.215299] CPU: 0 PID: 18 Comm: kworker/0:1 Not tainted 5.13.0-rc5= #1 >> [ 49.215301] Hardware name: Microsoft Corporation Virtual Machine/Vi= rtual Machine, BIOS Hyper-V UEFI Release v4.0 11/01/2019 >> [ 49.215302] Workqueue: events hot_add_req [hv_balloon] >=20 > Apart from order:9 (mm Cced), events_unbound is the right workqueue ins= tead > because the report shows the risk that hot_add_req could block other pe= nding > events longer than thought. Any special reason for the events wq? >=20 >> [ 49.215307] Call Trace: >> [ 49.215310] dump_stack+0x76/0x94 >> [ 49.215314] warn_alloc.cold+0x78/0xdc >> [ 49.215316] ? __alloc_pages+0x200/0x230 >> [ 49.215319] vmemmap_alloc_block+0x86/0xdc >> [ 49.215323] vmemmap_populate+0x10e/0x31c >> [ 49.215324] __populate_section_memmap+0x38/0x4e >> [ 49.215326] sparse_add_section+0x12c/0x1cf >> [ 49.215329] __add_pages+0xa9/0x130 >> [ 49.215330] add_pages+0x12/0x60 >> [ 49.215333] add_memory_resource+0x180/0x300 >> [ 49.215335] __add_memory+0x3b/0x80 >> [ 49.215336] add_memory+0x2e/0x50 >> [ 49.215337] hot_add_req+0x3fc/0x5a0 [hv_balloon] >> [ 49.215340] process_one_work+0x214/0x3e0 >> [ 49.215342] worker_thread+0x4d/0x3d0 >> [ 49.215344] ? process_one_work+0x3e0/0x3e0 >> [ 49.215345] kthread+0x133/0x150 >> [ 49.215347] ? kthread_associate_blkcg+0xc0/0xc0 >> [ 49.215348] ret_from_fork+0x22/0x30 >> [ 49.215351] Mem-Info: >> [ 49.215352] active_anon:251 inactive_anon:140868 isolated_anon:0 >> active_file:47497 inactive_file:88505 isolated_file:0 >> unevictable:8 dirty:14 writeback:0 >> slab_reclaimable:12013 slab_unreclaimable:11403 >> mapped:131701 shmem:12671 pagetables:3140 bounce:0 >> free:41388 free_pcp:37 free_cma:0 >> [ 49.215355] Node 0 active_anon:1004kB inactive_anon:563472kB active= _file:189988kB inactive_file:354020kB unevictable:32kB isolated(anon):0kB= isolated(file):0kB mapped:526804kB dirty:56kB writeback:0kB shmem:50684k= B shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB ker= nel_stack:5904kB pagetables:12560kB all_unreclaimable? no >> [ 49.215358] Node 0 DMA free:6496kB min:480kB low:600kB high:720kB r= eserved_highatomic:0KB active_anon:0kB inactive_anon:3120kB active_file:2= 584kB inactive_file:2792kB unevictable:0kB writepending:0kB present:15996= kB managed:15360kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free= _cma:0kB >> [ 49.215361] lowmem_reserve[]: 0 1384 1384 1384 1384 >> [ 49.215364] Node 0 DMA32 free:159056kB min:44572kB low:55712kB high= :66852kB reserved_highatomic:0KB active_anon:1004kB inactive_anon:560352k= B active_file:187004kB inactive_file:350864kB unevictable:32kB writependi= ng:56kB present:1555760kB managed:1432388kB mlocked:32kB bounce:0kB free_= pcp:172kB local_pcp:0kB free_cma:0kB >> [ 49.215367] lowmem_reserve[]: 0 0 0 0 0 >> [ 49.215369] Node 0 DMA: 17*4kB (UM) 13*8kB (M) 10*16kB (M) 3*32kB (= ME) 3*64kB (UME) 4*128kB (UME) 1*256kB (E) 2*512kB (UE) 2*1024kB (ME) 1*2= 048kB (E) 0*4096kB =3D 6508kB >> [ 49.215377] Node 0 DMA32: 8061*4kB (UME) 5892*8kB (UME) 2449*16kB (= UME) 604*32kB (UME) 207*64kB (UME) 49*128kB (UM) 7*256kB (M) 1*512kB (M) = 0*1024kB 0*2048kB 0*4096kB =3D 159716kB >> [ 49.215388] 148696 total pagecache pages >> [ 49.215388] 0 pages in swap cache >> [ 49.215389] Swap cache stats: add 0, delete 0, find 0/0 >> [ 49.215390] Free swap =3D 0kB >> [ 49.215390] Total swap =3D 0kB >> [ 49.215391] 392939 pages RAM >> [ 49.215391] 0 pages HighMem/MovableOnly >> [ 49.215391] 31002 pages reserved >> [ 49.215392] 0 pages cma reserved >> [ 49.215393] 0 pages hwpoisoned >> >> Is this a known issue and/or am I doing something wrong? I only notice= d >> this because there are times when I am compiling something intensive i= n >> the VM such as LLVM and the VM runs out of memory even though I have >> plenty of free memory on the host but I am not sure if this warning is >> related to that issue. Hi, Is hotplugged memory getting onlined automatically (either from user=20 space via a udev script or via the kernel, for example, with=20 CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE)? If it's not getting onlined, you easily sport after hotplug e.g., via=20 "lsmem" that there are quite some offline memory blocks. Note that x86_64 code will fallback from populating huge pages to=20 populating base pages for the vmemmap; this can happen easily when under=20 memory pressure. If adding memory would fail completely, you'd see another "hot_add=20 memory failed error is ..." error message from hyper-v in the kernel=20 log. If that doesn't show up, it's simply suboptimal, but hotplugging=20 memory still succeeded. Note: we could support "memmap_on_memory" in some cases (e.g., no memory=20 holes in hotadded range) when hotplugging memory blocks via hyper-v,=20 which would result in this warning less trigger less frequently. --=20 Thanks, David / dhildenb