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=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 556A1C433DB for ; Mon, 4 Jan 2021 15:45:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0DA7E2242A for ; Mon, 4 Jan 2021 15:45:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DA7E2242A 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 7307F8D0018; Mon, 4 Jan 2021 10:45:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E01B8D000A; Mon, 4 Jan 2021 10:45:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F63E8D0018; Mon, 4 Jan 2021 10:45:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 4A12B8D000A for ; Mon, 4 Jan 2021 10:45:00 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0A6A7362C for ; Mon, 4 Jan 2021 15:45:00 +0000 (UTC) X-FDA: 77668515960.26.doll38_5c0c7fe274d1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id D13841804B670 for ; Mon, 4 Jan 2021 15:44:59 +0000 (UTC) X-HE-Tag: doll38_5c0c7fe274d1 X-Filterd-Recvd-Size: 4153 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 Jan 2021 15:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609775098; 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=pD/uZmmSfcpcuCR92GzEbl7qjxcEmh7REW98hW37o74=; b=MrWB5gquSYoQv3dkzDpuH632KDv4Y9Y+aPSLz3rJbWm1/o4f+Ath4tDjzt/VH+DhuNPMA2 IghHOpXJv0ngqiG5wI4Su5ByMNSOSG1LbgBXwV7pzkCKEON/LsPOizUKJgqLHZkYvPVZQW Ye8mIWMixlVwrvjZIVKatoVc/sCG+Dg= 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-44-OweIgBPOPjGbuiR5cN0xyA-1; Mon, 04 Jan 2021 10:44:55 -0500 X-MC-Unique: OweIgBPOPjGbuiR5cN0xyA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1748815721; Mon, 4 Jan 2021 15:44:54 +0000 (UTC) Received: from [10.36.114.59] (ovpn-114-59.ams2.redhat.com [10.36.114.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1295D5D751; Mon, 4 Jan 2021 15:44:52 +0000 (UTC) Subject: Re: uninitialized pmem struct pages From: David Hildenbrand To: Michal Hocko Cc: Dan Williams , linux-mm@kvack.org, LKML , Oscar Salvador References: <20210104100323.GC13207@dhcp22.suse.cz> <033e1cd6-9762-5de6-3e88-47d3038fda7f@redhat.com> <20210104142624.GI13207@dhcp22.suse.cz> <23a4eea2-9fdb-fd1d-ee92-9cd8ac6e8f41@redhat.com> <20210104151005.GK13207@dhcp22.suse.cz> <26db2c3e-10c7-c6e3-23f7-21eb5101b31a@redhat.com> <20210104153300.GL13207@dhcp22.suse.cz> Organization: Red Hat GmbH Message-ID: <6106ca7f-3247-0916-3e1e-ad6af17272ea@redhat.com> Date: Mon, 4 Jan 2021 16:44:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 04.01.21 16:43, David Hildenbrand wrote: > On 04.01.21 16:33, Michal Hocko wrote: >> On Mon 04-01-21 16:15:23, David Hildenbrand wrote: >>> On 04.01.21 16:10, Michal Hocko wrote: >> [...] >>> Do the physical addresses you see fall into the same section as boot >>> memory? Or what's around these addresses? >> >> Yes I am getting a garbage for the first struct page belonging to the >> pmem section [1] >> [ 0.020161] ACPI: SRAT: Node 0 PXM 0 [mem 0x100000000-0x603fffffff] >> [ 0.020163] ACPI: SRAT: Node 4 PXM 4 [mem 0x6060000000-0x11d5fffffff] non-volatile >> >> The pfn without the initialized struct page is 0x6060000. This is a >> first pfn in a section. > > Okay, so we're not dealing with the "early section" mess I described, > different story. > > Due to [1], is_mem_section_removable() called > pfn_to_page(PHYS_PFN(0x6060000)). page_zone(page) made it crash, as not > initialized. > > Let's assume this is indeed a reserved pfn in the altmap. What's the > actual address of the memmap? > > I do wonder what hosts pfn_to_page(PHYS_PFN(0x6060000)) - is it actually > part of the actual altmap (i.e. > 0x6060000) or maybe even self-hosted? > > If it's not self-hosted, initializing the relevant memmaps should work > just fine I guess. Otherwise things get more complicated. Oh, I forgot: pfn_to_online_page() should at least in your example make sure other pfn walkers are safe. It was just an issue of is_mem_section_removable(). -- Thanks, David / dhildenb