Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1805880pxa; Sun, 2 Aug 2020 22:23:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKhFnNx13/Pa6usoyurSHNlxApUzVm4K7EaIyiD33G4onUwYlf3+96EHPx6G4EYBtDaI+p X-Received: by 2002:aa7:cdd2:: with SMTP id h18mr14137882edw.387.1596432191201; Sun, 02 Aug 2020 22:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596432191; cv=none; d=google.com; s=arc-20160816; b=pl+vaKXCH75RJFOo9Zi2LuqtEZuQPoIagoSgs1bwYMiXQymmlnuXrXyGPNZ36UJh6b dWYosTT2w96xOTXTuaRJK0HJbyy0C+YkbdI9rc00x88ak5bbwXGPCI8/I2fi7aNJXNBs 6G9jCmYvYNdXexhhSNOQMClhRfwcVpelPUoNyYBo9Yr0k3VmGWBZFF84uxKYuhXPaqPR QIU3FqhDlOymG/+S7h1THvJifrpY0qehjkBwZEBI2WkxJc7QaJX9/X7UV+pyPKWVFBMF nTCFigGaKKPwdYLH2yUJx0DdKjO7tkJzk3lL/ablVQ98HLIPtVIrEH60SoEMFVAkvBsA IpWQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:ironport-sdr:ironport-sdr; bh=p6MUo2yAWYStwN0ygL88GAzq9U7/Zor3U0l+zZjOF2A=; b=NpULyE+zMavzpAp+0rSf9fHDDKBh6XM9zXQsYqRQrdu57UdqZy2Wit7XAhaZGKdmvH 3KjlUlT5EELA5kx7Xcy0v8v9A0RHncXb6DHewfnmpG0ZeUXawl4Ia6msOOMCdFt3Ke7P Nuz8aGjDfCg+JyopHwPRV362RpLfX4nqyB+ps5KT4MezWVf3U6BhrmkPGrqbavIFXW5r 33MiUxeDRoCDkRcapGWCPOf7g5jk6xyULqBf895TDEh0Oiqp5OjQjaZIjP6T1EOEQBlo /k047rnHTjMl0NppHFxsVh2REoNu1Kj4/+YTZaXaboDxHulkBV3o/3vIWY5WruzmAr6p qisg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id f12si9271762eja.367.2020.08.02.22.22.49; Sun, 02 Aug 2020 22:23:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728279AbgHCFUp (ORCPT + 99 others); Mon, 3 Aug 2020 01:20:45 -0400 Received: from mga11.intel.com ([192.55.52.93]:41483 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbgHCFUn (ORCPT ); Mon, 3 Aug 2020 01:20:43 -0400 IronPort-SDR: xvES9ju6SqM798uej27RmDJLWVXWBbMu0xNcDY2HXYv5VDWeF4zJ9r3O7gySybAhcp4B1PloBh LIhajZ2bNYvg== X-IronPort-AV: E=McAfee;i="6000,8403,9701"; a="149847260" X-IronPort-AV: E=Sophos;i="5.75,429,1589266800"; d="scan'208";a="149847260" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2020 22:20:43 -0700 IronPort-SDR: U/rM5DhcxpE7WZh4bHtjOp8I1vx1/1gMeTlx03D1ZbeBttQuqYJI2akDB473GZ9U0J8YdTqELW sgRUKKnaB3Xw== X-IronPort-AV: E=Sophos;i="5.75,429,1589266800"; d="scan'208";a="305681342" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2020 22:20:42 -0700 Subject: [PATCH v4 22/23] dax/hmem: Introduce dax_hmem.region_idle parameter From: Dan Williams To: akpm@linux-foundation.org Cc: Joao Martins , peterz@infradead.org, vishal.l.verma@intel.com, dave.hansen@linux.intel.com, ard.biesheuvel@linaro.org, vishal.l.verma@intel.com, linux-mm@kvack.org, linux-nvdimm@lists.01.org, joao.m.martins@oracle.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org Date: Sun, 02 Aug 2020 22:04:24 -0700 Message-ID: <159643106460.4062302.5868522341307530091.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <159643094279.4062302.17779410714418721328.stgit@dwillia2-desk3.amr.corp.intel.com> References: <159643094279.4062302.17779410714418721328.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joao Martins Introduce a new module parameter for dax_hmem which initializes all region devices as free, rather than allocating a pagemap for the region by default. All hmem devices created with dax_hmem.region_idle=1 will have full available size for creating dynamic dax devices. Signed-off-by: Joao Martins Link: https://lore.kernel.org/r/20200716172913.19658-4-joao.m.martins@oracle.com Signed-off-by: Dan Williams --- drivers/dax/hmem/hmem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dax/hmem/hmem.c b/drivers/dax/hmem/hmem.c index 1a3347bb6143..1bf040dbc834 100644 --- a/drivers/dax/hmem/hmem.c +++ b/drivers/dax/hmem/hmem.c @@ -5,6 +5,9 @@ #include #include "../bus.h" +static bool region_idle; +module_param_named(region_idle, region_idle, bool, 0644); + static int dax_hmem_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -30,7 +33,7 @@ static int dax_hmem_probe(struct platform_device *pdev) data = (struct dev_dax_data) { .dax_region = dax_region, .id = -1, - .size = resource_size(res), + .size = region_idle ? 0 : resource_size(res), }; dev_dax = devm_create_dev_dax(&data); if (IS_ERR(dev_dax))