Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp163853imj; Wed, 13 Feb 2019 06:25:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IYmtYo9uv+SKczLwvCFiQBJn/Sji2lzMAlLCyhr7HLBqT/VYufJsxjYJM1ze/56cjQYz0rv X-Received: by 2002:a62:47d9:: with SMTP id p86mr732609pfi.95.1550067900316; Wed, 13 Feb 2019 06:25:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550067900; cv=none; d=google.com; s=arc-20160816; b=g5nd1DLgFBpAVqOHP1UcPNtcKrUCfHZLyvWtMTZduKKYKX+1RxSJf+3AmIiaNmsVf4 WQ+jnm4XcM8LPNweApqDMK0agTFPcnNaDlyMCb9+wSPl0znOuP9VrNtL5AtSA48b394G jYnR4mhDD6xgnAaNKZ4Kq5px1bCc+bnNB9u85OSxW2ero736SszQajuxjVd4FdnsLX7x smhrHuu1m/6yFxHQlfgOiGtj3e+BgbBEEpWJfs067z3JKDHd7grdFIhqBZzR+GXKvJbU 8MZyfMF+4Tg22f41Z/ZfIZyWYHIgec4/DN/xwFyi7fW0y6zM7xJrswmGPFFtIsHotGg9 xmPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:references:cc:to:from:subject; bh=emUdtZZS39L2W6qk7zlzTWRJClGtDNm49r0zM21Fq84=; b=f2HjsWruT+Dgrnca5o41eN/aP6zUpxk0Zl7Fi3zAHmP2XWmFx1ua5EAn5FBjozSdRG yOK4p17kwd5v2i+ecKyN0HK+F09Bchdti5vxz4Fv9/J2xyTdZElP4nSONjupC5alzzDF AVRWovr7XFQ/IdgTWqxqfw2WLhfI4Ezd164NuW9EQMgnCZt6w9Xw4FFHzNcxWLXM0eHr jw4gv9/nTr+wM0hcWu895PFIoYD6ghHD+0qtdOA95OQzWopexc6/4b//qkWBugVb1OqC 7CmXINnmEMLPp0FhO85JNn9y93Mu4ffHNWgWIoE+675Ya1CsHJmTUAL3+kx5eyOAoDRs ubQA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i62si3285570pli.239.2019.02.13.06.24.43; Wed, 13 Feb 2019 06:25:00 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388928AbfBMNHD (ORCPT + 99 others); Wed, 13 Feb 2019 08:07:03 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:35546 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733281AbfBMNHD (ORCPT ); Wed, 13 Feb 2019 08:07:03 -0500 X-IronPort-AV: E=Sophos;i="5.58,365,1544482800"; d="scan'208";a="369257766" Received: from unknown (HELO [193.50.110.185]) ([193.50.110.185]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 13 Feb 2019 14:06:59 +0100 Subject: Re: [PATCH 5/5] dax: "Hotplug" persistent memory for use like normal RAM From: Brice Goglin To: Dan Williams Cc: Dave Hansen , Linux Kernel Mailing List , Tom Lendacky , Michal Hocko , linux-nvdimm , Takashi Iwai , Ross Zwisler , Linux MM , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Fengguang Wu , Yaowei Bai , "Huang, Ying" , Bjorn Helgaas , Andrew Morton , Borislav Petkov References: <20190124231441.37A4A305@viggo.jf.intel.com> <20190124231448.E102D18E@viggo.jf.intel.com> <26ac36f4-7391-5321-217b-50d67e2119d7@intel.com> <453f13cd-a7fe-33eb-9a27-8490825ca29c@inria.fr> <057ad938-e745-02f7-edce-e19bd326da6a@inria.fr> Openpgp: preference=signencrypt Autocrypt: addr=Brice.Goglin@inria.fr; prefer-encrypt=mutual; keydata= mQINBFNg91oBEADMfOyfz9iilNPe1Yy3pheXLf5O/Vpr+gFJoXcjA80bMeSWBf4on8Mt5Fg/ jpVuNBhii0Zyq4Lip1I2ve+WQjfL3ixYQqvNRLgfw/FL0gNHSOe9dVFo0ol0lT+vu3AXOVmh AM4IrsOp2Tmt+w89Oyvu+xwHW54CJX3kXp4c7COz79A6OhbMEPQUreerTavSvYpH5pLY55WX qOSdjmlXD45yobQbMg9rFBy1BECrj4DJSpym/zJMFVnyC5yAq2RdPFRyvYfS0c491adD/iw9 eFZY1XWj+WqLSW8zEejdl78npWOucfin7eAKvov5Bqa1MLGS/2ojVMHXJN0qpStpKcueV5Px igX8i4O4pPT10xCXZ7R6KIGUe1FE0N7MLErLvBF6AjMyiFHix9rBG0pWADgCQUUFjc8YBKng nwIKl39uSpk5W5rXbZ9nF3Gp/uigTBNVvaLO4PIDw9J3svHQwCB31COsUWS1QhoLMIQPdUkk GarScanm8i37Ut9G+nB4nLeDRYpPIVBFXFD/DROIEfLqOXNbGwOjDd5RWuzA0TNzJSeOkH/0 qYr3gywjiE81zALO3UeDj8TaPAv3Dmu7SoI86Bl7qm6UOnSL7KQxZWuMTlU3BF3d+0Ly0qxv k1XRPrL58IyoHIgAVom0uUnLkRKHczdhGDpNzsQDJaO71EPp8QARAQABtCRCcmljZSBHb2ds aW4gPEJyaWNlLkdvZ2xpbkBpbnJpYS5mcj6JAjgEEwECACIFAlNg+aMCGwMGCwkIBwMCBhUI AgkKCwQWAgMBAh4BAheAAAoJEESRkPMjWr076RoQAJhJ1q5+wlHIf+YvM0N1V1hQyf+aL35+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ko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <057ad938-e745-02f7-edce-e19bd326da6a@inria.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 13/02/2019 à 09:43, Brice Goglin a écrit : > Le 13/02/2019 à 09:24, Dan Williams a écrit : >> On Wed, Feb 13, 2019 at 12:12 AM Brice Goglin wrote: >>> Le 13/02/2019 à 01:30, Dan Williams a écrit : >>>> On Tue, Feb 12, 2019 at 11:59 AM Brice Goglin wrote: >>>>> # ndctl disable-region all >>>>> # ndctl zero-labels all >>>>> # ndctl enable-region region0 >>>>> # ndctl create-namespace -r region0 -t pmem -m devdax >>>>> { >>>>> "dev":"namespace0.0", >>>>> "mode":"devdax", >>>>> "map":"dev", >>>>> "size":"1488.37 GiB (1598.13 GB)", >>>>> "uuid":"ad0096d7-3fe7-4402-b529-ad64ed0bf789", >>>>> "daxregion":{ >>>>> "id":0, >>>>> "size":"1488.37 GiB (1598.13 GB)", >>>>> "align":2097152, >>>>> "devices":[ >>>>> { >>>>> "chardev":"dax0.0", >>>>> "size":"1488.37 GiB (1598.13 GB)" >>>>> } >>>>> ] >>>>> }, >>>>> "align":2097152 >>>>> } >>>>> # ndctl enable-namespace namespace0.0 >>>>> # echo -n dax0.0 > /sys/bus/dax/drivers/device_dax/remove_id >>>>> >>>>> >>>>> I tried with and without dax_pmem_compat loaded, but it doesn't help. >>>> I think this is due to: >>>> >>>> a9f1ffdb6a20 device-dax: Auto-bind device after successful new_id >>>> >>>> I missed that this path is also called in the remove_id path. Thanks >>>> for the bug report! I'll get this fixed up. >>> Now that remove_id is fixed, things fails later in Dave's procedure: >>> >>> # echo -n dax0.0 > /sys/bus/dax/drivers/device_dax/remove_id >>> # echo -n dax0.0 > /sys/bus/dax/drivers/device_dax/unbind >>> # echo -n dax0.0 > /sys/bus/dax/drivers/kmem/new_id >> In the current version of the code the bind is not necessary, so the >> lack of error messages here means the bind succeeded. It looks like "unbind" is required to make the PMEM appear as a new node. If I remove_id from devdax and new_id to kmem without "unbind" in the middle, nothing appears. Writing to "kmem/bind" didn't seem necessary. Brice >> >>> # echo -n dax0.0 > /sys/bus/dax/drivers/kmem/bind >>> -bash: echo: write error: No such device >> This also happens when the device is already bound. >> >>> (And nothing seems to have changed in /sys/devices/system/memory/*/state) >> What does "cat /proc/iomem" say? > > 3060000000-1aa5fffffff : Persistent Memory >   3060000000-36481fffff : namespace0.0 >   3680000000-1a9ffffffff : dax0.0 >     3680000000-1a9ffffffff : System RAM > (the last line wasn't here before attaching to kmem) > > I said nothing changed in memory/*/state, I actually meant that nothing > was offline. But things are actually working! > > First, node4 appeared, all memory is already attached to it without > having to write to memory/*/state > > Node 4 MemTotal:       1558183936 kB > Node 4 MemFree:        1558068564 kB > Node 4 MemUsed:          115372 kB > > I wasn't expecting node4 to appear because the machine has no > /sys/firmware/acpi/tables/HMAT when running in 1LM (there's one in 2LM). > I thought you said in the past that no HMAT would mean memory would be > added to the existing DDR node? > > Thanks! > > Brice > >