lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 17 Feb 2022 16:52:23 +1100
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Liam Howlett <liam.howlett@...cle.com>,
        Matthew Wilcox <willy@...radead.org>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: linux-next: manual merge of the maple tree with the folio tree

Hi all,

Today's linux-next merge of the maple tree got a conflict in:

  mm/internal.h

between commit:

  a02f3052febe ("mm: Turn page_anon_vma() into folio_anon_vma()")

from the folio tree and commits:

  93a635efa606 ("mm: Start tracking VMAs with maple tree")
  b09e8361a4c3 ("mm: Remove the vma linked list")

from the maple tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc mm/internal.h
index f0e4dfac0264,2d3ede05cd7b..000000000000
--- a/mm/internal.h
+++ b/mm/internal.h
@@@ -67,12 -66,17 +67,13 @@@ static inline void wake_throttle_isolat
  vm_fault_t do_swap_page(struct vm_fault *vmf);
  void folio_rotate_reclaimable(struct folio *folio);
  bool __folio_end_writeback(struct folio *folio);
 +void deactivate_file_folio(struct folio *folio);
  
- void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
- 		unsigned long floor, unsigned long ceiling);
+ void free_pgtables(struct mmu_gather *tlb, struct maple_tree *mt,
+ 		   struct vm_area_struct *start_vma, unsigned long floor,
+ 		   unsigned long ceiling);
  void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte);
  
 -static inline bool can_madv_lru_vma(struct vm_area_struct *vma)
 -{
 -	return !(vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP));
 -}
 -
  struct zap_details;
  void unmap_page_range(struct mmu_gather *tlb,
  			     struct vm_area_struct *vma,
@@@ -388,12 -387,76 +389,78 @@@ static inline bool is_data_mapping(vm_f
  	return (flags & (VM_WRITE | VM_SHARED | VM_STACK)) == VM_WRITE;
  }
  
- /* mm/util.c */
- void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma,
- 		struct vm_area_struct *prev);
- void __vma_unlink_list(struct mm_struct *mm, struct vm_area_struct *vma);
+ /* Maple tree operations using VMAs */
+ /*
+  * vma_mas_store() - Store a VMA in the maple tree.
+  * @vma: The vm_area_struct
+  * @mas: The maple state
+  *
+  * Efficient way to store a VMA in the maple tree when the @mas has already
+  * walked to the correct location.
+  *
+  * Note: the end address is inclusive in the maple tree.
+  */
+ static inline int vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas)
+ {
+ #ifdef CONFIG_DEBUG_VM_MAPLE_TREE
+ 	/* Make sure no VMAs are about to be lost. */
+ 	MA_STATE(test, mas->tree, vma->vm_start, vma->vm_end - 1);
+ 	struct vm_area_struct *vma_mas;
+ 	int count = 0;
+ 
+ 	mas_for_each(&test, vma_mas, vma->vm_end - 1) {
+ 		/* Rule out vma_expand */
+ 		if ((vma->vm_start != vma_mas->vm_start) &&
+ 		    (vma->vm_end != vma_mas->vm_end))
+ 			count++;
+ 	}
+ 
+ 	/* vma adjust may overwrite a partial entry or remove one */
+ 	BUG_ON(count > 1);
+ 
+ 	BUG_ON(mas->min > vma->vm_start);
+ 	BUG_ON(mas->index > vma->vm_start);
+ #endif
+ 	mas->index = vma->vm_start;
+ 	mas->last = vma->vm_end - 1;
+ 	return mas_store_gfp(mas, vma, GFP_KERNEL);
+ }
+ 
+ /*
+  * vma_mas_remove() - Remove a VMA from the maple tree.
+  * @vma: The vm_area_struct
+  * @mas: The maple state
+  *
+  * Efficient way to remove a VMA from the maple tree when the @mas has already
+  * been established and points to the correct location.
+  * Note: the end address is inclusive in the maple tree.
+  */
+ static inline int vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas)
+ {
+ 	int ret;
+ 
+ #ifdef CONFIG_DEBUG_VM_MAPLE_TREE
+ 	/* Make sure no VMAs are about to be lost. */
+ 	MA_STATE(test, mas->tree, vma->vm_start, vma->vm_end - 1);
+ 	struct vm_area_struct *vma_mas;
+ 	int count = 0;
+ 
+ 	mas_for_each(&test, vma_mas, vma->vm_end - 1)
+ 		count++;
+ 
+ 	BUG_ON(count != 1);
+ 
+ 	BUG_ON(mas->min > vma->vm_start);
+ 	BUG_ON(mas->min > mas->index);
+ #endif
+ 	mas->index = vma->vm_start;
+ 	mas->last = vma->vm_end - 1;
+ 	ret = mas_store_gfp(mas, NULL, GFP_KERNEL);
+ 	return ret;
+ }
+ 
 +struct anon_vma *folio_anon_vma(struct folio *folio);
 +
  #ifdef CONFIG_MMU
  void unmap_mapping_folio(struct folio *folio);
  extern long populate_vma_page_range(struct vm_area_struct *vma,

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ