On Wed, Sep 19, 2018 at 2:15 PM Dave Hansen <dave.hansen@xxxxxxxxx> wrote: > > On 09/19/2018 02:02 PM, Keith Busch wrote: > > Pinning user pages out of nvdimm dax memory is significantly slower > > compared to system ram. Analysis points to software overhead incurred > > from a radix tree lookup. This patch series fixes that by removing the > > relatively costly dev_pagemap lookup that was repeated for each page, > > significantly increasing gup time. > > Could you also remind us why DAX pages are such special snowflakes and > *require* radix tree lookups in the first place? They are special because they need to check backing device live-ness when taking new references. We manage a percpu-ref for each device that registers physical memory with devm_memremap_pages(). When that device is disabled we kill the percpu-ref to block new references being taken, and then wait for existing references to drain. This allows for disabling persistent-memory namepace-devices at will relative to new get_user_pages() requests.