Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5617598imd; Tue, 30 Oct 2018 22:25:20 -0700 (PDT) X-Google-Smtp-Source: AJdET5ez3hWVSdqCoyr7nHCQ0MuJkDeO+TwGQLngyzPN5qPaefhoNE8bWMvIgvG06VMXOkXGxzwi X-Received: by 2002:a63:344e:: with SMTP id b75mr1692936pga.184.1540963520432; Tue, 30 Oct 2018 22:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540963520; cv=none; d=google.com; s=arc-20160816; b=ifvZd1igWW6R6WolNBm/xBU3g4tiP5jX8C1U/co0gFAvdPNVF66PEUvc+DfWbae0DK cDTjp5u3B6oBDm/61HuJllhOSXrfE8iF2zgYiBT2JPDw1HFzlcSGXX3dTaHkUnS7ITzF h1S2WI1SwMiaT1LwUWoOK9bs9V39dLWGaJMbwTllbuAf43nqtPsNHG2tXETZ4cSSNHqX p6BqpvFAtFlWxduj67dpZ6nDRk3eFmNmObnIu3z2qWOaaZfjaTTLA/H4dumugnAtFyUP 2ssLg8NarR4p1Zx28UKtHyvw2gmGcKc2oPCvkdxM/03CHQju1ZeE7tv7r0TzRZcB3nw5 XCFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fPU1ZU+nS6xzx99eyl27bThSy1gTam7Ltx9vpoWu168=; b=0nTKllN2YY1HuWLspr2GlEMwtUHpGgb6UHGv7EZPmuK9FXvSlBV638zUcyOyZZE5pU AbliMpGQflDIBphw+z3oV1BJf4CzE8qx2OtWuFmZlyd98jtrBLyM7DVfr/DweQ104iRj UEeF5r732OHThl+vYmRELS7x76UUKCyVHbLhJBasre/o6KXQeI3jcNWxN3Fd6fzPsxnR MOE0sW/nO5TSu7q6bvmCGOQOvZ5ai3ZoAvuH+KpgHDAlCq0+VVKusJ9MlR3sV7ZFsnXQ zhglIaV1sm/+NOWYCrig0gYBPl0MXvJ4Z4zTYv8ycdxoSSptapC9OmDh+l7czUrTx8Lj UzcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="IwuT/4uP"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j38-v6si9683405pgl.138.2018.10.30.22.24.50; Tue, 30 Oct 2018 22:25:20 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b="IwuT/4uP"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728161AbeJaOIN (ORCPT + 99 others); Wed, 31 Oct 2018 10:08:13 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:42911 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727430AbeJaOIN (ORCPT ); Wed, 31 Oct 2018 10:08:13 -0400 Received: by mail-qt1-f195.google.com with SMTP id z20-v6so16335345qti.9 for ; Tue, 30 Oct 2018 22:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fPU1ZU+nS6xzx99eyl27bThSy1gTam7Ltx9vpoWu168=; b=IwuT/4uP2FTi3pzPU/N2DTAfUh7Gk2WbGfUk4VI1LaocUfv3OjfJMhMV9igykYxjA4 NmXpnvqWabP0UT8sT/mdr0cKGhFcXZazIChSeZ5drX1HZyqNasT2Df5nM/zDkDr/A5Vj 3KrAiCFIBYwR8KUFq6yuMQoFkGNNc4jbdQBhtaCLLxvMKk70MBHv/QOnVpwbH7AD/y3m mK3qeeAKa8sVx4McTrTQntpE7dcSTiRCcmSPYh2Ipt2vEgiWQ7FTxIoPuIVAxG7NUSQH Ga0uf0gYB+H5nrYIfmTGHs+mq6/P9TIEfSDnyJl7JSruroXBKtMOmQBq24FOwHxE01ar pX2Q== 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; bh=fPU1ZU+nS6xzx99eyl27bThSy1gTam7Ltx9vpoWu168=; b=ctzs9adduz2Wdqy65WUGn4oW9AhbzI8dJuzQRMaHEHLlwIZ0uF/ghPyrOtD2Iyy7aP fTO5Ssa7rwz0wxTWW6iV4ew0rUnJP+YaANLUGEiQeND5g7hNVRbuHP3Z5E66n6XsqpXn XbEW6gbzXa1Z+W35vs1qP6eD/C//RdCuctfoZZJNe+56bf2TRPtia+NLiL8aO6GmOzcH ktA7iygoMXgNoyLsyDMzzKWhRSoEd1OmU3mJ+2PC8cOchOARKlYSTQtZH8Ge35rDO/ki Bostm1AI3SPPyUBD38y0jEEjAAkfvwXLz6MVzt9glEIyIdY7he5UF3ru1VFzFI3batlZ PkiA== X-Gm-Message-State: AGRZ1gI/HI4ueZWQ8dBAH/Cp2JGRQyzpQ94lRSO+iINaKsI8LBeDeKM1 oMcP5r8BRsSVMcxseRwCbfmh3utgo2KM31UU9oA= X-Received: by 2002:ac8:6892:: with SMTP id m18mr1308647qtq.157.1540962702263; Tue, 30 Oct 2018 22:11:42 -0700 (PDT) MIME-Version: 1.0 References: <20181022201317.8558C1D8@viggo.jf.intel.com> In-Reply-To: <20181022201317.8558C1D8@viggo.jf.intel.com> From: Yang Shi Date: Tue, 30 Oct 2018 22:11:30 -0700 Message-ID: Subject: Re: [PATCH 0/9] Allow persistent memory to be used like normal RAM To: dave.hansen@linux.intel.com Cc: Linux Kernel Mailing List , dan.j.williams@intel.com, dave.jiang@intel.com, zwisler@kernel.org, vishal.l.verma@intel.com, thomas.lendacky@amd.com, Andrew Morton , Michal Hocko , linux-nvdimm@lists.01.org, Linux MM , Huang Ying , fengguang.wu@intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 22, 2018 at 1:18 PM Dave Hansen wrote: > > Persistent memory is cool. But, currently, you have to rewrite > your applications to use it. Wouldn't it be cool if you could > just have it show up in your system like normal RAM and get to > it like a slow blob of memory? Well... have I got the patch > series for you! > > This series adds a new "driver" to which pmem devices can be > attached. Once attached, the memory "owned" by the device is > hot-added to the kernel and managed like any other memory. On > systems with an HMAT (a new ACPI table), each socket (roughly) > will have a separate NUMA node for its persistent memory so > this newly-added memory can be selected by its unique NUMA > node. Could you please elaborate this? I'm supposed you mean the pmem will be a separate NUMA node, right? I would like to try the patches on real hardware, any prerequisite is needed? Thanks, Yang > > This is highly RFC, and I really want the feedback from the > nvdimm/pmem folks about whether this is a viable long-term > perversion of their code and device mode. It's insufficiently > documented and probably not bisectable either. > > Todo: > 1. The device re-binding hacks are ham-fisted at best. We > need a better way of doing this, especially so the kmem > driver does not get in the way of normal pmem devices. > 2. When the device has no proper node, we default it to > NUMA node 0. Is that OK? > 3. We muck with the 'struct resource' code quite a bit. It > definitely needs a once-over from folks more familiar > with it than I. > 4. Is there a better way to do this than starting with a > copy of pmem.c? > > Here's how I set up a system to test this thing: > > 1. Boot qemu with lots of memory: "-m 4096", for instance > 2. Reserve 512MB of physical memory. Reserving a spot a 2GB > physical seems to work: memmap=512M!0x0000000080000000 > This will end up looking like a pmem device at boot. > 3. When booted, convert fsdax device to "device dax": > ndctl create-namespace -fe namespace0.0 -m dax > 4. In the background, the kmem driver will probably bind to the > new device. > 5. Now, online the new memory sections. Perhaps: > > grep ^MemTotal /proc/meminfo > for f in `grep -vl online /sys/devices/system/memory/*/state`; do > echo $f: `cat $f` > echo online > $f > grep ^MemTotal /proc/meminfo > done > > Cc: Dan Williams > Cc: Dave Jiang > Cc: Ross Zwisler > Cc: Vishal Verma > Cc: Tom Lendacky > Cc: Andrew Morton > Cc: Michal Hocko > Cc: linux-nvdimm@lists.01.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: Huang Ying > Cc: Fengguang Wu >