From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <20180518094616.GA25838@lst.de> References: <152658753673.26786.16458605771414761966.stgit@dwillia2-desk3.amr.corp.intel.com> <20180518094616.GA25838@lst.de> From: Dan Williams Date: Fri, 18 May 2018 09:00:29 -0700 Message-ID: Subject: Re: [PATCH v10] mm: introduce MEMORY_DEVICE_FS_DAX and CONFIG_DEV_PAGEMAP_OPS To: Christoph Hellwig Cc: linux-nvdimm , Martin Schwidefsky , Heiko Carstens , Michal Hocko , kbuild test robot , Thomas Meyer , Dave Jiang , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jan Kara , linux-fsdevel , Linux MM , Gerald Schaefer Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: On Fri, May 18, 2018 at 2:46 AM, Christoph Hellwig wrote: > This looks reasonable to me. A few more comments below. > >> This patch replaces and consolidates patch 2 [1] and 4 [2] from the v9 >> series [3] for "dax: fix dma vs truncate/hole-punch". > > Can you repost the whole series? Otherwise things might get a little > too confusing. Sure thing. >> WARN_ON(IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API)); >> + return 0; >> } else if (pfn_t_devmap(pfn)) { >> + struct dev_pagemap *pgmap; > > This should probably become something like: > > bool supported = false; > > ... > > > if (IS_ENABLED(CONFIG_FS_DAX_LIMITED) && pfn_t_special(pfn)) { > ... > supported = true; > } else if (pfn_t_devmap(pfn)) { > pgmap = get_dev_pagemap(pfn_t_to_pfn(pfn), NULL); > if (pgmap && pgmap->type == MEMORY_DEVICE_FS_DAX) > supported = true; > put_dev_pagemap(pgmap); > } > > if (!supported) { > pr_debug("VFS (%s): error: dax support not enabled\n", > sb->s_id); > return -EOPNOTSUPP; > } > return 0; Looks good, will do. >> + select DEV_PAGEMAP_OPS if (ZONE_DEVICE && !FS_DAX_LIMITED) > > Btw, what was the reason again we couldn't get rid of FS_DAX_LIMITED? The last I heard from Gerald they were still mildly interested in keeping the dccssblk dax support going with this limited mode, and threatened to add full page support at a later date: --- From: Gerald dcssblk seems to work fine, I did not see any SIGBUS while "executing in place" from dcssblk with the current upstream kernel, maybe because we only use dcssblk with fs dax in read-only mode. Anyway, the dcssblk change is fine with me. I will look into adding struct pages for dcssblk memory later, to make it work again with this change, but for now I do not know of anyone needing this in the upstream kernel. https://www.spinics.net/lists/linux-xfs/msg14628.html --- >> +void generic_dax_pagefree(struct page *page, void *data) >> +{ >> + wake_up_var(&page->_refcount); >> +} >> +EXPORT_SYMBOL_GPL(generic_dax_pagefree); > > Why is this here and exported instead of static in drivers/nvdimm/pmem.c? I was thinking it did not belong to the pmem driver, but you're right unless / until we grow another fsdax capable driver this detail can stay internal to the pmem driver.