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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0845C433F5 for ; Wed, 29 Sep 2021 16:54:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 66CC66142A for ; Wed, 29 Sep 2021 16:54:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 66CC66142A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AC830940045; Wed, 29 Sep 2021 12:54:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A515694003A; Wed, 29 Sep 2021 12:54:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F0E5940045; Wed, 29 Sep 2021 12:54:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id 7B5A694003A for ; Wed, 29 Sep 2021 12:54:07 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 355722FD94 for ; Wed, 29 Sep 2021 16:54:07 +0000 (UTC) X-FDA: 78641208534.21.A28DC2E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf12.hostedemail.com (Postfix) with ESMTP id C4F1310000B8 for ; Wed, 29 Sep 2021 16:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632934446; 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=wz7/LCBNzU2qEx/p5MvqtYMtlnh6TSWHAxM6fGc3vyI=; b=TTwHjR46KozkAq0BMn8cFZx5FUnCX3JkVpl/ZXDFdD/h52M+tEgfaBYbD6MWrO7vFj/YQN g8MW6+1s7SkewgncyhzTDGl7aEWbG5IY0EhblVRwUDvO1GVYOYpMjWuADhmwQjpi+/5hXj X4SNHmvKpbPCYKjJg8yPRZrc30MQBYM= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-L97Uxh7OOjqwaEElCRKK0w-1; Wed, 29 Sep 2021 12:54:05 -0400 X-MC-Unique: L97Uxh7OOjqwaEElCRKK0w-1 Received: by mail-wm1-f69.google.com with SMTP id 200-20020a1c00d1000000b0030b3dce20e1so3000384wma.0 for ; Wed, 29 Sep 2021 09:54:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=wz7/LCBNzU2qEx/p5MvqtYMtlnh6TSWHAxM6fGc3vyI=; b=oSnrOqRnqo7u9qqF5zx4MkRerFfa5Uwy4b22ZQnZ5WXT8ztD3YOt6pGadzBLeXARww Fb/GB6XTlRDjuw7C96qE7y+ygfK4wwFkFPyJgBvLV0EYiWVUgwSOxpPMvVpBkoOxZv9q 6/9QqvHQfCY95CwSCzHfBhaqibGMr1D3/kq1vJUr+yPuxIBR2JcZD37lWj98/Yo861XT 1c1oIh1A66kXkvtxJZ5uzK9oIDxkfJv8qlec9e9YI00svR3UinQBOHAw/Bhc9UOZVoTp vaTkw1vN3LMepZnwxFkEzKerMQ7DuUuYHdrOpFZY2WbbF3qROlED2TzQtk/6qGDRMnXr 2rxA== X-Gm-Message-State: AOAM5303t8rf3gu1MkC2egpprBxnKHNpmN/702qKtZYagKXzLinlDG5q U+aMoqLwtmHCHXyv6tHgG2Rl5ANvFJi+CfmmQazMm+pRtORUPrbvZGvsxcq4Q4g/e29OOyBciPS cLwJryYN+7dI= X-Received: by 2002:adf:de86:: with SMTP id w6mr1061905wrl.287.1632934443885; Wed, 29 Sep 2021 09:54:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGkSiAZ0xz7kEyNo1HVkBwp/AkS+PaM+h+PvcslevGOtwequrlIC8Rb0h3s3NmIdNpczjkgw== X-Received: by 2002:adf:de86:: with SMTP id w6mr1061866wrl.287.1632934443713; Wed, 29 Sep 2021 09:54:03 -0700 (PDT) Received: from [192.168.3.132] (p4ff23c3b.dip0.t-ipconnect.de. [79.242.60.59]) by smtp.gmail.com with ESMTPSA id m4sm465862wrx.81.2021.09.29.09.54.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Sep 2021 09:54:03 -0700 (PDT) To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko , Oscar Salvador , Jianyong Wu , "Aneesh Kumar K . V" , Vineet Gupta , Geert Uytterhoeven , Huacai Chen , Jiaxun Yang , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Eric Biederman , Arnd Bergmann , linux-snps-arc@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-mm@kvack.org, kexec@lists.infradead.org References: <20210927150518.8607-1-david@redhat.com> <20210927150518.8607-4-david@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v1 3/4] memblock: add MEMBLOCK_DRIVER_MANAGED to mimic IORESOURCE_SYSRAM_DRIVER_MANAGED Message-ID: <830c1670-378b-0fb6-bd5e-208e545fa126@redhat.com> Date: Wed, 29 Sep 2021 18:54:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C4F1310000B8 X-Stat-Signature: poy39nyxpuryzs3ek4ta7gmfuhdiis91 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=TTwHjR46; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf12.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-HE-Tag: 1632934446-643563 Content-Transfer-Encoding: quoted-printable 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 29.09.21 18:39, Mike Rapoport wrote: > Hi, >=20 > On Mon, Sep 27, 2021 at 05:05:17PM +0200, David Hildenbrand wrote: >> Let's add a flag that corresponds to IORESOURCE_SYSRAM_DRIVER_MANAGED. >> Similar to MEMBLOCK_HOTPLUG, most infrastructure has to treat such mem= ory >> like ordinary MEMBLOCK_NONE memory -- for example, when selecting memo= ry >> regions to add to the vmcore for dumping in the crashkernel via >> for_each_mem_range(). > =20 > Can you please elaborate on the difference in semantics of MEMBLOCK_HOT= PLUG > and MEMBLOCK_DRIVER_MANAGED? > Unless I'm missing something they both mark memory that can be unplugge= d > anytime and so it should not be used in certain cases. Why is there a n= eed > for a new flag? In the cover letter I have "Alternative B: Reuse MEMBLOCK_HOTPLUG.=20 MEMBLOCK_HOTPLUG serves a different purpose, though.", but looking into=20 the details it won't work as is. MEMBLOCK_HOTPLUG is used to mark memory early during boot that can later=20 get hotunplugged again and should be placed into ZONE_MOVABLE if the=20 "movable_node" kernel parameter is set. The confusing part is that we talk about "hotpluggable" but really mean=20 "hotunpluggable": the reason is that HW flags DIMM slots that can later=20 be hotplugged as "hotpluggable" even though there is already something=20 hotplugged. For example, ranges in the ACPI SRAT that are marked as=20 ACPI_SRAT_MEM_HOT_PLUGGABLE will be marked MEMBLOCK_HOTPLUG early during=20 boot (drivers/acpi/numa/srat.c:acpi_numa_memory_affinity_init()). Later,=20 we use that information to size ZONE_MOVABLE=20 (mm/page_alloc.c:find_zone_movable_pfns_for_nodes()). This will make=20 sure that these "hotpluggable" DIMMs can later get hotunplugged. Also, see should_skip_region() how this relates to the "movable_node"=20 kernel parameter: /* skip hotpluggable memory regions if needed */ if (movable_node_is_enabled() && memblock_is_hotpluggable(m) && (flags & MEMBLOCK_HOTPLUG)) return true; Long story short: MEMBLOCK_HOTPLUG has different semantics and is a=20 special case for "movable_node". --=20 Thanks, David / dhildenb