From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Rolf Eike Beer <eb@emlix.com>,
Steven Price <steven.price@arm.com>
Subject: linux-next: manual merge of the mm tree with Linus' tree
Date: Tue, 6 Sep 2022 19:01:41 +1000 [thread overview]
Message-ID: <20220906190141.028ea19a@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 4052 bytes --]
Hi all,
Today's linux-next merge of the mm tree got a conflict in:
mm/pagewalk.c
between commit:
8782fb61cc84 ("mm: pagewalk: Fix race between unmap and page walker")
from Linus' tree and commits:
fa02fb928200 ("mm: pagewalk: make error checks more obvious")
66c217081bd0 ("mm: pagewalk: allow walk_page_range_novma() without mm")
from the mm tree.
I fixed it up (I think - 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/pagewalk.c
index fa7a3d21a751,418717eec09e..000000000000
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@@ -108,13 -104,16 +104,16 @@@ static int walk_pmd_range(pud_t *pud, u
pmd = pmd_offset(pud, addr);
do {
- again:
+ int err;
+
+ again:
next = pmd_addr_end(addr, end);
- if (pmd_none(*pmd) || (!walk->vma && !walk->no_vma)) {
+ if (pmd_none(*pmd)) {
- if (ops->pte_hole)
+ if (ops->pte_hole) {
err = ops->pte_hole(addr, next, depth, walk);
- if (err)
- break;
+ if (err)
+ return err;
+ }
continue;
}
@@@ -169,13 -168,16 +168,16 @@@ static int walk_pud_range(p4d_t *p4d, u
pud = pud_offset(p4d, addr);
do {
+ int err;
+
again:
next = pud_addr_end(addr, end);
- if (pud_none(*pud) || (!walk->vma && !walk->no_vma)) {
+ if (pud_none(*pud)) {
- if (ops->pte_hole)
+ if (ops->pte_hole) {
err = ops->pte_hole(addr, next, depth, walk);
- if (err)
- break;
+ if (err)
+ return err;
+ }
continue;
}
@@@ -447,20 -456,17 +456,21 @@@ int walk_page_range(struct mm_struct *m
vma = find_vma(walk.mm, start);
do {
+ int err;
+
+ walk.vma = vma;
if (!vma) { /* after the last vma */
- walk.vma = NULL;
next = end;
+ if (ops->pte_hole)
+ err = ops->pte_hole(start, next, -1, &walk);
} else if (start < vma->vm_start) { /* outside vma */
walk.vma = NULL;
next = min(end, vma->vm_start);
+ if (ops->pte_hole)
+ err = ops->pte_hole(start, next, -1, &walk);
} else { /* inside vma */
- walk.vma = vma;
next = min(end, vma->vm_end);
- vma = vma->vm_next;
+ vma = find_vma(mm, vma->vm_end);
err = walk_page_test(start, next, &walk);
if (err > 0) {
@@@ -472,17 -478,26 +482,24 @@@
continue;
}
if (err < 0)
- break;
+ return err;
- }
- if (walk.vma || walk.ops->pte_hole) {
err = __walk_page_range(start, next, &walk);
+ if (err)
+ return err;
}
- if (err)
- break;
} while (start = next, start < end);
- return err;
+ return 0;
}
- /*
+ /**
+ * walk_page_range_novma - walk a range of pagetables not backed by a vma
+ * @mm: mm_struct representing the target process of page table walk
+ * @start: start address of the virtual address range
+ * @end: end address of the virtual address range
+ * @ops: operation to call during the walk
+ * @pgd: pgd to walk if different from mm->pgd
+ * @private: private data for callbacks' usage
+ *
* Similar to walk_page_range() but can walk any page tables even if they are
* not backed by VMAs. Because 'unusual' entries may be walked this function
* will also not lock the PTEs for the pte_entry() callback. This is useful for
@@@ -501,10 -518,11 +520,11 @@@ int walk_page_range_novma(struct mm_str
.no_vma = true
};
- if (start >= end || !walk.mm)
+ if (start >= end || (!walk.mm && !walk.pgd))
return -EINVAL;
- mmap_assert_write_locked(walk.mm);
+ if (walk.mm)
- mmap_assert_locked(walk.mm);
++ mmap_assert_write_locked(walk.mm);
return walk_pgd_range(start, end, &walk);
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2022-09-06 9:01 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 9:01 Stephen Rothwell [this message]
2022-09-06 9:21 ` linux-next: manual merge of the mm tree with Linus' tree Rolf Eike Beer
-- strict thread matches above, loose matches on Subject: below --
2025-02-09 22:39 Stephen Rothwell
2024-09-29 23:56 Stephen Rothwell
2024-09-30 6:01 ` Miguel Ojeda
2024-09-16 23:27 Stephen Rothwell
2024-09-17 23:40 ` Stephen Rothwell
2024-09-09 0:00 Stephen Rothwell
2024-09-09 1:53 ` Huang, Ying
2024-09-17 23:36 ` Stephen Rothwell
2024-07-28 22:41 Stephen Rothwell
2024-07-28 22:45 ` Stephen Rothwell
2024-07-28 23:31 ` Andrew Morton
2024-05-09 23:22 Stephen Rothwell
2023-07-27 23:18 Stephen Rothwell
2023-07-27 23:29 ` Stephen Rothwell
2023-07-27 23:40 ` Suren Baghdasaryan
2023-07-27 23:50 ` Matthew Wilcox
2023-07-28 0:08 ` Suren Baghdasaryan
2023-07-28 0:00 ` Stephen Rothwell
2023-07-28 3:13 ` Matthew Wilcox
2023-07-27 23:49 ` Matthew Wilcox
2023-07-28 0:21 ` Stephen Rothwell
2023-07-28 0:23 ` Suren Baghdasaryan
2023-07-28 0:29 ` Stephen Rothwell
2023-07-28 0:30 ` Suren Baghdasaryan
2023-07-06 22:54 Stephen Rothwell
2023-07-07 4:52 ` Baoquan He
2023-06-18 23:23 Stephen Rothwell
2023-06-19 20:25 ` Andrew Morton
2023-06-19 20:43 ` Will Deacon
2023-06-19 21:39 ` Andrew Morton
2023-06-20 9:43 ` Will Deacon
2023-06-20 15:00 ` Jain, Ayush
2023-02-24 23:39 Stephen Rothwell
2023-02-25 2:04 ` Andrew Morton
2023-02-25 7:13 ` Christian Brauner
2023-02-25 20:52 ` Andrew Morton
2023-02-27 10:18 ` Christian Brauner
2023-02-27 17:55 ` Andrew Morton
2022-11-07 2:52 Stephen Rothwell
2022-05-26 6:09 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=20220906190141.028ea19a@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=akpm@linux-foundation.org \
--cc=eb@emlix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=steven.price@arm.com \
/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