Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3556089imu; Fri, 18 Jan 2019 12:28:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN4GHsgSCZiyK9ATBrhkfPZDjIAuHTJtoFNsn/MtotRhTRzmWcHJV5YPeZLqChBZxW35AjSs X-Received: by 2002:a63:6442:: with SMTP id y63mr19032050pgb.450.1547843312119; Fri, 18 Jan 2019 12:28:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547843312; cv=none; d=google.com; s=arc-20160816; b=OqqPQIiaQ2SXTyOpqdQhE8+CPR+Tc72lyzTn1ZcIyPm/fv4dFgORxnN20TlpoqDJ6f hIImQ2YtzgcEBIFmf1o/ofmmPQkbMDwpraKY2po8z1zo0hjO48GCuFXiw1FELpaA6vxc IR98DsZzI3na9XmEqLPFzzMGez6Mg9SUolOmPSKnFArTCh1eJxmUzwRI7YpzsqM5vZ3I V61kfxiyIUEZ7cUXmJw1FY33CUgxL4udB17g8wWB7Gc719WswKtvrBNP+vSvPzhORJhF vN8DTncG/S03umACM6FooruC9ZLX/MhOapQmGItAGa1ViBvSb6MaaIkKV4PtuIyLFcMD kj3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=e40oT9ZML87E8pZ1x6suU2rWn6Wj2kLbCuYMCpCU4Lc=; b=sbqHeJLbzX427frf8c12PzAoZPsH0Flmwlbr6cacdmXQIsRjNT4v3BMsfQPA0mEG5N pDGdkL7D8wpfF+elKbmQkPAn4UncwsJfcocoi64Co+WW2b8/Hzcmh9elW6yNAd6bgLJB OiVyxyuM5DU1lDcpehAqWzK0Pgr7my/zqF6T9ohFPcHIY+YF1tPdyPiP9KgW9i61K0EO i3u+YnQcB5DMQSoHZIMEwWoXYElGmv8ah+a9DaniswdFKYKicRfR0pjKX9CgPGQ5WBWW bVLWQc5n/54BkPPjUXogoebww2w3Jn/fsHpozJ6jO2Sq1mu8LaKC9po7HUyqPZe6KPje v6jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si5813184pgb.140.2019.01.18.12.28.16; Fri, 18 Jan 2019 12:28:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729456AbfARU0Z (ORCPT + 99 others); Fri, 18 Jan 2019 15:26:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48934 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729309AbfARU0Y (ORCPT ); Fri, 18 Jan 2019 15:26:24 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A17737E8F; Fri, 18 Jan 2019 20:26:23 +0000 (UTC) Received: from redhat.com (ovpn-123-236.rdu2.redhat.com [10.10.123.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6EBB160BE8; Fri, 18 Jan 2019 20:26:20 +0000 (UTC) Date: Fri, 18 Jan 2019 15:26:18 -0500 From: Jerome Glisse To: Dave Hansen Cc: Dave Hansen , dave@sr71.net, dan.j.williams@intel.com, dave.jiang@intel.com, zwisler@kernel.org, vishal.l.verma@intel.com, thomas.lendacky@amd.com, akpm@linux-foundation.org, mhocko@suse.com, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ying.huang@intel.com, fengguang.wu@intel.com, bp@suse.de, bhelgaas@google.com, baiyaowei@cmss.chinamobile.com, tiwai@suse.de Subject: Re: [PATCH 2/4] mm/memory-hotplug: allow memory resources to be children Message-ID: <20190118202618.GB3060@redhat.com> References: <20190116181859.D1504459@viggo.jf.intel.com> <20190116181902.670EEBC3@viggo.jf.intel.com> <20190116191635.GD3617@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 18 Jan 2019 20:26:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 18, 2019 at 11:58:54AM -0800, Dave Hansen wrote: > On 1/16/19 11:16 AM, Jerome Glisse wrote: > >> We *could* also simply truncate the existing top-level > >> "Persistent Memory" resource and take over the released address > >> space. But, this means that if we ever decide to hot-unplug the > >> "RAM" and give it back, we need to recreate the original setup, > >> which may mean going back to the BIOS tables. > >> > >> This should have no real effect on the existing collision > >> detection because the areas that truly conflict should be marked > >> IORESOURCE_BUSY. > > > > Still i am worrying that this might allow device private to register > > itself as a child of some un-busy resource as this patch obviously > > change the behavior of register_memory_resource() > > > > What about instead explicitly providing parent resource to add_memory() > > and then to register_memory_resource() so if it is provided as an > > argument (!NULL) then you can __request_region(arg_res, ...) otherwise > > you keep existing code intact ? > > We don't have the locking to do this, do we? For instance, all the > locking is done below register_memory_resource(), so any previous > resource lookup is invalid by the time we get to register_memory_resource(). Yeah you are right, maybe just a bool then ? bool as_child Cheers, J?r?me