From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE53CC433E0 for ; Tue, 23 Jun 2020 07:39:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B2B22073E for ; Tue, 23 Jun 2020 07:39:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iS5yRye3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B2B22073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F2A3D6B0006; Tue, 23 Jun 2020 03:39:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED9176B0007; Tue, 23 Jun 2020 03:39:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCA7E6B000C; Tue, 23 Jun 2020 03:39:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id C03886B0006 for ; Tue, 23 Jun 2020 03:39:42 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7E6A41E12 for ; Tue, 23 Jun 2020 07:39:42 +0000 (UTC) X-FDA: 76959677004.08.hope34_010543026e39 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 3047C1819E621 for ; Tue, 23 Jun 2020 07:39:42 +0000 (UTC) X-HE-Tag: hope34_010543026e39 X-Filterd-Recvd-Size: 17951 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Tue, 23 Jun 2020 07:39:41 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id j4so8766298plk.3 for ; Tue, 23 Jun 2020 00:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to; bh=uOQb9dQe44rsxmw6i/h0rSh/nLflDHEslMMMeD/giQw=; b=iS5yRye3rDh+O05niU8/utqB4imUEJKkAaWos4gUjcWXB4jNLvVIZDFcsRhJLnJspR 7sFs+WDR9vjy847KXHy4gDO9V70Ecjc7NhgjSm4G90rk1NFUwrc8rRDUStNGGf9FQbYX X9MPm+wvPsQetwL/CZHmC2hoZDUNP+nMyKA+S4Z6j54pdc6NCKo+ndkHtFw+RmuUnWkg eytq7PAgfMiJowMtloZ6acFKnJKxtPazYdirzKc4aete4eP9rB3MeVsIRIGSfwaGwYDX bui9wXVyEqZjg4U8umlcPRsJL5E5suNWUJBiUpw8l/lM/CL/TB/FQnJkRbwoCM6oF1sQ vIRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=uOQb9dQe44rsxmw6i/h0rSh/nLflDHEslMMMeD/giQw=; b=sCwTo/Occ1QR92TUOQyxV05YFJS7r3UzKtFZZ1vxxzATmVm6ohDp5ZTMJGZkUC2ZBO 3vqK0a4QRQT239Uo6a40f+BAK2MNUvIk4/DWn7lw1mOFv8uD0FUP0CBHVMYJA8aGiGYn SjDAiRB2u//zUce9/3LyRkl4qvdebmhss8GUUJ93XGkdP5hHcN1BdPLYblwec5ZVhPjn 3fAm+qjc96a1suUtQ6XkQ7D0CSqZfhrl92Hs4/RPquovImxWwQIZ9eyQ5mJSjibWu2Yg ktEdVPRHXvNk5iP2SFKXAxty0CXLvsBspHeJoUsTm4OmGvZM9JGPNmHb6MFrJ0sNM9D8 WdgQ== X-Gm-Message-State: AOAM530cAsmtO3bBCR5y1cjrr64xaMY8VaTq4R6hH1BHReCSQJsl2OUF UAxk9Nn8bJOC2lO3BcrMt2I= X-Google-Smtp-Source: ABdhPJzl1907jFXmG8/hUrrT6R8iVBl17pz8a52tk13vPq7/sfscqbo9LriRFRn7RANhCL2RiJH8aw== X-Received: by 2002:a17:902:44:: with SMTP id 62mr22883504pla.104.1592897980547; Tue, 23 Jun 2020 00:39:40 -0700 (PDT) Received: from [0.0.0.0] ([45.76.223.48]) by smtp.gmail.com with ESMTPSA id g21sm15811626pfh.134.2020.06.23.00.39.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Jun 2020 00:39:39 -0700 (PDT) Subject: Re: [PATCH V3 (RESEND) 0/3] arm64: Enable vmemmap mapping from device memory To: Anshuman Khandual , linux-mm@kvack.org Cc: Catalin Marinas , Will Deacon , Mark Rutland , Paul Walmsley , Palmer Dabbelt , Tony Luck , Fenghua Yu , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , David Hildenbrand , Mike Rapoport , Michal Hocko , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Andrew Morton , Dan Williams , Pavel Tatashin , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <1592442930-9380-1-git-send-email-anshuman.khandual@arm.com> From: Jia He Message-ID: Date: Tue, 23 Jun 2020 15:39:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <1592442930-9380-1-git-send-email-anshuman.khandual@arm.com> Content-Type: multipart/alternative; boundary="------------F45777FE1D773B7A3A04E8C0" X-Rspamd-Queue-Id: 3047C1819E621 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This is a multi-part message in MIME format. --------------F45777FE1D773B7A3A04E8C0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi I also tested the addional cases on arm64 1, 4k page size + devdax + --map=3Dmem 2, 64k page size + devdax + --map=3Dmem 3, 4k page size + devdax + --map=3Ddev 4, 64k page size + devdax + --map=3Ddev case 4 is important to verify Anshuman's this series. Host kernel: 5.7-rc3 guest kernel: 5.7-rc5 with this series ndctl: https://github.com/pmem/ndctl/tree/c7767834871=20 On the guest: 1. ./ndctl/.libs/ndctl create-namespace -e namespace0.0 --mode=3Ddevdax -= -map=3Ddev=20 -s 1g -f -v -a 64K =C2=A0echo dax0.0 > /sys/bus/dax/drivers/device_dax/unbind =C2=A0echo dax0.0 > /sys/bus/dax/drivers/kmem/new_id The 1g block was added 2. echo 0 > /sys/devices/system/memory/memory10/online modprobe -r dax_pmem The 1g block was removed Some minor fix should be applied which is not relevant to this series its= elf.=20 e.g numa id --- Cheers, Justin (Jia He) On 2020/6/18 9:15, Anshuman Khandual wrote: > This series enables vmemmap backing memory allocation from device memor= y > ranges on arm64. But before that, it enables vmemmap_populate_basepages= () > and vmemmap_alloc_block_buf() to accommodate struct vmem_altmap based > alocation requests. > > This series applies on 5.8-rc1. > > Pending Question: > > altmap_alloc_block_buf() does not have any other remaining users in the > tree after this change. Should it be converted into a static function a= nd > it's declaration be dropped from the header (include/linux/mm.h). Avoid= ed > doing so because I was not sure if there are any off-tree users or not. > > Changes in V3: > > - Dropped comment from free_hotplug_page_range() per Robin > - Modified comment in unmap_hotplug_range() per Robin > - Enabled altmap support in vmemmap_alloc_block_buf() per Robin > > Changes in V2: (https://lkml.org/lkml/2020/3/4/475) > > - Rebased on latest hot-remove series (v14) adding P4D page table suppo= rt > > Changes in V1: (https://lkml.org/lkml/2020/1/23/12) > > - Added an WARN_ON() in unmap_hotplug_range() when altmap is > provided without the page table backing memory being freed > > Changes in RFC V2: (https://lkml.org/lkml/2019/10/21/11) > > - Changed the commit message on 1/2 patch per Will > - Changed the commit message on 2/2 patch as well > - Rebased on arm64 memory hot remove series (v10) > > RFC V1: (https://lkml.org/lkml/2019/6/28/32) > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Rutland > Cc: Paul Walmsley > Cc: Palmer Dabbelt > Cc: Tony Luck > Cc: Fenghua Yu > Cc: Dave Hansen > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: David Hildenbrand > Cc: Mike Rapoport > Cc: Michal Hocko > Cc: "Matthew Wilcox (Oracle)" > Cc: "Kirill A. Shutemov" > Cc: Andrew Morton > Cc: Dan Williams > Cc: Pavel Tatashin > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-ia64@vger.kernel.org > Cc: linux-riscv@lists.infradead.org > Cc: x86@kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > > Anshuman Khandual (3): > mm/sparsemem: Enable vmem_altmap support in vmemmap_populate_basepag= es() > mm/sparsemem: Enable vmem_altmap support in vmemmap_alloc_block_buf(= ) > arm64/mm: Enable vmem_altmap support for vmemmap mappings > > arch/arm64/mm/mmu.c | 59 ++++++++++++++++++++++++++------------= - > arch/ia64/mm/discontig.c | 2 +- > arch/powerpc/mm/init_64.c | 10 +++---- > arch/riscv/mm/init.c | 2 +- > arch/x86/mm/init_64.c | 12 ++++---- > include/linux/mm.h | 8 ++++-- > mm/sparse-vmemmap.c | 38 ++++++++++++++++++++----- > 7 files changed, 87 insertions(+), 44 deletions(-) > --=20 --------------F45777FE1D773B7A3A04E8C0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi

I also tested the addional cases on arm64

1, 4k page size + devdax + --map=3Dmem

2, 64k page size + devdax + --map=3Dmem

3, 4k page size + devdax + --map=3Ddev

4, 64k page size + devdax + --map=3Ddev

case 4 is important to verify Anshuman's this series.

Host kernel: 5.7-rc3

guest kernel: 5.7-rc5 with this series

ndctl: https://github.com/pmem/nd= ctl/tree/c7767834871

On the guest:

1. ./ndctl/.libs/ndctl create-namespace -e namespace0.0 --mode=3Ddevdax --map=3Ddev -s 1g -f -v -a 64K

=C2=A0echo dax0.0 > /sys/bus/dax/drivers/device_dax/unbind
=C2=A0echo dax0.0 > /sys/bus/dax/drivers/kmem/new_id

The 1g block was added

2. echo 0 > /sys/devices/system/memory/memory10/online

modprobe -r dax_pmem

The 1g block was removed


Some minor fix should be applied which is not relevant to this series itself. e.g numa id

---
Cheers,
Justin (Jia He)
On 2020/6/18 9:15, Anshuman Khandual wrote:
This series enables vmemmap =
backing memory allocation from device memory
ranges on arm64. But before that, it enables vmemmap_populate_basepages()
and vmemmap_alloc_block_buf() to accommodate struct vmem_altmap based
alocation requests.

This series applies on 5.8-rc1.

Pending Question:

altmap_alloc_block_buf() does not have any other remaining users in the
tree after this change. Should it be converted into a static function and
it's declaration be dropped from the header (include/linux/mm.h). Avoided
doing so because I was not sure if there are any off-tree users or not.

Changes in V3:

- Dropped comment from free_hotplug_page_range() per Robin
- Modified comment in unmap_hotplug_range() per Robin
- Enabled altmap support in vmemmap_alloc_block_buf() per Robin

Changes in V2: (https://lkml.org/lkml/2020/3/4/475)

- Rebased on latest hot-remove series (v14) adding P4D page table support

Changes in V1: (https://lkml.org/lkml/2020/1/23/12)

- Added an WARN_ON() in unmap_hotplug_range() when altmap is
  provided without the page table backing memory being freed

Changes in RFC V2: (https://lkml.org/lkml/2019/10/21/11)

- Changed the commit message on 1/2 patch per Will
- Changed the commit message on 2/2 patch as well
- Rebased on arm64 memory hot remove series (v10)

RFC V1: (https://lkml.org/lkml/2019/6/28/32)

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>=
;
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-ia64@vger.kernel.org
Cc: linux-riscv@lists.infradead.org
Cc: =
x86@kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org

Anshuman Khandual (3):
  mm/sparsemem: Enable vmem_altmap support in vmemmap_populate_basepages(=
)
  mm/sparsemem: Enable vmem_altmap support in vmemmap_alloc_block_buf()
  arm64/mm: Enable vmem_altmap support for vmemmap mappings

 arch/arm64/mm/mmu.c       | 59 ++++++++++++++++++++++++++-------------
 arch/ia64/mm/discontig.c  |  2 +-
 arch/powerpc/mm/init_64.c | 10 +++----
 arch/riscv/mm/init.c      |  2 +-
 arch/x86/mm/init_64.c     | 12 ++++----
 include/linux/mm.h        |  8 ++++--
 mm/sparse-vmemmap.c       | 38 ++++++++++++++++++++-----
 7 files changed, 87 insertions(+), 44 deletions(-)

--=20

--------------F45777FE1D773B7A3A04E8C0--