Re: [PATCH v11 5/8] mm: move pgoff_address() to vma_pgoff_address()

2022-03-29 Thread Christoph Hellwig
On Sun, Feb 27, 2022 at 08:07:44PM +0800, Shiyang Ruan wrote: > Since it is not a DAX-specific function, move it into mm and rename it > to be a generic helper. FYI, there is a patch in -mm and linux-next: "mm: rmap: introduce pfn_mkclean_range() to cleans PTEs" that adds a vma_pgoff_address

Re: [PATCH v11 1/8] dax: Introduce holder for dax_device

2022-03-29 Thread Christoph Hellwig
On Fri, Mar 11, 2022 at 03:35:13PM -0800, Dan Williams wrote: > > + if (!dax_dev->holder_ops) { > > + rc = -EOPNOTSUPP; > > I think it is ok to return success (0) for this case. All the caller > of dax_holder_notify_failure() wants to know is if the notification > was

Re: [PATCH v6 3/6] mm: rmap: introduce pfn_mkclean_range() to cleans PTEs

2022-03-29 Thread Christoph Hellwig
On Tue, Mar 29, 2022 at 09:48:50PM +0800, Muchun Song wrote: > + * * Return the start of user virtual address at the specific offset within Double "*" here. Also Shiyang has been wanting a quite similar vma_pgoff_address for use in dax.c. Maybe we'll need to look into moving this to linux/mm.h.

Re: [PATCH v11 1/8] dax: Introduce holder for dax_device

2022-03-29 Thread Christoph Hellwig
On Wed, Mar 16, 2022 at 09:46:07PM +0800, Shiyang Ruan wrote: > > Forgive me if this has been discussed before, but since dax_operations > > are in terms of pgoff and nr pages and memory_failure() is in terms of > > pfns what was the rationale for making the function signature byte > > based? > >

Re: [PATCH v11 6/8] mm: Introduce mf_dax_kill_procs() for fsdax case

2022-03-29 Thread Christoph Hellwig
On Sun, Feb 27, 2022 at 08:07:45PM +0800, Shiyang Ruan wrote: > This function is called at the end of RMAP routine, i.e. filesystem > recovery function, to collect and kill processes using a shared page of > DAX file. I think just throwing RMAP inhere is rather confusing. > The difference with

[GIT PULL] LIBNVDIMM update for v5.18

2022-03-29 Thread Dan Williams
Hi Linus, please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/libnvdimm-for-5.18 ...to receive the libnvdimm update for this cycle which includes the deprecation of block-aperture mode and a new perf events interface for the papr_scm nvdimm driver. The perf

[PATCH v6 3/6] mm: rmap: introduce pfn_mkclean_range() to cleans PTEs

2022-03-29 Thread Muchun Song
The page_mkclean_one() is supposed to be used with the pfn that has a associated struct page, but not all the pfns (e.g. DAX) have a struct page. Introduce a new function pfn_mkclean_range() to cleans the PTEs (including PMDs) mapped with range of pfns which has no struct page associated with

[PATCH v6 6/6] mm: simplify follow_invalidate_pte()

2022-03-29 Thread Muchun Song
The only user (DAX) of range and pmdpp parameters of follow_invalidate_pte() is gone, it is safe to remove them and make it static to simlify the code. This is revertant of the following commits: 097963959594 ("mm: add follow_pte_pmd()") a4d1a8852513 ("dax: update to new mmu_notifier

[PATCH v6 5/6] dax: fix missing writeprotect the pte entry

2022-03-29 Thread Muchun Song
Currently dax_mapping_entry_mkclean() fails to clean and write protect the pte entry within a DAX PMD entry during an *sync operation. This can result in data loss in the following sequence: 1) process A mmap write to DAX PMD, dirtying PMD radix tree entry and making the pmd entry dirty

[PATCH v6 2/6] dax: fix cache flush on PMD-mapped pages

2022-03-29 Thread Muchun Song
The flush_cache_page() only remove a PAGE_SIZE sized range from the cache. However, it does not cover the full pages in a THP except a head page. Replace it with flush_cache_range() to fix this issue. This is just a documentation issue with the respect to properly documenting the expected usage

[PATCH v6 0/6] Fix some bugs related to ramp and dax

2022-03-29 Thread Muchun Song
This series is based on next-20220225. Patch 1-2 fix a cache flush bug, because subsequent patches depend on those on those changes, there are placed in this series. Patch 3-4 are preparation for fixing a dax bug in patch 5. Patch 6 is code cleanup since the previous patch remove the usage of

[PATCH v6 1/6] mm: rmap: fix cache flush on THP pages

2022-03-29 Thread Muchun Song
The flush_cache_page() only remove a PAGE_SIZE sized range from the cache. However, it does not cover the full pages in a THP except a head page. Replace it with flush_cache_range() to fix this issue. At least, no problems were found due to this. Maybe because the architectures that have virtual

[PATCH v6 4/6] mm: pvmw: add support for walking devmap pages

2022-03-29 Thread Muchun Song
The devmap pages can not use page_vma_mapped_walk() to check if a huge devmap page is mapped into a vma. Add support for walking huge devmap pages so that DAX can use it in the next patch. Signed-off-by: Muchun Song --- mm/page_vma_mapped.c | 16 1 file changed, 8