linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: broonie@kernel.org
To: Matthew Wilcox <willy@infradead.org>
Cc: "Liam R . Howlett" <Liam.Howlett@oracle.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the folio tree with the maple tree
Date: Wed, 23 Feb 2022 23:49:58 +0000	[thread overview]
Message-ID: <20220223234958.672315-1-broonie@kernel.org> (raw)

Hi all,

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

  mm/internal.h

between commits:

  37f4270132af3 ("mm: Start tracking VMAs with maple tree")
  b3d7ba3cdf23c ("mm: Remove the vma linked list")

from the maple tree and commit:

  522387590ac22 ("mm: Turn page_anon_vma() into folio_anon_vma()")

from the folio 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.

diff --cc mm/internal.h
index 2d3ede05cd7bf,0e95bc2130c4d..0000000000000
--- a/mm/internal.h
+++ b/mm/internal.h
@@@ -66,17 -67,12 +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,
@@@ -387,76 -388,12 +389,79 @@@ static inline bool is_data_mapping(vm_f
  	return (flags & (VM_WRITE | VM_SHARED | VM_STACK)) == VM_WRITE;
  }
  
 +/* 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;
 +}
 +
+ /* 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);
+ 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,

             reply	other threads:[~2022-02-23 23:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 23:49 broonie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-24  1:16 linux-next: manual merge of the folio tree with the maple tree broonie
2022-02-24  2:02 ` Mark Brown
2022-02-23 23:54 broonie
2022-02-17  7:11 Stephen Rothwell
2022-02-17  6:44 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220223234958.672315-1-broonie@kernel.org \
    --to=broonie@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).