Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp296927imj; Wed, 13 Feb 2019 08:29:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IY+V/A+ku/hY7uf6lwuvJOpZNbW0CcvWT8bOLOb4d6pGqm8cWQzDoboYO5GeweJ9jNEkrl2 X-Received: by 2002:a65:62da:: with SMTP id m26mr1216750pgv.278.1550075375525; Wed, 13 Feb 2019 08:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550075375; cv=none; d=google.com; s=arc-20160816; b=HD9VPf31/CdjcO+ABgcr19JhBaLsyx1N7spCO53P2qdNuHPvkfP9KiTkXqOv6XJUSu 1wR8M0cf8TVdkRV4EfW00MTqUL1DX/fA2VApPofHBrGl5QpBmPgProEJ9CsqxYYsdVDD D9+EwOJwwit6bZf0krLCSg6OTW+WWeCDG7vX878xDLHa51IA2HoaXF+OohBpYTgtuUci EBAy/9Hh84GFPEL7mvcVwUUPRxqHoF/mGbNEs96D2e4p5CWwDE9UhM31c64Qcn82Dy/j BIDeujJI0CFjSjt8VpkuJ1JvPWrx8CWBecra7DHsGDAGAhglbXIn3e9sKvsubX9iB9DG OAdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6cgydVzEMe2hY+xvoZbvAXaDHt8Fvtz1odtZkVMvLmU=; b=AeG4KBGRfNdbGUP4KPHUbAtbuTS8kLPfN1e24EoVTS0dY7tL95A3YUbSgL6recfLmL aDc8DVWDTVaR2myWpw239wuecKgJmcNiGhUHX59Pxnb8GriXwCnHbP50tB5fL0Fdi4So Mg5nLJokERaJ9A99FxxFlxjIVKdMuQz+XHLIgvz3FU62H9xGtUaf4GRRvXh18eog8s0G kyO76Qbf0H4zUMCQZkf8sJZjlUFLn4lXD7TCMbIwJHXVgnTKl/EQ9vLGXGxsqSxWAvee yVynBcvIAC2TKplXf7Xj2UJxX577L59MNKFsNJeH6ApoLrPYPn/a6dv+HcriV6TJvR0A GQsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=sfnRNTN6; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a132si9798903pfa.112.2019.02.13.08.29.19; Wed, 13 Feb 2019 08:29:35 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=sfnRNTN6; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392571AbfBMQTT (ORCPT + 99 others); Wed, 13 Feb 2019 11:19:19 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:40926 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729502AbfBMQTS (ORCPT ); Wed, 13 Feb 2019 11:19:18 -0500 Received: by mail-ot1-f65.google.com with SMTP id s5so5112183oth.7 for ; Wed, 13 Feb 2019 08:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6cgydVzEMe2hY+xvoZbvAXaDHt8Fvtz1odtZkVMvLmU=; b=sfnRNTN67G5hJbWbDrOvTOiV7JaDoiYNtomEZeOJ2Cg4RlKrQAEZMEE8GCPO7UvHLj GPR1r1bWUfYVEaEFMOnYaAhZI6P89ivWehuRk8b/h3lxf0FMXyQus6ly/WmBXLgZ7FKK nZf9v/JUojwBuy+JU1zQG9561ufog6r5xqzb49IyJ9eeCQYclpkzOy4k1rk6vfBCgWKI LRqtSKqS+C2zF4D/l40stip5td6J68ixu8Rdkni6LBIMJ2cxPeCwpsJFKuQX/o7UppsS w246TVXJ0ZPjWFXpjH397vBDcGrhTS+1jBO9ulGUL8ph3D2poHRcI1JqC51oXpX3n/8u Viog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6cgydVzEMe2hY+xvoZbvAXaDHt8Fvtz1odtZkVMvLmU=; b=KkVzyatABtZtSLaBNfFQsevlP4SPA6ngB55hVpHzkJMyYiLUAnyxcz22zdZJLwWEay eTdza3/HKr+DaWjsi+PTL7a3BqtKTg0+z6sV3sihWv0z6ZUxB8SBz+P4jDHHlU44twJ/ EE93wR/bWYsDhsGgc2mL98DmIftbhxhPrsS76677iTilacDYHsYAZLeSse7FwQFo9EK6 sOydcZkdGR+BQDLAz8ls0CrVVd2FygWuYR+UklQkipxK6L1J4m3ZH//T9FkLIB8RoXLt U32LjO/h1TF5Ee8DLIuadrMuPhpX72sL9pBFKpRvNxC9EK1d5BXnNmvKQNAAmr04EkuG QHmA== X-Gm-Message-State: AHQUAuZlnpc4kUOqcTXcdmWuK3OkqF3E/Dz6OSWGyx49bmW1+FqmLifP AasU1AwWFio4gsxnH8oinnXfB4VaeDMBFGejr3/Z/Q== X-Received: by 2002:a05:6830:1c1:: with SMTP id r1mr748863ota.229.1550074757434; Wed, 13 Feb 2019 08:19:17 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: From: Dan Williams Date: Wed, 13 Feb 2019 08:19:05 -0800 Message-ID: Subject: Re: [PATCH 5/5] dax: "Hotplug" persistent memory for use like normal RAM To: Brice Goglin 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 13, 2019 at 5:07 AM Brice Goglin wrote: > > > Le 13/02/2019 =C3=A0 09:43, Brice Goglin a =C3=A9crit : > > Le 13/02/2019 =C3=A0 09:24, Dan Williams a =C3=A9crit : > >> On Wed, Feb 13, 2019 at 12:12 AM Brice Goglin = wrote: > >>> Le 13/02/2019 =C3=A0 01:30, Dan Williams a =C3=A9crit : > >>>> 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 hel= p. > >>>> 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. Yes, in short: device_dax/remove_id: not required, this driver attaches to any and all device-dax devices by default device_dax/unbind: required, nothing else will free the device for kmem to attach kmem/new_id: required, it will attach if the device is currently unbound otherwise the device must be unbound before proceeding kmem/bind: only required if the device was busy / attached to device_dax when new_id was written.