Re: [PATCH 1/2] mm/memory_hotplug: Export shrink span functions for zone and node

2022-02-02 Thread Jonghyeon Kim
On Fri, Jan 28, 2022 at 09:10:21AM +0100, David Hildenbrand wrote: > On 28.01.22 05:19, Jonghyeon Kim wrote: > > On Thu, Jan 27, 2022 at 10:54:23AM +0100, David Hildenbrand wrote: > >> On 27.01.22 10:41, Jonghyeon Kim wrote: > >>> On Wed, Jan 26, 2022 at 06:04:50PM +0100, David Hildenbrand wrote:

Re: [PATCH v2 3/6] mm: page_vma_mapped: support checking if a pfn is mapped into a vma

2022-02-02 Thread Matthew Wilcox
On Wed, Feb 02, 2022 at 10:33:04PM +0800, Muchun Song wrote: > page_vma_mapped_walk() is supposed to check if a page is mapped into a vma. > However, not all page frames (e.g. PFN_DEV) have a associated struct page > with it. There is going to be some duplicate codes similar with this function >

[PATCH v2 6/6] mm: remove range parameter from follow_invalidate_pte()

2022-02-02 Thread Muchun Song
The only user (DAX) of range parameter of follow_invalidate_pte() is gone, it safe to remove the range paramter and make it static to simlify the code. Signed-off-by: Muchun Song --- include/linux/mm.h | 3 --- mm/memory.c| 23 +++ 2 files changed, 3 insertions(+),

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

2022-02-02 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 v2 4/6] mm: rmap: introduce pfn_mkclean_range() to cleans PTEs

2022-02-02 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 v2 3/6] mm: page_vma_mapped: support checking if a pfn is mapped into a vma

2022-02-02 Thread Muchun Song
page_vma_mapped_walk() is supposed to check if a page is mapped into a vma. However, not all page frames (e.g. PFN_DEV) have a associated struct page with it. There is going to be some duplicate codes similar with this function if someone want to check if a pfn (without a struct page) is mapped

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

2022-02-02 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. Fixes: f729c8c9b24f ("dax: wrprotect pmd_t in dax_mapping_entry_mkclean") Signed-off-by: Muchun

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

2022-02-02 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 v2 0/6] Fix some bugs related to ramp and dax

2022-02-02 Thread Muchun Song
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 follow_invalidate_pte(). Changes in v2:

Re: [PATCH v10 4/9] fsdax: fix function description

2022-02-02 Thread Christoph Hellwig
Dan, can you send this to Linus for 5.17 to get it out of the queue?

Re: [PATCH v10 1/9] dax: Introduce holder for dax_device

2022-02-02 Thread Christoph Hellwig
On Thu, Jan 27, 2022 at 08:40:50PM +0800, Shiyang Ruan wrote: > +void dax_register_holder(struct dax_device *dax_dev, void *holder, > + const struct dax_holder_operations *ops) > +{ > + if (!dax_alive(dax_dev)) > + return; > + > + dax_dev->holder_data = holder; > +