Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1560528imu; Wed, 16 Jan 2019 22:51:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN6oIqW37QbbNbPQ3n6TjcOnFNjUvCoqnDDR6h7HEYbwSwwBZpBY6tlv9sjm0Q6pJR7FeBEL X-Received: by 2002:a63:e615:: with SMTP id g21mr12610198pgh.290.1547707901202; Wed, 16 Jan 2019 22:51:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547707901; cv=none; d=google.com; s=arc-20160816; b=jA5IzixDDDrHKwzEdBYeA8W+yEfh2FIdQezIU3JxMbWDStC8vlxyZNuzMPWN0fLNDk t7uvXBBTT5AocWtOmtw2LJAl3VRYghCfxqW4KK5gqtIkk2wIciM6eh5suJH+KbzJx93H fdF6Z3oWV5Ixta3MFhVgKhK2Fot1j+6L9d8RsbomcrwigDxgnk9VaSuEc/q39GMRX8F8 WUutInyyZHtUX6HJeb1znTZBKX+5xhtYJHlScujdL8jW+hLIm9oaTrbiW3YqyE+y57HB ZB2mPfxc9yJdp7rATgU5EWPynjaPiaN5q4xH9HaEu7uVmd2g7JthzOm2SvwkRfbr+9m9 HqDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:from:cc:to:subject; bh=2eqphlzBqS6EZCqpRYoZcRagdvyzph7xzJOz7FVdjVw=; b=z5OTS8yAz2C9OYnWiNCjsSH0jUiL9ABXoAfOCSy8RzNhOxe7eRgk7mYer2oVeE98du RY1g+ojAGKe9LoJIwMFs8R1GevhnskFJsuo/E8MazMt4clK3u/a09Cgji1zHnTbm+F8L C3ppqOgh+GP7C22s9nHSTgQrSDgS9V1zs+9W+IylspB6PxyJmEyI5jc2GxjnhNOhjN2A MGKZofOHa+h6ZNy9HluMHVrmUskM00EJu3UWgVKUWdfUNcBCW9s/GkT58Ecl2aB/rZRo OaDIEGFhPuB+Nr4pNhi0dB9yDe5tPhnjFj24mbHLH80VabCv+a5jKF74IcHOed4xFygS h6uA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si852074pfb.188.2019.01.16.22.51.25; Wed, 16 Jan 2019 22:51:41 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728589AbfAPSZm (ORCPT + 99 others); Wed, 16 Jan 2019 13:25:42 -0500 Received: from mga09.intel.com ([134.134.136.24]:11928 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728374AbfAPSZi (ORCPT ); Wed, 16 Jan 2019 13:25:38 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 10:25:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,487,1539673200"; d="scan'208";a="128296716" Received: from viggo.jf.intel.com (HELO localhost.localdomain) ([10.54.77.144]) by orsmga001.jf.intel.com with ESMTP; 16 Jan 2019 10:25:37 -0800 Subject: [PATCH 0/4] Allow persistent memory to be used like normal RAM To: dave@sr71.net Cc: Dave Hansen , 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 From: Dave Hansen Date: Wed, 16 Jan 2019 10:18:59 -0800 Message-Id: <20190116181859.D1504459@viggo.jf.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I would like to get this queued up to get merged. Since most of the churn is in the nvdimm code, and it also depends on some refactoring that only exists in the nvdimm tree, it seems like putting it in *via* the nvdimm tree is the best path. But, this series makes non-trivial changes to the "resource" code and memory hotplug. I'd really like to get some acks from folks on the first three patches which affect those areas. Borislav and Bjorn, you seem to be the most active in the resource code. Michal, I'd really appreciate at look at all of this from a mem hotplug perspective. Note: these are based on commit d2f33c19644 in: git://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git libnvdimm-pending Changes since v1: * Now based on git://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git * Use binding/unbinding from "dax bus" code * Move over to a "dax bus" driver from being an nvdimm driver -- 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. 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. See patch 4 for instructions on binding the kmem driver to a 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_movable > $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 Cc: Borislav Petkov Cc: Bjorn Helgaas Cc: Yaowei Bai Cc: Takashi Iwai