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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42ADEC04A95 for ; Sat, 24 Sep 2022 01:03:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B45980037; Fri, 23 Sep 2022 21:03:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 964AD80016; Fri, 23 Sep 2022 21:03:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 805D380037; Fri, 23 Sep 2022 21:03:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 706A080016 for ; Fri, 23 Sep 2022 21:03:24 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 468BE40198 for ; Sat, 24 Sep 2022 01:03:24 +0000 (UTC) X-FDA: 79945180728.19.E1245B8 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf27.hostedemail.com (Postfix) with ESMTP id 7069040005 for ; Sat, 24 Sep 2022 01:03:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663981403; x=1695517403; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OBLqHu4HrfxZrshSMCaixAcofJF9yzq0ARl2qAoeSc8=; b=edU58er3m36DGsd686PbHzBpv1bCLIgxXHFy54lNFMx6MxxIFSe44ugb AqqMTVc3Ah6krKp7ckSnh0urHGddALhFMdVPdHjofUPnkdMvc6oqnF0dF lBM7BR+G0n0LJ1ynXNLrq8E/apxxaeUYIYZeWpOswwTtZAPs1AwZNYf8+ drUaVNXewGHHOzENyoNzTn2RYVVJn+Yu7TshC6uj1f0puB97Bm9E1VkCg ca3JS0P7agAZvTXmoDuqLW9Wiy+FyJiYgTQdM+9JsrtxDCe3yzOMonicN o3lMZrjymhTd+0WVlanTfBh0Ekg0pjujmGRBkQCcUzYZx7+EtubK6VRcE w==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="298328580" X-IronPort-AV: E=Sophos;i="5.93,340,1654585200"; d="scan'208";a="298328580" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 18:03:11 -0700 X-IronPort-AV: E=Sophos;i="5.93,340,1654585200"; d="scan'208";a="724350159" Received: from pameiner-mobl2.amr.corp.intel.com (HELO box.shutemov.name) ([10.252.58.236]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 18:03:05 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id D7FE51028F1; Sat, 24 Sep 2022 04:03:02 +0300 (+03) Date: Sat, 24 Sep 2022 04:03:02 +0300 From: "Kirill A. Shutemov" To: Tom Lendacky Cc: Dionna Amalie Glaze , Dave Hansen , Mel Gorman , Vlastimil Babka , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Dario Faggioli , Mike Rapoport , David Hildenbrand , Marcelo Cerri , tim.gardner@canonical.com, Khalid ElMously , philip.cox@canonical.com, the arch/x86 maintainers , Linux Memory Management List , linux-coco@lists.linux.dev, linux-efi , LKML , Mike Rapoport Subject: Re: [PATCHv7 02/14] mm: Add support for unaccepted memory Message-ID: <20220924010302.bwas4zbro37rrxai@box.shutemov.name> References: <20220810141959.ictqchz7josyd7pt@techsingularity.net> <2981e25e-9cda-518a-9750-b8694f2356b5@amd.com> <984e07ed-914f-93ca-a141-3fc8677878e0@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663981403; a=rsa-sha256; cv=none; b=CNceG9RnqeZ5nYLE2E0kxLonGPfxog3cycYMsNS3c5Xcq138zLGXz7pKAXBGFq7jmay4+u JSRCZ2yJop4kB0v6a8P0yINQ7u4Y58IfbxdjJZ7yHMHgDzPkyCjV3DR1fMrT4X0iSFhFEz CKzFBCYZabnTJDwbRRP+zFl+wXkpeTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663981403; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ERlYUTFsGGbF32his8Sdm42kgbDyZEWHSO3kDITKOZY=; b=D/ZjEdYIpQQl7/W4keyCbbK0iYI3I9mqVPJzw+fKDAchYz31/RiZ/Y7TBqCw/wyrT/Z/AG 4lPlqAwVe9BEizdDmfjopCqsNvMG2dBBlkCn47Vc2CBUraEfgUaqx66/WUtvICf8N6kSDk Bg3ZwHNmGQtSu1IP0QXkZbIlbP/wj48= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=edU58er3; spf=none (imf27.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail reason="No valid SPF" header.from=intel.com (policy=none) X-Stat-Signature: cpcwxrppsdm7zq5dten6mc4c4h5bjrdg X-Rspamd-Queue-Id: 7069040005 Authentication-Results: imf27.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=edU58er3; spf=none (imf27.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail reason="No valid SPF" header.from=intel.com (policy=none) X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1663981403-323375 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 Thu, Sep 22, 2022 at 09:31:12AM -0500, Tom Lendacky wrote: > On 9/8/22 14:28, Mike Rapoport wrote: > > On Thu, Sep 08, 2022 at 09:23:07AM -0700, Dionna Amalie Glaze wrote: > > > > > > > > Looks like the first access to the memory map fails, although I think > > > > it's not in INIT_LIST_HEAD() but rather in init_page_count(). > > > > > > > > I'd start with making sure that page_alloc::memmap_alloc() actually returns > > > > accepted memory. If you build kernel with CONFIG_DEBUG_VM=y the memory map > > > > will poisoned in this function, so my guess is it'd crash there. > > > > > > > > > > That's a wonderful hint, thank you! I did not run this test > > > CONFIG_DEBUG_VM set, but you think it's possible it could still be > > > here? > > > > It depends on how you configured your kernel. Say, defconfig does not set > > it. > > > > I also hit the issue at 256GB. My config is using CONFIG_SPARSEMEM_VMEMMAP > and fails in memmap_init_range() when attempting to add the first PFN. It > looks like the underlying page that is backing the vmemmap has not been > accepted (I receive a #VC 0x404 => page not validated). > > Kirill, is this a path that you've looked at? It would appear that somewhere > in the vmemmap_populate_hugepages() path, some memory acceptance needs to be > done for the pages that are used to back vmemmap. I'm not very familiar with > this code, so I'm not sure why everything works for a guest with 255GB of > memory, but then fails for a guest with 256GB of memory. Hm. I don't have machine that large at hands at the moment. And I have not looked at the codepath before. I will try to look into the issue. -- Kiryl Shutsemau / Kirill A. Shutemov