Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp30701pxf; Wed, 24 Mar 2021 19:57:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrAm7bm6lq7oQPwnwraJdrZx/SaSecI8mKdhZxXbgAZXBscPJVVdCBL6a0BONzzjlLCmFL X-Received: by 2002:a17:907:d10:: with SMTP id gn16mr6864136ejc.304.1616641071859; Wed, 24 Mar 2021 19:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616641071; cv=none; d=google.com; s=arc-20160816; b=M0kqVuNeVgD7R6K8FjNrtmT/BKWIHaOOXi90/0RVYOANKbolQ+SFWz8Vp/MqVekhSF ZsD03GUj8e4tv3oNMtqCk/hFwR18bS81Kxr+5NkaeOVAqB3zJshl1F8+OXb820cAIWra PofPgr66rziUgPgUsOBh1elpzqtb13gcFNJJizU8t95GzqWkN2N4HFSvDC24BIW87nCV rcggJKnC4qqXHjOJdVTOFYLVgcedWXC5C7wtUvH4oWSijEfP12yBwXO1u0UYonuvGkhc gS/qZHzEx9YXM6SPM/mE559RehSSQskZ4zgq7bS4bJRP556s3FSZ/6DSoG8ENT+3wZ6H 4eEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject :organization:from:references:cc:to:dkim-signature; bh=oEtMbE1m2IC72jJ8v6aeU/OBewRFspn2AuP8ScrD10I=; b=EMi/EcH4+UILOWnrGQ2Biwg4iX57eW451XI5J5SCd+0G/xzuCdJC6xAfJZN1fr4/4D qzg77fIBlzCKWSc4m8DMsZh1cD/qZHT5ZAZ9ex+BPhJiPErkqjdApRihKs5pIvpNX5nZ 65dfi/SnorOOkU52/pAoTbJQ+Bh2SEe3xTvKNGaTJL4H5OD+1KzYhGEbECZHRewlyiHv QrGAv9gldJCz2LaWkY+jdujlhpziOOy3JXIse0D+95cFE7D1Kosq+eCOUQrRu3qZcd1z PaNOSGKLSGIFFUune1KyKwyPpFgNh11zy/rAk30XryXGdadytnPsc8ZArzu6G4NaMT+/ +8Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XDMPt2nH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si3662731edd.384.2021.03.24.19.57.29; Wed, 24 Mar 2021 19:57:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XDMPt2nH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232960AbhCXL2v (ORCPT + 99 others); Wed, 24 Mar 2021 07:28:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33607 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232545AbhCXL2j (ORCPT ); Wed, 24 Mar 2021 07:28:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616585318; 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=oEtMbE1m2IC72jJ8v6aeU/OBewRFspn2AuP8ScrD10I=; b=XDMPt2nHqz6XJwEcJMmMRgigRo6sHCeynSGi0RwIdu3UcQiM6z58BjyIFiww7IMn/iszbQ SSiI80s8pOZaF5w0weN2oNfN/OvBU2ytv1zPpJHDja/Uuer5koyOG1hsCZZfFy1u+dMM81 6A44S2N9JwMCh0b6y4ScLkpvcuMSsGs= 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-72-EBTSN4fnMNW2hktyP4UpDA-1; Wed, 24 Mar 2021 07:28:34 -0400 X-MC-Unique: EBTSN4fnMNW2hktyP4UpDA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA8AF1005584; Wed, 24 Mar 2021 11:28:31 +0000 (UTC) Received: from [10.36.115.66] (ovpn-115-66.ams2.redhat.com [10.36.115.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA4A15D9D0; Wed, 24 Mar 2021 11:28:22 +0000 (UTC) To: Oscar Salvador Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Greg Kroah-Hartman , Dan Williams , Daniel Vetter , Andy Shevchenko , Mauro Carvalho Chehab , Dave Young , Baoquan He , Vivek Goyal , Dave Hansen , Keith Busch , Michal Hocko , Qian Cai , Eric Biederman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Tom Lendacky , Brijesh Singh , x86@kernel.org, kexec@lists.infradead.org References: <20210322160200.19633-1-david@redhat.com> <20210322160200.19633-2-david@redhat.com> <20210324111835.GA18855@linux> From: David Hildenbrand Organization: Red Hat GmbH Subject: Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources Message-ID: <8aa6af09-6f8b-1f50-820f-90eab0993f1c@redhat.com> Date: Wed, 24 Mar 2021 12:28:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210324111835.GA18855@linux> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.03.21 12:18, Oscar Salvador wrote: > On Mon, Mar 22, 2021 at 05:01:58PM +0100, David Hildenbrand wrote: >> It used to be true that we can have busy system RAM only on the first level >> in the resourc tree. However, this is no longer holds for driver-managed >> system RAM (i.e., added via dax/kmem and virtio-mem), which gets added on >> lower levels. > > Let me ask some rookie questions: > > What does "busy" term stand for here? IORESOURCE_BUSY - here: actually added, not just some reserved range / container. > Why resources coming from virtio-mem are added at a lower levels? Some information can be had from ebf71552bb0e690cad523ad175e8c4c89a33c333 commit ebf71552bb0e690cad523ad175e8c4c89a33c333 Author: David Hildenbrand Date: Thu May 7 16:01:35 2020 +0200 virtio-mem: Add parent resource for all added "System RAM" Let's add a parent resource, named after the virtio device (inspired by drivers/dax/kmem.c). This allows user space to identify which memory belongs to which virtio-mem device. With this change and two virtio-mem devices: :/# cat /proc/iomem 00000000-00000fff : Reserved 00001000-0009fbff : System RAM [...] 140000000-333ffffff : virtio0 140000000-147ffffff : System RAM 148000000-14fffffff : System RAM 150000000-157ffffff : System RAM [...] 334000000-3033ffffff : virtio1 338000000-33fffffff : System RAM 340000000-347ffffff : System RAM 348000000-34fffffff : System RAM [...] For dax/kmem it comes naturally due to the "Persistent Memory" and device parent resources like: 140000000-33fffffff : Persistent Memory 140000000-1481fffff : namespace0.0 150000000-33fffffff : dax0.0 150000000-33fffffff : System RAM (kmem) 3280000000-32ffffffff : PCI Bus 0000:00 Thanks -- Thanks, David / dhildenb