dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2019-06-24 10:49 Stephen Rothwell
  2019-06-24 11:06 ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2019-06-24 10:49 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Thomas Hellstrom, Anshuman Khandual

[-- Attachment #1: Type: text/plain, Size: 4066 bytes --]

Hi all,

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

  mm/memory.c

between commit:

  29875a52915e ("mm: Add an apply_to_pfn_range interface")

from the drm tree and commit:

  e972cea08fb3 ("mm/pgtable: drop pgtable_t variable from pte_fn_t functions")

from the akpm-current tree.

I fixed it up (see below my signature, then added the following merge
resolution patch as well) 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.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 24 Jun 2019 20:40:46 +1000
Subject: [PATCH] merge fixup for "mm: Add an apply_to_pfn_range interface"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 include/linux/mm.h    | 2 +-
 mm/as_dirty_helpers.c | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 87d53de3dee4..4404e18443ef 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2673,7 +2673,7 @@ extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
 			       unsigned long size, pte_fn_t fn, void *data);
 
 struct pfn_range_apply;
-typedef int (*pter_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
+typedef int (*pter_fn_t)(pte_t *pte, unsigned long addr,
 			 struct pfn_range_apply *closure);
 struct pfn_range_apply {
 	struct mm_struct *mm;
diff --git a/mm/as_dirty_helpers.c b/mm/as_dirty_helpers.c
index f600e31534fb..7c863626c2a4 100644
--- a/mm/as_dirty_helpers.c
+++ b/mm/as_dirty_helpers.c
@@ -26,7 +26,6 @@ struct apply_as {
 /**
  * apply_pt_wrprotect - Leaf pte callback to write-protect a pte
  * @pte: Pointer to the pte
- * @token: Page table token, see apply_to_pfn_range()
  * @addr: The virtual page address
  * @closure: Pointer to a struct pfn_range_apply embedded in a
  * struct apply_as
@@ -36,8 +35,7 @@ struct apply_as {
  *
  * Return: Always zero.
  */
-static int apply_pt_wrprotect(pte_t *pte, pgtable_t token,
-			      unsigned long addr,
+static int apply_pt_wrprotect(pte_t *pte, unsigned long addr,
 			      struct pfn_range_apply *closure)
 {
 	struct apply_as *aas = container_of(closure, typeof(*aas), base);
@@ -78,7 +76,6 @@ struct apply_as_clean {
 /**
  * apply_pt_clean - Leaf pte callback to clean a pte
  * @pte: Pointer to the pte
- * @token: Page table token, see apply_to_pfn_range()
  * @addr: The virtual page address
  * @closure: Pointer to a struct pfn_range_apply embedded in a
  * struct apply_as_clean
@@ -91,8 +88,7 @@ struct apply_as_clean {
  *
  * Return: Always zero.
  */
-static int apply_pt_clean(pte_t *pte, pgtable_t token,
-			  unsigned long addr,
+static int apply_pt_clean(pte_t *pte, unsigned long addr,
 			  struct pfn_range_apply *closure)
 {
 	struct apply_as *aas = container_of(closure, typeof(*aas), base);
-- 
2.20.1

-- 
Cheers,
Stephen Rothwell

diff --cc mm/memory.c
index 462aa47f8878,f8a75528658a..e7e37fcbd687
--- a/mm/memory.c
+++ b/mm/memory.c
@@@ -2037,12 -2036,11 +2035,11 @@@ static int apply_to_pte_range(struct pf
  {
  	pte_t *pte;
  	int err;
- 	pgtable_t token;
  	spinlock_t *uninitialized_var(ptl);
  
 -	pte = (mm == &init_mm) ?
 +	pte = (closure->mm == &init_mm) ?
  		pte_alloc_kernel(pmd, addr) :
 -		pte_alloc_map_lock(mm, pmd, addr, &ptl);
 +		pte_alloc_map_lock(closure->mm, pmd, addr, &ptl);
  	if (!pte)
  		return -ENOMEM;
  
@@@ -2050,10 -2048,8 +2047,8 @@@
  
  	arch_enter_lazy_mmu_mode();
  
- 	token = pmd_pgtable(*pmd);
- 
  	do {
- 		err = closure->ptefn(pte++, token, addr, closure);
 -		err = fn(pte++, addr, data);
++		err = closure->ptefn(pte++, addr, closure);
  		if (err)
  			break;
  	} while (addr += PAGE_SIZE, addr != end);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2020-04-03  4:05 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2020-04-03  4:05 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Andrea Arcangeli, Thomas Hellstrom (VMware),
	Linux Next Mailing List, Linux Kernel Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 2843 bytes --]

Hi all,

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

  mm/memory.c

between commit:

  327e9fd48972 ("mm: Split huge pages on write-notify or COW")

from the drm tree and commit:

  de0b1f32cbeb ("userfaultfd: wp: hook userfault handler to write protection fault")

from the akpm-current 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/memory.c
index efa59b1b109c,9e75440c79ce..000000000000
--- a/mm/memory.c
+++ b/mm/memory.c
@@@ -3949,42 -3969,29 +3969,40 @@@ static inline vm_fault_t create_huge_pm
  /* `inline' is required to avoid gcc 4.1.2 build error */
  static inline vm_fault_t wp_huge_pmd(struct vm_fault *vmf, pmd_t orig_pmd)
  {
- 	if (vma_is_anonymous(vmf->vma))
+ 	if (vma_is_anonymous(vmf->vma)) {
+ 		if (userfaultfd_huge_pmd_wp(vmf->vma, orig_pmd))
+ 			return handle_userfault(vmf, VM_UFFD_WP);
  		return do_huge_pmd_wp_page(vmf, orig_pmd);
+ 	}
 -	if (vmf->vma->vm_ops->huge_fault)
 -		return vmf->vma->vm_ops->huge_fault(vmf, PE_SIZE_PMD);
 +	if (vmf->vma->vm_ops->huge_fault) {
 +		vm_fault_t ret = vmf->vma->vm_ops->huge_fault(vmf, PE_SIZE_PMD);
 +
 +		if (!(ret & VM_FAULT_FALLBACK))
 +			return ret;
 +	}
  
 -	/* COW handled on pte level: split pmd */
 -	VM_BUG_ON_VMA(vmf->vma->vm_flags & VM_SHARED, vmf->vma);
 +	/* COW or write-notify handled on pte level: split pmd. */
  	__split_huge_pmd(vmf->vma, vmf->pmd, vmf->address, false, NULL);
  
  	return VM_FAULT_FALLBACK;
  }
  
- static inline bool vma_is_accessible(struct vm_area_struct *vma)
- {
- 	return vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE);
- }
- 
  static vm_fault_t create_huge_pud(struct vm_fault *vmf)
  {
 -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 +#if defined(CONFIG_TRANSPARENT_HUGEPAGE) &&			\
 +	defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)
  	/* No support for anonymous transparent PUD pages yet */
  	if (vma_is_anonymous(vmf->vma))
 -		return VM_FAULT_FALLBACK;
 -	if (vmf->vma->vm_ops->huge_fault)
 -		return vmf->vma->vm_ops->huge_fault(vmf, PE_SIZE_PUD);
 +		goto split;
 +	if (vmf->vma->vm_ops->huge_fault) {
 +		vm_fault_t ret = vmf->vma->vm_ops->huge_fault(vmf, PE_SIZE_PUD);
 +
 +		if (!(ret & VM_FAULT_FALLBACK))
 +			return ret;
 +	}
 +split:
 +	/* COW or write-notify not handled on PUD level: split pud.*/
 +	__split_huge_pud(vmf->vma, vmf->pud, vmf->address);
  #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
  	return VM_FAULT_FALLBACK;
  }

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread
* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2020-04-03  3:58 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2020-04-03  3:58 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Thomas Hellstrom (VMware), Linux Next Mailing List,
	Linux Kernel Mailing List, Peter Xu


[-- Attachment #1.1: Type: text/plain, Size: 2710 bytes --]

Hi all,

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

  include/linux/huge_mm.h

between commit:

  9a9731b18c9b ("mm: Add vmf_insert_pfn_xxx_prot() for huge page-table entries")

from the drm tree and commit:

  7b6b88969e9d ("mm: merge parameters for change_protection()")

from the akpm-current 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 include/linux/huge_mm.h
index f63b0882c1b3,e60c923e68c4..000000000000
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@@ -46,46 -46,9 +46,46 @@@ extern bool move_huge_pmd(struct vm_are
  			 pmd_t *old_pmd, pmd_t *new_pmd);
  extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
  			unsigned long addr, pgprot_t newprot,
- 			int prot_numa);
+ 			unsigned long cp_flags);
 -vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn, bool write);
 -vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn, bool write);
 +vm_fault_t vmf_insert_pfn_pmd_prot(struct vm_fault *vmf, pfn_t pfn,
 +				   pgprot_t pgprot, bool write);
 +
 +/**
 + * vmf_insert_pfn_pmd - insert a pmd size pfn
 + * @vmf: Structure describing the fault
 + * @pfn: pfn to insert
 + * @pgprot: page protection to use
 + * @write: whether it's a write fault
 + *
 + * Insert a pmd size pfn. See vmf_insert_pfn() for additional info.
 + *
 + * Return: vm_fault_t value.
 + */
 +static inline vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn,
 +					    bool write)
 +{
 +	return vmf_insert_pfn_pmd_prot(vmf, pfn, vmf->vma->vm_page_prot, write);
 +}
 +vm_fault_t vmf_insert_pfn_pud_prot(struct vm_fault *vmf, pfn_t pfn,
 +				   pgprot_t pgprot, bool write);
 +
 +/**
 + * vmf_insert_pfn_pud - insert a pud size pfn
 + * @vmf: Structure describing the fault
 + * @pfn: pfn to insert
 + * @pgprot: page protection to use
 + * @write: whether it's a write fault
 + *
 + * Insert a pud size pfn. See vmf_insert_pfn() for additional info.
 + *
 + * Return: vm_fault_t value.
 + */
 +static inline vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn,
 +					    bool write)
 +{
 +	return vmf_insert_pfn_pud_prot(vmf, pfn, vmf->vma->vm_page_prot, write);
 +}
 +
  enum transparent_hugepage_flag {
  	TRANSPARENT_HUGEPAGE_FLAG,
  	TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread
* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2017-11-02  7:32 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2017-11-02  7:32 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Mel Gorman,
	Christian König, Alex Deucher

Hi Andrew,

Today's linux-next merge of the akpm-current tree got conflicts in:

  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

between commits:

  b72cf4fca2bb ("drm/amdgpu: move taking mmap_sem into get_user_pages v2")
  ca666a3c298f ("drm/amdgpu: stop using BO status for user pages")

from the drm tree and commit:

  b7e8af45222b ("mm: remove cold parameter for release_pages")

from the akpm-current 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 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index f7fceb63413c,cd664832f9e8..000000000000
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@@ -562,8 -553,7 +562,7 @@@ static int amdgpu_cs_parser_bos(struct 
  				 * invalidated it. Free it and try again
  				 */
  				release_pages(e->user_pages,
- 					      bo->tbo.ttm->num_pages,
- 					      false);
 -					      e->robj->tbo.ttm->num_pages);
++					      bo->tbo.ttm->num_pages);
  				kvfree(e->user_pages);
  				e->user_pages = NULL;
  			}
diff --cc drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 51eacefadea1,d792959fac43..000000000000
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@@ -746,8 -659,7 +746,8 @@@ int amdgpu_ttm_tt_get_user_pages(struc
  	return 0;
  
  release_pages:
- 	release_pages(pages, pinned, 0);
+ 	release_pages(pages, pinned);
 +	up_read(&current->mm->mmap_sem);
  	return r;
  }
  

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-03  4:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-24 10:49 linux-next: manual merge of the akpm-current tree with the drm tree Stephen Rothwell
2019-06-24 11:06 ` Stephen Rothwell
2019-07-09  0:06   ` Stephen Rothwell
2019-07-15  1:11     ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2020-04-03  4:05 Stephen Rothwell
2020-04-03  3:58 Stephen Rothwell
2017-11-02  7:32 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox