Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-19 Thread Dan Williams
On Tue, Nov 19, 2019 at 7:19 PM Aneesh Kumar K.V wrote: > > On 11/19/19 11:28 PM, Dan Williams wrote: > > On Mon, Nov 18, 2019 at 1:52 AM Aneesh Kumar K.V > > wrote: > >> > >> Dan Williams writes: > >> > >>> On S

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-19 Thread Dan Williams
On Mon, Nov 18, 2019 at 1:52 AM Aneesh Kumar K.V wrote: > > Dan Williams writes: > > > On Sat, Nov 16, 2019 at 4:15 AM Aneesh Kumar K.V > > wrote: > >> > > > > > >> > >> Considering the direct-map map size is not going to be u

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-18 Thread Dan Williams
On Mon, Nov 18, 2019 at 7:29 PM Andrew Donnellan wrote: > > On 19/11/19 1:48 pm, Alastair D'Silva wrote: > > On Tue, 2019-11-19 at 10:47 +1100, Andrew Donnellan wrote: > >> On 15/11/19 3:35 am, Dan Williams wrote: > >>>> Have you discussed with the direc

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-18 Thread Dan Williams
On Mon, Nov 18, 2019 at 3:48 PM Andrew Donnellan wrote: > > On 15/11/19 3:35 am, Dan Williams wrote: > >> Have you discussed with the directory owner if it's ok to split the > >> driver over several files? > > > > My thought is to establish drivers/ope

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-16 Thread Dan Williams
On Sat, Nov 16, 2019 at 4:15 AM Aneesh Kumar K.V wrote: > > > Hi Dan, > > "Aneesh Kumar K.V" writes: > > > Dan Williams writes: > > > >> On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V > >> wrote: > >> [..] > &

Re: [PATCH 02/10] nvdimm: remove prototypes for nonexistent functions

2019-11-14 Thread Dan Williams
On Thu, Oct 24, 2019 at 9:49 PM Alastair D'Silva wrote: > > From: Alastair D'Silva > > These functions don't exist, so remove the prototypes for them. > > Signed-off-by: Alastair D'Silva Looks good, applied.

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-14 Thread Dan Williams
Some quick feedback on your intro concerns... On Thu, Nov 14, 2019 at 5:41 AM Frederic Barrat wrote: > > Hi Alastair, > > The patch is huge and could/should probably be split in smaller pieces Yeah, it's a must. Split the minimum viable infrastructure by topic and then follow on with per-feature

Re: [PATCH v4 04/23] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-13 Thread Dan Williams
On Wed, Nov 13, 2019 at 2:49 PM John Hubbard wrote: > > On 11/13/19 2:00 PM, Dan Williams wrote: > ... > >> Ugh, when did all this HMM specific manipulation sneak into the > >> generic ZONE_DEVICE path? It used to be gated by pgmap type with its > >> own

Re: [PATCH v4 04/23] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-13 Thread Dan Williams
On Wed, Nov 13, 2019 at 11:23 AM Dan Williams wrote: > > On Tue, Nov 12, 2019 at 8:27 PM John Hubbard wrote: > > > > An upcoming patch changes and complicates the refcounting and > > especially the "put page" aspects of it. In order to keep > > everything

Re: [PATCH v4 04/23] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-13 Thread Dan Williams
On Tue, Nov 12, 2019 at 8:27 PM John Hubbard wrote: > > An upcoming patch changes and complicates the refcounting and > especially the "put page" aspects of it. In order to keep > everything clean, refactor the devmap page release routines: > > * Rename put_devmap_managed_page() to page_is_devmap_

Re: [PATCH v4 09/23] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-13 Thread Dan Williams
On Wed, Nov 13, 2019 at 2:43 AM Jan Kara wrote: > > On Tue 12-11-19 20:26:56, John Hubbard wrote: > > Introduce pin_user_pages*() variations of get_user_pages*() calls, > > and also pin_longterm_pages*() variations. > > > > These variants all set FOLL_PIN, which is also introduced, and > > thoroug

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 5:08 PM John Hubbard wrote: > > On 11/12/19 4:58 PM, Dan Williams wrote: > ... > >>> It's not redundant relative to upstream which does not do anything the > >>> FOLL_LONGTERM in the gup-slow path... but I have not looked at patches &g

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 3:43 PM Jason Gunthorpe wrote: > > On Tue, Nov 12, 2019 at 02:45:51PM -0800, Dan Williams wrote: > > On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > > > > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > > > ... &g

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 3:08 PM John Hubbard wrote: > > On 11/12/19 2:43 PM, Dan Williams wrote: > ... > > Ah, sorry. This was the first time I had looked at this series and > > jumped in without reading the background. > > > > Your patch as is looks ok, I assume

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > ... > >> -} > >> +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM, > >> +page, vmas, NULL); > >> +/* > >> + * The lif

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 2:24 PM John Hubbard wrote: > > On 11/12/19 1:57 PM, Dan Williams wrote: > ... > >> diff --git a/drivers/vfio/vfio_iommu_type1.c > >> b/drivers/vfio/vfio_iommu_type1.c > >> index d864277ea16f..017689b7c32b 100644 > >> ---

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Mon, Nov 11, 2019 at 4:07 PM John Hubbard wrote: > > As it says in the updated comment in gup.c: current FOLL_LONGTERM > behavior is incompatible with FAULT_FLAG_ALLOW_RETRY because of the > FS DAX check requirement on vmas. > > However, the corresponding restriction in get_user_pages_remote()

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-11 Thread Dan Williams
On Mon, Nov 11, 2019 at 9:37 PM Dan Williams wrote: > > On Mon, Nov 11, 2019 at 3:34 AM Aneesh Kumar K.V > wrote: > > > > "Alastair D'Silva" writes: > > > > > From: Alastair D'Silva > > > > > > This driver exposes LPC me

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-11 Thread Dan Williams
On Mon, Nov 11, 2019 at 3:34 AM Aneesh Kumar K.V wrote: > > "Alastair D'Silva" writes: > > > From: Alastair D'Silva > > > > This driver exposes LPC memory on OpenCAPI SCM cards > > as an NVDIMM, allowing the existing nvram infrastructure > > to be used. > > > > Signed-off-by: Alastair D'Silva >

Re: [PATCH v1 04/10] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-11-08 Thread Dan Williams
On Fri, Nov 8, 2019 at 2:22 AM David Hildenbrand wrote: > > On 08.11.19 08:14, David Hildenbrand wrote: > > On 08.11.19 06:09, Dan Williams wrote: > >> On Thu, Nov 7, 2019 at 2:07 PM David Hildenbrand wrote: > >>> > >>> On 07.11.19 19:22, Davi

Re: [PATCH v1 04/10] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-11-07 Thread Dan Williams
On Thu, Nov 7, 2019 at 2:07 PM David Hildenbrand wrote: > > On 07.11.19 19:22, David Hildenbrand wrote: > > > > > >> Am 07.11.2019 um 16:40 schrieb Dan Williams : > >> > >> On Thu, Oct 24, 2019 at 5:12 AM David Hildenbrand > >> wrote: &

Re: [PATCH v1 04/10] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-11-07 Thread Dan Williams
On Thu, Oct 24, 2019 at 5:12 AM David Hildenbrand wrote: > > Right now, ZONE_DEVICE memory is always set PG_reserved. We want to > change that. > > KVM has this weird use case that you can map anything from /dev/mem > into the guest. pfn_valid() is not a reliable check whether the memmap > was ini

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread Dan Williams
On Tue, Nov 5, 2019 at 4:03 PM Sean Christopherson wrote: > > On Tue, Nov 05, 2019 at 03:43:29PM -0800, Dan Williams wrote: > > On Tue, Nov 5, 2019 at 3:30 PM Dan Williams > > wrote: > > > > > > On Tue, Nov 5, 2019 at 3:13 PM Sean Christopherson > >

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread Dan Williams
On Tue, Nov 5, 2019 at 3:30 PM Dan Williams wrote: > > On Tue, Nov 5, 2019 at 3:13 PM Sean Christopherson > wrote: > > > > On Tue, Nov 05, 2019 at 03:02:40PM -0800, Dan Williams wrote: > > > On Tue, Nov 5, 2019 at 12:31 PM David Hildenbrand > > > wrote:

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread Dan Williams
On Tue, Nov 5, 2019 at 3:13 PM Sean Christopherson wrote: > > On Tue, Nov 05, 2019 at 03:02:40PM -0800, Dan Williams wrote: > > On Tue, Nov 5, 2019 at 12:31 PM David Hildenbrand wrote: > > > > The scarier code (for me) is transparent_hugepage_adjust() and > > &g

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread Dan Williams
On Tue, Nov 5, 2019 at 12:31 PM David Hildenbrand wrote: > > >>> I think I know what's going wrong: > >>> > >>> Pages that are pinned via gfn_to_pfn() and friends take a references, > >>> however are often released via > >>> kvm_release_pfn_clean()/kvm_release_pfn_dirty()/kvm_release_page_clean().

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-04 Thread Dan Williams
ges PG_reserved. > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Michal Hocko > Cc: Dan Williams > Cc: KarimAllah Ahmed > Signed-off-by: David Hildenbrand > --- > virt/kvm/kvm_main.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) &

Re: [PATCH v1 02/10] KVM: x86/mmu: Prepare kvm_is_mmio_pfn() for PG_reserved changes

2019-11-04 Thread Dan Williams
_reserved. > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Sean Christopherson > Cc: Vitaly Kuznetsov > Cc: Wanpeng Li > Cc: Jim Mattson > Cc: Joerg Roedel > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: "H. Peter Anvin

Re: [PATCH v1 01/10] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes

2019-11-04 Thread Dan Williams
t enough protection. > > Please note that hardware errors (PG_hwpoison) are not memory holes and > not affected by this change when offlining. > > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: Pavel Tatashin > Cc: Dan Williams > Cc: Anshuman K

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-31 Thread Dan Williams
On Thu, Oct 31, 2019 at 1:38 AM Aneesh Kumar K.V wrote: > > On 10/31/19 12:00 PM, Dan Williams wrote: > > On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V > > wrote: > > [..] > > > > > > > All that said, the x86 vmemmap_populate() falls back to u

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-30 Thread Dan Williams
On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V wrote: [..] > > True, for the pfn device and the device-dax mapping size, but I'm > > suggesting adding another instance of alignment control at the raw > > namespace level. That would need to be disconnected from the > > device-dax page mapping gr

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-28 Thread Dan Williams
On Mon, Oct 28, 2019 at 9:35 PM Aneesh Kumar K.V wrote: > > On 10/29/19 4:38 AM, Dan Williams wrote: > > On Mon, Oct 28, 2019 at 2:48 AM Aneesh Kumar K.V > > wrote: > >> > >> The page size used to map the namespace is arch dependent. For example > >>

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-28 Thread Dan Williams
On Mon, Oct 28, 2019 at 2:48 AM Aneesh Kumar K.V wrote: > > The page size used to map the namespace is arch dependent. For example > architectures like ppc64 use 16MB page size for direct-mapping. If the > namespace > size is not aligned to the mapping page size, we can observe kernel crash > dur

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-23 Thread Dan Williams
On Wed, Oct 23, 2019 at 10:28 AM David Hildenbrand wrote: > > >> I dislike this for three reasons > >> > >> a) It does not protect against any races, really, it does not improve > >> things. > >> b) We do have the exact same problem with pfn_to_online_page(). As long as > >> we > >>don't hol

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-23 Thread Dan Williams
On Wed, Oct 23, 2019 at 12:26 AM David Hildenbrand wrote: > > On 22.10.19 23:54, Dan Williams wrote: > > Hi David, > > > > Thanks for tackling this! > > Thanks for having a look :) > > [...] > > > >> I am probably a little bit too careful (but

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-22 Thread Dan Williams
Hi David, Thanks for tackling this! On Tue, Oct 22, 2019 at 10:13 AM David Hildenbrand wrote: > > This series is based on [2], which should pop up in linux/next soon: > https://lkml.org/lkml/2019/10/21/1034 > > This is the result of a recent discussion with Michal ([1], [2]). Right > now

Re: [PATCH] powerpc/book3s64: Export has_transparent_hugepage() related functions.

2019-09-24 Thread Dan Williams
On Mon, Sep 23, 2019 at 9:25 PM Aneesh Kumar K.V wrote: > > In later patch, we want to use hash_transparent_hugepage() in a kernel module. > Export two related functions. > Looks good, thanks.

Re: "Pick the right alignment default when creating dax devices" failed to build on powerpc

2019-09-23 Thread Dan Williams
On Sun, Sep 22, 2019 at 5:04 AM Michael Ellerman wrote: > > > > On 21 September 2019 4:31:16 am AEST, Dan Williams > wrote: > >On Fri, Sep 20, 2019 at 11:18 AM Qian Cai wrote: > >> > >> On Fri, 2019-09-20 at 19:55 +0530, Aneesh Kumar K.V wrote: >

Re: "Pick the right alignment default when creating dax devices" failed to build on powerpc

2019-09-20 Thread Dan Williams
On Fri, Sep 20, 2019 at 11:18 AM Qian Cai wrote: > > On Fri, 2019-09-20 at 19:55 +0530, Aneesh Kumar K.V wrote: > > Qian Cai writes: > > > > > The linux-next commit "libnvdimm/dax: Pick the right alignment default > > > when > > > creating dax devices" causes powerpc failed to build with this co

Re: [PATCH 1/2] libnvdimm/altmap: Track namespace boundaries in altmap

2019-09-17 Thread Dan Williams
On Tue, Sep 17, 2019 at 12:40 AM Aneesh Kumar K.V wrote: > > On 9/16/19 11:28 PM, Dan Williams wrote: > > On Mon, Sep 9, 2019 at 11:29 PM Aneesh Kumar K.V > > wrote: > >> > >> With PFN_MODE_PMEM namespace, the memmap area is allocated from the device > >

Re: [PATCH 1/2] libnvdimm/altmap: Track namespace boundaries in altmap

2019-09-16 Thread Dan Williams
On Mon, Sep 9, 2019 at 11:29 PM Aneesh Kumar K.V wrote: > > With PFN_MODE_PMEM namespace, the memmap area is allocated from the device > area. Some architectures map the memmap area with large page size. On > architectures like ppc64, 16MB page for memap mapping can map 262144 pfns. > This maps a

Re: [PATCH 2/2] powerpc/nvdimm: Update vmemmap_populated to check sub-section range

2019-09-16 Thread Dan Williams
On Mon, Sep 9, 2019 at 11:29 PM Aneesh Kumar K.V wrote: > > With commit: 7cc7867fb061 ("mm/devm_memremap_pages: enable sub-section remap") > pmem namespaces are remapped in 2M chunks. On architectures like ppc64 we > can map the memmap area using 16MB hugepage size and that can cover > a memory ra

Re: [PATCH 1/2] libnvdimm/altmap: Track namespace boundaries in altmap

2019-09-10 Thread Dan Williams
On Tue, Sep 10, 2019 at 1:31 AM Aneesh Kumar K.V wrote: > > On 9/10/19 1:40 PM, Dan Williams wrote: > > On Mon, Sep 9, 2019 at 11:29 PM Aneesh Kumar K.V > > wrote: > >> > >> With PFN_MODE_PMEM namespace, the memmap area is allocated from the device > >

Re: [PATCH 1/2] libnvdimm/altmap: Track namespace boundaries in altmap

2019-09-10 Thread Dan Williams
On Mon, Sep 9, 2019 at 11:29 PM Aneesh Kumar K.V wrote: > > With PFN_MODE_PMEM namespace, the memmap area is allocated from the device > area. Some architectures map the memmap area with large page size. On > architectures like ppc64, 16MB page for memap mapping can map 262144 pfns. > This maps a

Re: [PATCH v5 3/4] mm/nvdimm: Use correct #defines instead of open coding

2019-08-19 Thread Dan Williams
On Mon, Aug 19, 2019 at 2:32 AM Aneesh Kumar K.V wrote: > > Aneesh Kumar K.V writes: > > > Dan Williams writes: > > > >> On Fri, Aug 9, 2019 at 12:45 AM Aneesh Kumar K.V > >> wrote: > >>> > >> > > ... > > >>&g

Re: [PATCH v5 1/4] nvdimm: Consider probe return -EOPNOTSUPP as success

2019-08-19 Thread Dan Williams
On Mon, Aug 19, 2019 at 12:07 AM Aneesh Kumar K.V wrote: > > Dan Williams writes: > > > On Tue, Aug 13, 2019 at 9:22 PM Dan Williams > > wrote: > >> > >> Hi Aneesh, logic looks correct but there are some cleanups I'd like to > >> see and a

Re: [PATCH v5 3/4] mm/nvdimm: Use correct #defines instead of open coding

2019-08-15 Thread Dan Williams
On Fri, Aug 9, 2019 at 12:45 AM Aneesh Kumar K.V wrote: > > Use PAGE_SIZE instead of SZ_4K and sizeof(struct page) instead of 64. > If we have a kernel built with different struct page size the previous > patch should handle marking the namespace disabled. Each of these changes carry independent

Re: [PATCH v5 1/4] nvdimm: Consider probe return -EOPNOTSUPP as success

2019-08-15 Thread Dan Williams
On Tue, Aug 13, 2019 at 9:22 PM Dan Williams wrote: > > Hi Aneesh, logic looks correct but there are some cleanups I'd like to > see and a lead-in patch that I attached. > > I've started prefixing nvdimm patches with: > > libnvdimm/$component: > > ...sin

Re: [PATCH v5 1/4] nvdimm: Consider probe return -EOPNOTSUPP as success

2019-08-13 Thread Dan Williams
ed comment here to explain the special translation of error codes. > + ret = nd_btt_probe(dev, ndns); > + if (ret == 0) > return -ENXIO; > + else if (ret == -EOPNOTSUPP) Are there cases where the btt driver needs to return EOPNOTSUPP? I'd otherwi

Re: [PATCH] nvdimm/of_pmem: Provide a unique name for bus provider

2019-08-07 Thread Dan Williams
On Tue, Aug 6, 2019 at 11:00 PM Aneesh Kumar K.V wrote: > > On 8/7/19 10:22 AM, Dan Williams wrote: > > On Tue, Aug 6, 2019 at 9:17 PM Aneesh Kumar K.V > > wrote: > >> > >> On 8/7/19 9:43 AM, Dan Williams wrote: > >>> On Tue, Aug

Re: [PATCH] nvdimm/of_pmem: Provide a unique name for bus provider

2019-08-06 Thread Dan Williams
On Tue, Aug 6, 2019 at 9:17 PM Aneesh Kumar K.V wrote: > > On 8/7/19 9:43 AM, Dan Williams wrote: > > On Tue, Aug 6, 2019 at 9:00 PM Aneesh Kumar K.V > > wrote: > >> > >> ndctl utility requires the ndbus to have unique names. If not while > >> enume

Re: [PATCH] nvdimm/of_pmem: Provide a unique name for bus provider

2019-08-06 Thread Dan Williams
On Tue, Aug 6, 2019 at 9:00 PM Aneesh Kumar K.V wrote: > > ndctl utility requires the ndbus to have unique names. If not while > enumerating the bus in userspace it drops bus with similar names. > This results in us not listing devices beneath the bus. It does? > > Signed-off-by: Aneesh Kumar K.

Re: [PATCH v2] powerpc/nvdimm: Pick the nearby online node if the device node is not online

2019-07-23 Thread Dan Williams
On Thu, Jul 18, 2019 at 12:49 AM Aneesh Kumar K.V wrote: > > "Oliver O'Halloran" writes: > > > On Tue, Jul 16, 2019 at 7:08 PM Aneesh Kumar K.V > > wrote: > >> > >> This is similar to what ACPI does. Nvdimm layer doesn't bring the SCM > >> device > >> numa node online. Hence we need to make sur

Re: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-21 Thread Dan Williams
On Tue, May 21, 2019 at 2:51 AM Aneesh Kumar K.V wrote: > > Dan Williams writes: > > > On Mon, May 13, 2019 at 9:46 PM Aneesh Kumar K.V > > wrote: > >> > >> On 5/14/19 9:42 AM, Dan Williams wrote: > >> > On Mon, May 13, 2019 at 9:05 PM Aneesh

Re: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-21 Thread Dan Williams
On Mon, May 13, 2019 at 9:46 PM Aneesh Kumar K.V wrote: > > On 5/14/19 9:42 AM, Dan Williams wrote: > > On Mon, May 13, 2019 at 9:05 PM Aneesh Kumar K.V > > wrote: > >> > >> On 5/14/19 9:28 AM, Dan Williams wrote: > >>> On Mon, May 1

Re: [PATCH] mm/nvdimm: Pick the right alignment default when creating dax devices

2019-05-19 Thread Dan Williams
On Sun, May 19, 2019 at 1:55 AM Aneesh Kumar K.V wrote: > > > Hi Dan, > > "Aneesh Kumar K.V" writes: > > > On 5/17/19 8:19 PM, Vaibhav Jain wrote: > >> Hi Aneesh, > >> > > > > >> > >>> + /* > >>> +* Check whether the we support the alignment. For Dax if the > >>> +* superblock alig

Re: [PATCH] mm/nvdimm: Use correct alignment when looking at first pfn from a region

2019-05-13 Thread Dan Williams
On Mon, May 13, 2019 at 7:55 PM Aneesh Kumar K.V wrote: > > We already add the start_pad to the resource->start but fails to section > align the start. This make sure with altmap we compute the right first > pfn when start_pad is zero and we are doing an align down of start address. > > Signed-off

Re: [RFC PATCH] mm/nvdimm: Fix kernel crash on devm_mremap_pages_release

2019-05-13 Thread Dan Williams
[ add Keith who was looking at something similar ] On Mon, May 13, 2019 at 7:54 PM Aneesh Kumar K.V wrote: > > When we initialize the namespace, if we support altmap, we don't initialize > all the > backing struct page where as while releasing the namespace we look at some of > these uninitilize

Re: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-13 Thread Dan Williams
On Mon, May 13, 2019 at 9:05 PM Aneesh Kumar K.V wrote: > > On 5/14/19 9:28 AM, Dan Williams wrote: > > On Mon, May 13, 2019 at 7:56 PM Aneesh Kumar K.V > > wrote: > >> > >> The nfpn related change is needed to fix the kernel message > >> > >

Re: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-13 Thread Dan Williams
On Mon, May 13, 2019 at 7:56 PM Aneesh Kumar K.V wrote: > > The nfpn related change is needed to fix the kernel message > > "number of pfns truncated from 2617344 to 163584" > > The change makes sure the nfpns stored in the superblock is right value. > > Signed-off-by: Aneesh Kumar K.V > --- > d

Re: [PATCH v2 7/8] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail

2019-05-08 Thread Dan Williams
On Wed, May 8, 2019 at 12:22 AM David Hildenbrand wrote: > > > >> drivers/base/node.c | 18 +- > >> include/linux/node.h | 5 ++--- > >> 2 files changed, 7 insertions(+), 16 deletions(-) > >> > >> diff --git a/drivers/base/node.c b/drivers/base/node.c > >> index 04fdfa99b8bc..9b

Re: [PATCH v2 8/8] mm/memory_hotplug: Remove "zone" parameter from sparse_remove_one_section

2019-05-07 Thread Dan Williams
age does not require special care so you can drop that comment. The only place it's used in the subsection patches is to lookup the node-id, but it turns out that the resulting node-id is then never used. With the ZONE_DEVICE mention dropped out of changelog you can add: Reviewed-by: Dan Williams

Re: [PATCH v2 7/8] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail

2019-05-07 Thread Dan Williams
lk, void *arg) > > /* > * Unregister memory block device under all nodes that it spans. > + * Has to be called with mem_sysfs_mutex held (due to unlinked_nodes). Given this comment can bitrot relative to the implementation lets instead add an explicit: lockdep_assert_held(&mem_sysfs_mutex); With that you can add: Reviewed-by: Dan Williams

Re: [PATCH v2 6/8] mm/memory_hotplug: Remove memory block devices before arch_remove_memory()

2019-05-07 Thread Dan Williams
__remove_section(struct zone *zone, struct > mem_section *ms, > if (WARN_ON_ONCE(!valid_section(ms))) > return; > > - unregister_memory_section(ms); > - > scn_nr = __section_nr(ms); > start_pfn = section_nr_to_pfn((unsigned long)scn_nr); > __remove_zone(zone, start_pfn); > @@ -1844,6 +1842,9 @@ void __ref __remove_memory(int nid, u64 start, u64 size) > memblock_free(start, size); > memblock_remove(start, size); > > + /* remove memory block devices before removing memory */ > + hotplug_memory_unregister(start, size); > + > arch_remove_memory(nid, start, size, NULL); > __release_memory_resource(start, size); Other than the BUG_ON concern you can add Reviewed-by: Dan Williams

Re: [PATCH v2 5/8] mm/memory_hotplug: Drop MHP_MEMBLOCK_API

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 2:24 PM David Hildenbrand wrote: > > On 07.05.19 23:19, Dan Williams wrote: > > On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: > >> > >> No longer needed, the callers of arch_add_memory() can handle this > >> manually. >

Re: [PATCH v2 4/8] mm/memory_hotplug: Create memory block devices after arch_add_memory()

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: > > Only memory to be added to the buddy and to be onlined/offlined by > user space using memory block devices needs (and should have!) memory > block devices. > > Factor out creation of memory block devices Create all devices after > arch_a

Re: [PATCH v2 5/8] mm/memory_hotplug: Drop MHP_MEMBLOCK_API

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: > > No longer needed, the callers of arch_add_memory() can handle this > manually. > > Cc: Andrew Morton > Cc: David Hildenbrand > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: Pavel Tatashin > Cc: Wei Yang > Cc: Joonsoo Kim > Cc: Qian

Re: [PATCH v2 3/8] mm/memory_hotplug: arch_remove_memory() and __remove_pages() with CONFIG_MEMORY_HOTPLUG

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: > > Let's prepare for better error handling while adding memory by allowing > to use arch_remove_memory() and __remove_pages() even if > CONFIG_MEMORY_HOTREMOVE is not set. CONFIG_MEMORY_HOTREMOVE effectively > covers > - Offlining of system

Re: [PATCH v2 2/8] s390x/mm: Implement arch_remove_memory()

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 1:47 PM David Hildenbrand wrote: > > On 07.05.19 22:46, Dan Williams wrote: > > On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: > >> > >> Will come in handy when wanting to handle errors after > >> arch_add_memory(). &g

Re: [PATCH v2 2/8] s390x/mm: Implement arch_remove_memory()

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: > > Will come in handy when wanting to handle errors after > arch_add_memory(). > > Cc: Martin Schwidefsky > Cc: Heiko Carstens > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Mike Rapoport > Cc: David Hildenbrand > Cc: Vasily Gorbik > C

Re: [PATCH v2 1/8] mm/memory_hotplug: Simplify and fix check_hotplug_memory_range()

2019-05-07 Thread Dan Williams
ichal Hocko > Cc: David Hildenbrand > Cc: Pavel Tatashin > Cc: Qian Cai > Cc: Wei Yang > Cc: Arun KS > Cc: Mathieu Malaterre > Signed-off-by: David Hildenbrand Reviewed-by: Dan Williams

Re: [PATCH v2 0/8] mm/memory_hotplug: Factor out memory block device handling

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 12:38 PM David Hildenbrand wrote: > > On 07.05.19 21:21, David Hildenbrand wrote: > > On 07.05.19 21:04, Dan Williams wrote: > >> On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: > >>> > >>> We only want memory bl

Re: [PATCH v2 0/8] mm/memory_hotplug: Factor out memory block device handling

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 11:38 AM David Hildenbrand wrote: > > We only want memory block devices for memory to be onlined/offlined > (add/remove from the buddy). This is required so user space can > online/offline memory and kdump gets notified about newly onlined memory. > > Only such memory has th

Re: [PATCH v2] drivers/dax: Allow to include DEV_DAX_PMEM as builtin

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 4:50 AM Aneesh Kumar K.V wrote: > > > Hi Dan, > > "Aneesh Kumar K.V" writes: > > > This move the dependency to DEV_DAX_PMEM_COMPAT such that only > > if DEV_DAX_PMEM is built as module we can allow the compat support. > > > > This allows to test the new code easily in a emu

Re: [PATCH v2] mm: Fix modifying of page protection by insert_pfn_pmd()

2019-04-25 Thread Dan Williams
On Thu, Apr 25, 2019 at 12:32 AM Jan Kara wrote: > > On Wed 24-04-19 11:13:48, Dan Williams wrote: > > On Wed, Apr 24, 2019 at 10:38 AM Matthew Wilcox wrote: > > > > > > On Wed, Apr 24, 2019 at 10:13:15AM -0700, Dan Williams wrote: > > > > I think unal

Re: [PATCH v2] mm: Fix modifying of page protection by insert_pfn_pmd()

2019-04-24 Thread Dan Williams
On Wed, Apr 24, 2019 at 6:37 PM Aneesh Kumar K.V wrote: > > On 4/24/19 11:43 PM, Dan Williams wrote: > > On Wed, Apr 24, 2019 at 10:38 AM Matthew Wilcox wrote: > >> > >> On Wed, Apr 24, 2019 at 10:13:15AM -0700, Dan Williams wrote: > >>> I think unal

Re: [PATCH v2] mm: Fix modifying of page protection by insert_pfn_pmd()

2019-04-24 Thread Dan Williams
On Wed, Apr 24, 2019 at 10:38 AM Matthew Wilcox wrote: > > On Wed, Apr 24, 2019 at 10:13:15AM -0700, Dan Williams wrote: > > I think unaligned addresses have always been passed to > > vmf_insert_pfn_pmd(), but nothing cared until this patch. I *think* > > the only change

Re: [PATCH v2] mm: Fix modifying of page protection by insert_pfn_pmd()

2019-04-24 Thread Dan Williams
On Tue, Apr 2, 2019 at 4:51 AM Aneesh Kumar K.V wrote: > > With some architectures like ppc64, set_pmd_at() cannot cope with > a situation where there is already some (different) valid entry present. > > Use pmdp_set_access_flags() instead to modify the pfn which is built to > deal with modifying

Re: [PATCH RESEND 3/3] mm: introduce ARCH_HAS_PTE_DEVMAP

2019-04-12 Thread Dan Williams
real situation is clearer. Looks good to me. Acked-by: Dan Williams

Re: [PATCH 1/3] mm/memremap: Rename and consolidate SECTION_SIZE

2019-04-12 Thread Dan Williams
nging all the > arch code). SECTION_MASK is unused, so it can just go. Looks good to me. So good that it collides with a similar change in the "sub-section" support series. Acked-by: Dan Williams

Re: [PATCH v2] fs/dax: deposit pagetable even when installing zero page

2019-04-08 Thread Dan Williams
On Mon, Apr 8, 2019 at 2:39 AM Aneesh Kumar K.V wrote: > > > Hi Dan, > > Dan Williams writes: > > > On Wed, Mar 13, 2019 at 2:58 AM Jan Kara wrote: > >> > >> On Wed 13-03-19 10:17:17, Aneesh Kumar K.V wrote: > >> > > >>

Re: [RFC PATCH] drivers/dax: Allow to include DEV_DAX_PMEM as builtin

2019-03-30 Thread Dan Williams
On Fri, Mar 29, 2019 at 10:42 PM Aneesh Kumar K.V wrote: > > This move the dependency to DEV_DAX_PMEM_COMPAT such that only > if DEV_DAX_PMEM is built as module we can allow the compat support. > > This allows to test the new code easily in a emulation setup where we > often build things without m

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Dan Williams
On Mon, Mar 25, 2019 at 3:22 PM Ira Weiny wrote: [..] > FWIW this thread is making me think my original patch which simply implemented > get_user_pages_fast_longterm() would be more clear. There is some evidence > that the GUP API was trending that way (see get_user_pages_remote). That > seems

Re: [RESEND 1/7] mm/gup: Replace get_user_pages_longterm() with FOLL_LONGTERM

2019-03-25 Thread Dan Williams
On Mon, Mar 25, 2019 at 7:21 AM Ira Weiny wrote: [..] > > > @@ -1268,10 +1246,14 @@ static long check_and_migrate_cma_pages(unsigned > > > long start, long nr_pages, > > > putback_movable_pages(&cma_page_list); > > > } > > > /* > > >

Re: [RESEND 6/7] IB/qib: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against > FS DAX pages being mapped. > > Signed-off-by: Ira Weiny Looks good modulo potential __get_user_pages_fast() suggestion.

Re: [RESEND 5/7] IB/hfi1: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against > FS DAX pages being mapped. > > Signed-off-by: Ira Weiny > --- > drivers/infiniband/hw/hfi1/user_pages.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletio

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > DAX pages were previously unprotected from longterm pins when users > called get_user_pages_fast(). > > Use the new FOLL_LONGTERM flag to check for DEVMAP pages and fall > back to regular GUP processing if a DEVMAP page is encountered

Re: [RESEND 3/7] mm/gup: Change GUP fast to use flags rather than a write 'bool'

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > To facilitate additional options to get_user_pages_fast() change the > singular write parameter to be gup_flags. > > This patch does not change any functionality. New functionality will > follow in subsequent patches. > > Some of the

Re: [RESEND 2/7] mm/gup: Change write parameter to flags in fast walk

2019-03-22 Thread Dan Williams
viously used. > > Signed-off-by: Ira Weiny Looks good, Reviewed-by: Dan Williams

Re: [RESEND 1/7] mm/gup: Replace get_user_pages_longterm() with FOLL_LONGTERM

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > Rather than have a separate get_user_pages_longterm() call, > introduce FOLL_LONGTERM and change the longterm callers to use > it. > > This patch does not change any functionality. > > FOLL_LONGTERM can only be supported with get_user

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Dan Williams
On Wed, Mar 20, 2019 at 8:09 PM Oliver wrote: > > On Thu, Mar 21, 2019 at 7:57 AM Dan Williams wrote: > > > > On Wed, Mar 20, 2019 at 8:34 AM Dan Williams > > wrote: > > > > > > On Wed, Mar 20, 2019 at 1:09 AM Aneesh Kumar K.V > > &g

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Dan Williams
On Wed, Mar 20, 2019 at 8:34 AM Dan Williams wrote: > > On Wed, Mar 20, 2019 at 1:09 AM Aneesh Kumar K.V > wrote: > > > > Aneesh Kumar K.V writes: > > > > > Dan Williams writes: > > > > > >> > > >>> Now what wi

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Dan Williams
On Wed, Mar 20, 2019 at 1:09 AM Aneesh Kumar K.V wrote: > > Aneesh Kumar K.V writes: > > > Dan Williams writes: > > > >> > >>> Now what will be page size used for mapping vmemmap? > >> > >> That's up to the architect

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-19 Thread Dan Williams
On Tue, Mar 19, 2019 at 1:45 AM Kirill A. Shutemov wrote: > > On Wed, Mar 13, 2019 at 09:07:13AM -0700, Dan Williams wrote: > > On Wed, Mar 6, 2019 at 4:46 AM Aneesh Kumar K.V > > wrote: > > > > > > On 3/6/19 5:14 PM, Michal Suchánek wrote: > &

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-13 Thread Dan Williams
On Wed, Mar 13, 2019 at 8:45 PM Aneesh Kumar K.V wrote: [..] > >> Now w.r.t to failures, can device-dax do an opportunistic huge page > >> usage? > > > > device-dax explicitly disclaims the ability to do opportunistic mappings. > > > >> I haven't looked at the device-dax details fully yet. Do we m

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-13 Thread Dan Williams
On Wed, Mar 6, 2019 at 4:46 AM Aneesh Kumar K.V wrote: > > On 3/6/19 5:14 PM, Michal Suchánek wrote: > > On Wed, 06 Mar 2019 14:47:33 +0530 > > "Aneesh Kumar K.V" wrote: > > > >> Dan Williams writes: > >> > >>> On Thu, Feb 28, 2019

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-13 Thread Dan Williams
On Wed, Mar 6, 2019 at 1:18 AM Aneesh Kumar K.V wrote: > > Dan Williams writes: > > > On Thu, Feb 28, 2019 at 1:40 AM Oliver wrote: > >> > >> On Thu, Feb 28, 2019 at 7:35 PM Aneesh Kumar K.V > >> wrote: > >> > > >> >

Re: [PATCH v2] fs/dax: deposit pagetable even when installing zero page

2019-03-13 Thread Dan Williams
On Wed, Mar 13, 2019 at 2:58 AM Jan Kara wrote: > > On Wed 13-03-19 10:17:17, Aneesh Kumar K.V wrote: > > > > Hi Dan/Andrew/Jan, > > > > "Aneesh Kumar K.V" writes: > > > > > Architectures like ppc64 use the deposited page table to store hardware > > > page table slot information. Make sure we dep

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-02-28 Thread Dan Williams
On Thu, Feb 28, 2019 at 1:40 AM Oliver wrote: > > On Thu, Feb 28, 2019 at 7:35 PM Aneesh Kumar K.V > wrote: > > > > Add a flag to indicate the ability to do huge page dax mapping. On > > architecture > > like ppc64, the hypervisor can disable huge page support in the guest. In > > such a case, w

Re: [PATCH v3 2/2] powerpc/pseries: Add driver for PAPR SCM regions

2018-10-14 Thread Dan Williams
d by rolling the functionality into a > seperate driver so here we are... > > Acked-by: Dan Williams > Signed-off-by: Oliver O'Halloran > --- > The alternative implementation here is that we have the pseries code > do the h-calls and craft a pmem-region@ node based on t

<    1   2   3   4   5   >