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.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 52765C34022 for ; Wed, 19 Feb 2020 03:39:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB7F122B48 for ; Wed, 19 Feb 2020 03:39:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EsA49Gqg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB7F122B48 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 5AE4F6B0003; Tue, 18 Feb 2020 22:39:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 55EE06B0006; Tue, 18 Feb 2020 22:39:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44DB76B0007; Tue, 18 Feb 2020 22:39:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id 2C6A46B0003 for ; Tue, 18 Feb 2020 22:39:55 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B44AC8248047 for ; Wed, 19 Feb 2020 03:39:54 +0000 (UTC) X-FDA: 76505472708.24.title08_567ded4343659 X-HE-Tag: title08_567ded4343659 X-Filterd-Recvd-Size: 5105 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 03:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582083593; 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=qJKSPN0CHDzpX0slbxWtPKfLlENFVIb16pfjhJ5o6Kw=; b=EsA49GqgQsZj2iK7hcqMpPh2guglqhCQQm0NEjXT0j7vkiH+n7IIUC72o5mX+I4FxfIbxa WqWM+bWd3wRLRtASDMPjqBfOUsmygmulpll4vczJ4X8eZTEmISl7JoawiCGAKAx4VDU4pt 9Ep94Pt6+/RbONc3MoK94HvobhxqtpI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-209-8DxdMdDRO3KkcwY54tLyCQ-1; Tue, 18 Feb 2020 22:39:50 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 70148107ACC9; Wed, 19 Feb 2020 03:39:48 +0000 (UTC) Received: from localhost (ovpn-12-16.pek2.redhat.com [10.72.12.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57F9090761; Wed, 19 Feb 2020 03:39:44 +0000 (UTC) Date: Wed, 19 Feb 2020 11:39:43 +0800 From: Baoquan He To: kkabe@vega.pgw.jp Cc: david@redhat.com, osalvador@suse.de, bugzilla-daemon@bugzilla.kernel.org, akpm@linux-foundation.org, richardw.yang@linux.intel.com, mhocko@kernel.org, n-horiguchi@ah.jp.nec.com, linux-mm@kvack.org Subject: Re: [Bug 206401] kernel panic on Hyper-V after 5 minutes due to memory hot-add Message-ID: <20200219033943.GA24216@MiWiFi-R3L-srv> References: <20200217112054.GA9823@MiWiFi-R3L-srv> <200218152448.M0114841@vega.pgw.jp> MIME-Version: 1.0 In-Reply-To: <200218152448.M0114841@vega.pgw.jp> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 8DxdMdDRO3KkcwY54tLyCQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 02/18/20 at 03:24pm, kkabe@vega.pgw.jp wrote: > bhe@redhat.com sed in <20200217112054.GA9823@MiWiFi-R3L-srv> > >> Please try below code instead, see if it works. However, as David and > >> and Michal said in other reply, if no real use case, we may not be so > >> eager to support mem hotplug on i386.=20 > >>=20 > >>=20 > >> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > >> index 475d0d68a32c..9faf47bd026e 100644 > >> --- a/mm/memory_hotplug.c > >> +++ b/mm/memory_hotplug.c > >> @@ -715,15 +715,20 @@ static struct zone *default_kernel_zone_for_pfn(= int nid, unsigned long start_pfn > >> { > >> =09struct pglist_data *pgdat =3D NODE_DATA(nid); > >> =09int zid; > >> +=09enum zone_type default_zone =3D ZONE_NORMAL; > >> =20 > >> -=09for (zid =3D 0; zid <=3D ZONE_NORMAL; zid++) { > >> +#ifdef CONFIG_HIGHMEM > >> +=09default_zone =3D ZONE_HIGHMEM; > >> +#endif > >> + > >> +=09for (zid =3D 0; zid <=3D default_zone; zid++) { > >> =09=09struct zone *zone =3D &pgdat->node_zones[zid]; > >> =20 > >> =09=09if (zone_intersects(zone, start_pfn, nr_pages)) > >> =09=09=09return zone; > >> =09} > >> =20 > >> -=09return &pgdat->node_zones[ZONE_NORMAL]; > >> +=09return &pgdat->node_zones[default_zone]; > >> } > >> =20 > >> static inline struct zone *default_zone_for_pfn(int nid, unsigned lon= g start_pfn, > >>=20 > >>=20 >=20 > Tried out the above patch. > It seems to be working; no panic, total memory has increased and > the hot-added memory is added as HIGHMEM. > Minimal install of 168MB memory worked, so this time the sample is > running anaconda installer starting at 512MB. > Eventually memory was hot-added to around 1.2GB. >=20 > The weird pr_info() from populate_section_memmap() is still remaining tho= ugh... >=20 > 2nd parameter of add_memory() (phys_addr_t, 32bit on non-PAE) is=20 > going up to 0x60000000, so drivers/hv/hv_balloon.c:hv_mem_hot_add() may n= eed > limit check to not overflow 4GB for heavier usage. > (Yes you should limit it in hypervisor dialog, but default is 1TB) >=20 >=20 > Do we need modifications for arch/x86/mm/init_32.c:arch_add_memory() > so that the hot-added memory is always in highmem area? > Currently it just >>PAGE_SHIFT given parameters and call generic __add_pa= ges(). Hmm, it may not be hot added into highmem area always, if possible, it can = be added into movable area. From my point of view, the above change is enough to make it work. Sorry, man. The i386 is too old, as you see, people is more willing to deprecate it so that focus on 64bit arch. You can still patch your kernel with above code change for a while, but possibly won't be very long. Thanks Baoquan