So sorry Ulad, I meant to get back to you on this sooner!
On Tue, Jul 29, 2025 at 08:39:01PM +0200, Uladzislau Rezki wrote:
> On Tue, Jul 29, 2025 at 06:25:39AM +0100, Lorenzo Stoakes wrote:
> > Andrew - FYI there's nothing to worry about here, the type remains
> > precisel
Andrew - FYI there's nothing to worry about here, the type remains
precisely the same, and I'll send a patch to fix this trivial issue so when
later this type changes vmalloc will be uaffected.
On Tue, Jul 29, 2025 at 09:15:51AM +0900, Harry Yoo wrote:
> [Adding Uladzislau to Cc]
Ulad - could we
On Wed, Jul 02, 2025 at 11:02:21AM +0200, David Hildenbrand wrote:
> On 02.07.25 10:49, Lorenzo Stoakes wrote:
> > On Tue, Jul 01, 2025 at 09:34:41PM +0200, David Hildenbrand wrote:
> > > On 01.07.25 15:02, Lorenzo Stoakes wrote:
> > > > On Mon, Jun 30, 2025 at 03:00
On Tue, Jul 01, 2025 at 09:31:56PM +0200, David Hildenbrand wrote:
> On 01.07.25 14:54, Lorenzo Stoakes wrote:
> > On Mon, Jun 30, 2025 at 03:00:03PM +0200, David Hildenbrand wrote:
> > > KSM is the only remaining user, let's rename the flag. While at it,
> > > adju
On Tue, Jul 01, 2025 at 09:34:41PM +0200, David Hildenbrand wrote:
> On 01.07.25 15:02, Lorenzo Stoakes wrote:
> > On Mon, Jun 30, 2025 at 03:00:04PM +0200, David Hildenbrand wrote:
> > > We can now simply check for PageAnon() and remove PageMappingFlags().
> > >
> &g
On Mon, Jun 30, 2025 at 03:00:07PM +0200, David Hildenbrand wrote:
> Now that the mapping flags are only used for folios, let's rename the
> defines.
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
As the official King of Churn (TM) I approve of this :)
Reviewed
On Mon, Jun 30, 2025 at 03:00:10PM +0200, David Hildenbrand wrote:
> Let's just special-case based on IS_ENABLED(CONFIG_BALLOON_COMPACTION
> like we did for balloon_page_finalize().
>
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
>
s we will try avoiding using the
> page lock.
>
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/balloon_compaction.h | 13 ++---
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/i
On Mon, Jun 30, 2025 at 03:00:08PM +0200, David Hildenbrand wrote:
> Let's bring the docs up-to-date.
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> Documentation/mm/page_migration.rst | 39
rd regions :P)
* PGTY_unaccepted - nor unaccepted memory perhaps?
* PGTY_large_malloc - slab, shouldn't be here
I'd maybe delineate these cases also.
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
On assumption no typed page should be tolerable here:
Reviewed-
Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/page-flags.h | 5 -
> mm/page_alloc.c| 7 +++
> 2 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index ab
On Mon, Jun 30, 2025 at 03:00:05PM +0200, David Hildenbrand wrote:
> It's unused and the page counterpart is gone, so let's remove it.
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/page
e cleanup based on fact you've now made
the per-page mapping op stuff not be part of this.
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/page-flags.h | 12 ++--
> 1 file changed, 6 ins
d
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/page-flags.h | 16 +++-
> mm/compaction.c| 2 +-
> mm/migrate.c | 14 +++---
> 3 files changed, 19 insertions(+), 13 deletions(-)
>
> diff --git a/include/linux/pa
use it for movable ops pages because it's used to track
file system state.
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
Seems reasonable though, so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/balloon_compaction.h | 2 +-
> include/l
nterim measure.
So:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/balloon_compaction.h | 2 +-
> include/linux/migrate.h| 14 ++
> include/linux/zsmalloc.h | 2 ++
> mm/balloon_compaction.c| 1 -
> mm/compact
gt; Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/page-flags.h | 6 --
> mm/migrate.c | 43 --
> mm/vmscan.c| 6 --
> 3 files ch
On Tue, Jul 01, 2025 at 12:19:47PM +0200, David Hildenbrand wrote:
> On 01.07.25 12:03, Lorenzo Stoakes wrote:
> > On Mon, Jun 30, 2025 at 02:59:54PM +0200, David Hildenbrand wrote:
> > > We can just look at the balloon device (stored in page->private), to see
> > >
On Tue, Jul 01, 2025 at 12:15:41PM +0200, David Hildenbrand wrote:
> On 30.06.25 19:07, Lorenzo Stoakes wrote:
> > On Mon, Jun 30, 2025 at 02:59:51PM +0200, David Hildenbrand wrote:
> > > Folios will have nothing to do with movable_ops page migration. These
> > > functio
On Mon, Jun 30, 2025 at 02:59:58PM +0200, David Hildenbrand wrote:
> Currently, we only support migration of individual movable_ops pages, so
> we can not run into that.
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
Seems sensible, so:
Reviewed-by: Lorenzo Stoake
eat, love it.
Reviewed-by: Lorenzo Stoakes
I noticed that the Simplified Chinese documentation has references for this, but
again we have to defer to somebody fluent in this of course!
but also in mm/memory_hotplug.c in scan_movable_pages():
/*
* PageOffline()
Yan
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/migrate.h | 2 --
> mm/compaction.c | 15 ---
> mm/migrate.c| 18 ++
> 3 files changed, 10 insertions(+), 25 deletions(-)
>
actually speaks that language.
Yeah I've noticed these getting out of sync before, perhaps somebody fluent in
Simplified Chinese can assist at some point :) mine is rather rusty...
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
Lovely! The best code is no code
t letting these pages get destroyed
> while they are isolated -- and instead delaying that to the
> putback/migration call. Add a TODO for that.
>
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> mm/zsmalloc.c | 15 +++
> 1 file chan
hile isolated), we don't have to worry about this case in
> the putback and migration callback. Add a WARN_ON_ONCE for now.
>
> Signed-off-by: David Hildenbrand
Seems reasonable, one comment below re: comment.
Reviewed-by: Lorenzo Stoakes
> ---
> include/linu
ause it only
> deals with actual folios. (we only support migration of
> individual movable_ops pages)
Important caveat here :)
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> mm/migrate.c | 63
On Tue, Jul 01, 2025 at 10:29:54AM +0200, David Hildenbrand wrote:
> > I wonder, in the wonderful future where PageXXX() always refers to a page,
> > can
> > we use something less horrible than these macros?
>
> Good question. It all interacts with how we believe compound pages will work
> / look
On Tue, Jul 01, 2025 at 10:17:13AM +0200, David Hildenbrand wrote:
> On 30.06.25 17:27, Lorenzo Stoakes wrote:
> > On Mon, Jun 30, 2025 at 02:59:45PM +0200, David Hildenbrand wrote:
> > > Currently, any user of page types must clear that type before freeing
> > &g
On Tue, Jul 01, 2025 at 09:58:09AM +0200, David Hildenbrand wrote:
> On 30.06.25 17:15, Lorenzo Stoakes wrote:
> > On Mon, Jun 30, 2025 at 02:59:43PM +0200, David Hildenbrand wrote:
> > > Let's move the removal of the page from the balloon list into the single
>
On Tue, Jul 01, 2025 at 10:03:57AM +0200, David Hildenbrand wrote:
> > > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> > > index 999b513c7fdff..7f1431f2be98f 100644
> > > --- a/mm/zsmalloc.c
> > > +++ b/mm/zsmalloc.c
> > > @@ -1719,8 +1719,6 @@ static bool zs_page_isolate(struct page *page,
> > > i
On Tue, Jul 01, 2025 at 10:34:33AM +0200, David Hildenbrand wrote:
> > > > > Reviewed-by: Zi Yan
> > > > > Acked-by: Harry Yoo
> > > > > Signed-off-by: David Hildenbrand
Based on discussion below, I'm good with this now with the comment
viewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/migrate.h | 14 --
> 1 file changed, 14 deletions(-)
>
> diff --git a/include/linux/migrate.h b/include/linux/migrate.h
> index c0ec7422837bd..c99a00d4ca27d
>
> Note that we can now change folio_mapping_flags() to folio_test_anon()
> to make it clearer, because movable_ops pages will never take that path.
>
> Reviewed-by: Zi Yan
> Signed-off-by: David Hildenbrand
Have scrutinised this a lot and it seems correct to me, so:
Reviewed
by: David Hildenbrand
LGTM, so:
Reviewed-by: Lorenzo Stoakes
> ---
> mm/migrate.c | 37 -
> 1 file changed, 24 insertions(+), 13 deletions(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index d4b4a7eefb6bd..d97f7cd137e63 100644
&g
ng folios for now: that perfectly highlights the
> problematic bits.
>
> Reviewed-by: Zi Yan
> Reviewed-by: Harry Yoo
> Signed-off-by: David Hildenbrand
Seesm reasonable to me so:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/migrate.h | 4 ++--
> mm/com
On Mon, Jun 30, 2025 at 12:14:01PM -0400, Zi Yan wrote:
> On 30 Jun 2025, at 12:01, Lorenzo Stoakes wrote:
>
> > On Mon, Jun 30, 2025 at 02:59:46PM +0200, David Hildenbrand wrote:
> >> Let the page freeing code handle clearing the page type.
> >
> > Why is this
hing:
Reviewed-by: Lorenzo Stoakes
> ---
> mm/zpdesc.h | 5 -
> mm/zsmalloc.c | 3 +--
> 2 files changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/mm/zpdesc.h b/mm/zpdesc.h
> index 5cb7e3de43952..5763f36039736 100644
> --- a/mm/zpdesc.h
> +++ b/mm/zpdes
ildenbrand
On assumption this UINT_MAX stuff is sane :)) I mean this is straightforward I
guess:
Reviewed-by: Lorenzo Stoakes
> ---
> include/linux/balloon_compaction.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/balloon_compaction.h
> b/i
On Mon, Jun 30, 2025 at 02:59:45PM +0200, David Hildenbrand wrote:
> Currently, any user of page types must clear that type before freeing
> a page back to the buddy, otherwise we'll run into mapcount related
> sanity checks (because the page type currently overlays the page
> mapcount).
>
> Let's
ry Yoo
> Signed-off-by: David Hildenbrand
LGTM, one comment below.
Reviewed-by: Lorenzo Stoakes
> ---
> mm/zpdesc.h | 5 -
> mm/zsmalloc.c | 5 -
> 2 files changed, 10 deletions(-)
>
> diff --git a/mm/zpdesc.h b/mm/zpdesc.h
> index d3df316e5bb7b..5cb7
On Mon, Jun 30, 2025 at 02:59:43PM +0200, David Hildenbrand wrote:
> Let's move the removal of the page from the balloon list into the single
> caller, to remove the dependency on the PG_isolated flag and clarify
> locking requirements.
>
> We'll shuffle the operations a bit such that they logicall
t;
> Let's drop this unnecessary check.
>
> Acked-by: Zi Yan
> Signed-off-by: David Hildenbrand
So,
Reviewed-by: Lorenzo Stoakes
> ---
> mm/balloon_compaction.c | 6 --
> 1 file changed, 6 deletions(-)
>
> diff --git a/mm/balloon_compaction.c b/mm/balloon_com
On Tue, Jun 24, 2025 at 09:50:50PM -0700, Andrew Morton wrote:
> On Wed, 25 Jun 2025 08:25:35 +0530 Anshuman Khandual
> wrote:
>
> > ust wondering which tree-branch this series applies ? Tried all the usual
> > ones but could not apply the series cleanly.
> >
> > v6.16-rc3
> > next-20250624
> > m
1
From: Lorenzo Stoakes
Date: Thu, 19 Jun 2025 13:21:15 +0100
Subject: [PATCH] mm: add missing vm_get_page_prot() instance, remove include
I missed a case for powerpc, also remove #include (that is not in practice
necessary) to avoid any risk of circular dependency.
Signed-off-by: Lorenzo Stoakes
---
On Thu, Jun 19, 2025 at 02:12:49PM +0200, Oscar Salvador wrote:
> On Wed, Jun 18, 2025 at 08:42:52PM +0100, Lorenzo Stoakes wrote:
> > We abstract the type of the VMA flags to vm_flags_t, however in may places
> man
On Thu, Jun 19, 2025 at 01:31:50PM +0200, Vlastimil Babka wrote:
> On 6/18/25 21:42, Lorenzo Stoakes wrote:
> > We abstract the type of the VMA flags to vm_flags_t, however in may places
> > it is simply assumed this is unsigned long, which is simply incorrect.
> >
> > A
On Thu, Jun 19, 2025 at 10:42:14AM +0200, Christian Brauner wrote:
> If you change vm_flags_t to u64 you probably want to compile with some
> of these integer truncation options when you're doing the conversion.
> Because otherwise you risk silently truncating the upper 32bits when
> assigning to a
calling code
as far as is needed.
We will adjust architecture-specific and driver code in a subsequent patch.
Overall, this patch does not introduce any functional change.
Signed-off-by: Lorenzo Stoakes
---
fs/exec.c| 2 +-
fs/userfaultfd.c | 2
In future we intend to change the vm_flags_t type, so it isn't correct for
architecture and driver code to assume it is unsigned long. Correct this
assumption across the board.
Overall, this patch does not introduce any functional change.
Signed-off-by: Lorenzo Stoakes
---
arch/arm/mm/fa
doing so.
Overall, this patch does not introduce any functional change.
Signed-off-by: Lorenzo Stoakes
---
arch/arm64/mm/mmap.c | 2 +-
arch/powerpc/include/asm/book3s/64/pkeys.h | 3 ++-
arch/sparc/mm/init_64.c| 2 +-
arch/x86/mm/pgprot.c
ke the opportunity to refer to VMA flags as vm_flags
where possible to make clear what we're referring to.
Overall, this series does not introduce any functional change.
Lorenzo Stoakes (3):
mm: change vm_get_page_prot() to accept vm_flags_t argument
mm: update core kernel code to use
On Thu, May 29, 2025 at 04:32:04PM +1000, Alistair Popple wrote:
> Previously dax pages were skipped by the pagewalk code as pud_special() or
> vm_normal_page{_pmd}() would be false for DAX pages. Now that dax pages are
> refcounted normally that is no longer the case, so add explicit checks to
> s
+cc Jann who is a specialist in all things page table-y and especially scary
edge cases :)
On Fri, May 30, 2025 at 03:04:38PM +0100, Ryan Roberts wrote:
> Hi All,
>
> I recently added support for lazy mmu mode on arm64. The series is now in
> Linus's tree so should be in v6.16-rc1. But during test
On Thu, Jan 30, 2025 at 03:38:36PM +0100, Geert Uytterhoeven wrote:
> Hi Lorenzo,
>
> On Thu, 30 Jan 2025 at 15:09, Lorenzo Stoakes
> wrote:
> > Having written a ton of test code, I've unfortunately encountered a lot of
> > this sort of push-back and it's HUG
Geert,
Having written a ton of test code, I've unfortunately encountered a lot of
this sort of push-back and it's HUGELY off-putting. Writing test code
should be ENCOURAGED not litigated against.
The truth is far too little kernel code is tested to any degree, and this
is part of why.
On kunit c
On Fri, Dec 13, 2024 at 10:06:55AM -0500, Kalesh Singh wrote:
> On Fri, Dec 13, 2024 at 4:00 AM Lorenzo Stoakes
> wrote:
> >
> > On Thu, Dec 12, 2024 at 05:36:09PM -0800, Andrew Morton wrote:
> > > On Thu, 12 Dec 2024 22:51:34 + Lorenzo Stoakes
> &g
On Thu, Dec 12, 2024 at 05:36:09PM -0800, Andrew Morton wrote:
> On Thu, 12 Dec 2024 22:51:34 +0000 Lorenzo Stoakes
> wrote:
>
> > You've fundamentally violated kernel process and etiquette. I'd be more
> > forgiving, but this is at v2 and you've not cc'
NACK.
Resend this _as an RFC_, _with the correct maintainers and reviewers cc'd_.
You've fundamentally violated kernel process and etiquette. I'd be more
forgiving, but this is at v2 and you've not cc'd KEY people. Twice. This is
totally unacceptable. See [0] if you are unsure of how to do so.
Y
On Thu, Sep 26, 2024 at 01:54:09PM +, Arnd Bergmann wrote:
> On Thu, Sep 26, 2024, at 08:46, David Hildenbrand wrote:
> > On 25.09.24 23:06, Arnd Bergmann wrote:
> >
> > The first, uncontroversial step could indeed be to make
> > MAP_UNINITIALIZED a nop, but still leave the definitions in mman.
tents.
>
> Signed-off-by: Arnd Bergmann
Lovely! Look at all that red :) Great work!
Reviewed-by: Lorenzo Stoakes
> ---
> arch/alpha/include/uapi/asm/mman.h | 68 +++---
> arch/parisc/include/uapi/asm/mman.h| 66 +
> include/u
On Wed, Sep 25, 2024 at 09:06:12PM +, Arnd Bergmann wrote:
> From: Arnd Bergmann
>
> powerpc and sparc include asm-generic/mman-common.h to get the MAP_* flags
> 0x008000 through 0x400, but those flags are all different on alpha,
> mips, parisc and xtensa.
>
> Add duplicate definitions for
this looks good to me - thanks very much
for taking a look at this!)
Acked-by: Lorenzo Stoakes
> ---
> arch/alpha/include/uapi/asm/mman.h | 53 ---
> arch/mips/include/uapi/asm/mman.h | 72 --
> arch/parisc/include/ua
On Wed, Sep 11, 2024 at 11:18:12PM GMT, Charlie Jenkins wrote:
> On Wed, Sep 11, 2024 at 07:21:27PM +0100, Catalin Marinas wrote:
> > On Tue, Sep 10, 2024 at 05:45:07PM -0700, Charlie Jenkins wrote:
> > > On Tue, Sep 10, 2024 at 03:08:14PM -0400, Liam R. Howlett wrote:
> > > > * Catalin Marinas [2
(Sorry having issues with my IPv6 setup that duplicated the original email...
On Fri, Sep 06, 2024 at 09:14:08AM GMT, Arnd Bergmann wrote:
> On Fri, Sep 6, 2024, at 08:14, Lorenzo Stoakes wrote:
> > On Fri, Sep 06, 2024 at 07:17:44AM GMT, Arnd Bergmann wrote:
> >> On Thu, Sep
On Fri, Sep 06, 2024 at 07:17:44AM GMT, Arnd Bergmann wrote:
> On Thu, Sep 5, 2024, at 21:15, Charlie Jenkins wrote:
> > Create a personality flag ADDR_LIMIT_47BIT to support applications
> > that wish to transition from running in environments that support at
> > most 47-bit VAs to environments th
On Fri, Sep 06, 2024 at 07:17:44AM GMT, Arnd Bergmann wrote:
> On Thu, Sep 5, 2024, at 21:15, Charlie Jenkins wrote:
> > Create a personality flag ADDR_LIMIT_47BIT to support applications
> > that wish to transition from running in environments that support at
> > most 47-bit VAs to environments th
On Tue, Sep 03, 2024 at 07:20:02PM GMT, Mark Brown wrote:
> On Tue, Sep 03, 2024 at 06:49:46PM +0100, Lorenzo Stoakes wrote:
> > On Mon, Sep 02, 2024 at 08:08:15PM GMT, Mark Brown wrote:
>
> > > On x86 there is a custom arch_get_unmapped_area() which was updated by the
> &
On Mon, Sep 02, 2024 at 08:08:15PM GMT, Mark Brown wrote:
> As covered in the commit log for c44357c2e76b ("x86/mm: care about shadow
> stack guard gap during placement") our current mmap() implementation does
> not take care to ensure that a new mapping isn't placed with existing
> mappings inside
t; trivially wrapping the generic implementation in the radix_enabled() case.
>
> Signed-off-by: Mark Brown
Acked-by: Lorenzo Stoakes (for mm/mmap.c part)
> ---
> arch/powerpc/mm/book3s64/slice.c | 4 ++--
> include/linux/sched/mm.h | 4 ++--
> mm/mmap.c
_get_unmapped_area(), as for the x86 implementation and the wrapper used
> on other architectures this is modified to supply no flags.
>
> No functional changes.
>
> Signed-off-by: Mark Brown
mm/mmap.c bit looks reasonable to me! Nice cleanup! :)
Acked-by: Lorenzo Stoakes (for mm/mmap.
On Fri, Aug 30, 2024 at 08:03:25AM GMT, Dave Hansen wrote:
> On 8/29/24 01:42, Lorenzo Stoakes wrote:
> >> These applications work on x86 because x86 does an implicit 47-bit
> >> restriction of mmap() address that contain a hint address that is less
> >> than 48 b
On Thu, Aug 29, 2024 at 03:16:53PM GMT, Charlie Jenkins wrote:
> On Thu, Aug 29, 2024 at 10:54:25AM +0100, Lorenzo Stoakes wrote:
> > On Thu, Aug 29, 2024 at 09:42:22AM GMT, Lorenzo Stoakes wrote:
> > > On Thu, Aug 29, 2024 at 12:15:57AM GMT, Charlie Jenkins wrote:
> > &g
On Thu, Aug 29, 2024 at 09:42:22AM GMT, Lorenzo Stoakes wrote:
> On Thu, Aug 29, 2024 at 12:15:57AM GMT, Charlie Jenkins wrote:
> > Some applications rely on placing data in free bits addresses allocated
> > by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the
>
iller
> To: Andreas Larsson
> To: Thomas Gleixner
> To: Ingo Molnar
> To: Borislav Petkov
> To: Dave Hansen
> To: x...@kernel.org
> To: H. Peter Anvin
> To: Andy Lutomirski
> To: Peter Zijlstra
> To: Muchun Song
> To: Andrew Morton
> To: Liam R. Howl
On Thu, Aug 29, 2024 at 12:15:59AM GMT, Charlie Jenkins wrote:
[snip]
> diff --git a/mm/mmap.c b/mm/mmap.c
> index d0dfc85b209b..34ba0db23678 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -1796,6 +1796,9 @@ generic_get_unmapped_area(struct file *filp, unsigned
> long addr,
> struct vm_un
On Tue, Aug 27, 2024 at 10:49:22PM GMT, Charlie Jenkins wrote:
> Add a selftest for MAP_BELOW_HINT that maps until it runs out of space
> below the hint address.
>
> Signed-off-by: Charlie Jenkins
> ---
> tools/testing/selftests/mm/Makefile | 1 +
> tools/testing/selftests/mm/map_below_h
gt; To: Paul Walmsley
> To: Palmer Dabbelt
> To: Albert Ou
> To: Catalin Marinas
> To: Will Deacon
> To: Michael Ellerman
> To: Nicholas Piggin
> To: Christophe Leroy
> To: Naveen N Rao
> To: Muchun Song
> To: Andrew Morton
> To: Liam R. Howlett
> To: Vlasti
fy_mm(mm, start, end)))
> return -EPERM;
>
> - arch_unmap(mm, start, end);
> return do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock);
> }
>
> --
> 2.43.0
>
I hope we can find a way to eliminate these kind of hooks altogether as
they reduce our control over how VMA operations are performed.
LGTM,
Reviewed-by: Lorenzo Stoakes
On Wed, Jul 10, 2024 at 10:28:01PM GMT, Michael Ellerman wrote:
> Lorenzo Stoakes writes:
> > On Mon, Jul 08, 2024 at 04:43:15PM GMT, Liam R. Howlett wrote:
> >>
> ...
> >> The functionality here has changed
> >> --- from ---
> >> may_expand_vm()
On Tue, Oct 17, 2023 at 02:46:07PM +0530, Sachin Sant wrote:
> While running LTP tests (getpid02) on a Power10 server booted with
> 6.6.0-rc6-next-20231016 following crash was seen:
>
> [ 76.386628] Kernel attempted to read user page (d8) - exploit attempt?
> (uid: 0)
> [ 76.386649] BUG: Kerne
t_hugetlb(folio))
> - set_huge_pte_at(mm, address, pvmw.pte,
> pteval);
> + set_huge_pte_at(mm, address, pvmw.pte,
> + pteval, hsz);
> else
> set_pte_at(mm, address, pvmw.pte,
> pteval);
> ret = false;
> @@ -2058,7 +2069,8 @@ static bool try_to_migrate_one(struct folio *folio,
> struct vm_area_struct *vma,
> if (anon_exclusive &&
> page_try_share_anon_rmap(subpage)) {
> if (folio_test_hugetlb(folio))
> - set_huge_pte_at(mm, address, pvmw.pte,
> pteval);
> + set_huge_pte_at(mm, address, pvmw.pte,
> + pteval, hsz);
> else
> set_pte_at(mm, address, pvmw.pte,
> pteval);
> ret = false;
> @@ -2090,7 +2102,8 @@ static bool try_to_migrate_one(struct folio *folio,
> struct vm_area_struct *vma,
> if (pte_uffd_wp(pteval))
> swp_pte = pte_swp_mkuffd_wp(swp_pte);
> if (folio_test_hugetlb(folio))
> - set_huge_pte_at(mm, address, pvmw.pte, swp_pte);
> + set_huge_pte_at(mm, address, pvmw.pte, swp_pte,
> + hsz);
> else
> set_pte_at(mm, address, pvmw.pte, swp_pte);
> trace_set_migration_pte(address, pte_val(swp_pte),
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index ef8599d394fd..a3fedb3ee0db 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -111,7 +111,7 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr,
> unsigned long end,
> pte_t entry = pfn_pte(pfn, prot);
>
> entry = arch_make_huge_pte(entry, ilog2(size), 0);
> - set_huge_pte_at(&init_mm, addr, pte, entry);
> + set_huge_pte_at(&init_mm, addr, pte, entry, size);
> pfn += PFN_DOWN(size);
> continue;
> }
> --
> 2.25.1
>
Looks good to me, vmalloc-wise.
Reviewed-by: Lorenzo Stoakes (for vmalloc change)
qib)
Reviewed-by: Christoph Hellwig
Acked-by: Sakari Ailus (for drivers/media)
Signed-off-by: Lorenzo Stoakes
---
arch/powerpc/mm/book3s64/iommu_api.c | 2 +-
drivers/infiniband/hw/qib/qib_user_pages.c | 2 +-
drivers/infiniband/hw/usnic/usnic_uiom.c | 2 +-
drivers/infiniband/sw/siw
qib)
Signed-off-by: Lorenzo Stoakes
---
arch/powerpc/mm/book3s64/iommu_api.c | 2 +-
drivers/infiniband/hw/qib/qib_user_pages.c | 2 +-
drivers/infiniband/hw/usnic/usnic_uiom.c | 2 +-
drivers/infiniband/sw/siw/siw_mem.c| 2 +-
drivers/media/v4l2-core/videobuf-dma-sg.c | 2
qib)
Signed-off-by: Lorenzo Stoakes
---
arch/powerpc/mm/book3s64/iommu_api.c | 2 +-
drivers/infiniband/hw/qib/qib_user_pages.c | 2 +-
drivers/infiniband/hw/usnic/usnic_uiom.c | 2 +-
drivers/infiniband/sw/siw/siw_mem.c| 2 +-
drivers/media/v4l2-core/videobuf-dma-sg.c | 2
After the introduction of FOLL_SAME_FILE we no longer require vmas for any
invocation of pin_user_pages(), so eliminate this parameter from the
function and all callers.
This clears the way to removing the vmas parameter from GUP altogether.
Signed-off-by: Lorenzo Stoakes
---
arch/powerpc/mm
After the introduction of FOLL_SAME_FILE we no longer require vmas for any
invocation of pin_user_pages(), so eliminate this parameter from the
function and all callers.
This clears the way to removing the vmas parameter from GUP altogether.
Signed-off-by: Lorenzo Stoakes
---
arch/powerpc/mm
After the introduction of FOLL_SAME_FILE we no longer require vmas for any
invocation of pin_user_pages(), so eliminate this parameter from the
function and all callers.
This clears the way to removing the vmas parameter from GUP altogether.
Signed-off-by: Lorenzo Stoakes
---
arch/powerpc/mm
On Fri, Mar 24, 2023 at 05:34:18AM +0800, kernel test robot wrote:
> tree/branch:
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> branch HEAD: 7c4a254d78f89546d0e74a40617ef24c6151c8d1 Add linux-next
> specific files for 20230323
>
> Error/Warning reports:
>
> https
On Wed, Oct 19, 2016 at 10:52:05AM +0200, Michal Hocko wrote:
> yes this is the desirable and expected behavior.
>
> > wonder if this is desirable behaviour or whether this ought to be limited to
> > ptrace system calls. Regardless, by making the flag more visible it makes it
> > easier to see that
On Tue, Oct 18, 2016 at 05:30:50PM +0200, Michal Hocko wrote:
> I am wondering whether we can go further. E.g. it is not really clear to
> me whether we need an explicit FOLL_REMOTE when we can in fact check
> mm != current->mm and imply that. Maybe there are some contexts which
> wouldn't work, I
On Wed, Oct 19, 2016 at 10:13:52AM +0200, Michal Hocko wrote:
> On Wed 19-10-16 09:59:03, Jan Kara wrote:
> > On Thu 13-10-16 01:20:18, Lorenzo Stoakes wrote:
> > > This patch removes the write parameter from __access_remote_vm() and
> > > replaces it
> > >
On Tue, Oct 18, 2016 at 02:54:25PM +0200, Jan Kara wrote:
> > @@ -1282,7 +1282,7 @@ long get_user_pages(unsigned long start, unsigned
> > long nr_pages,
> > int write, int force, struct page **pages,
> > struct vm_area_struct **vmas);
> > long get_u
behaviour
(and hence bugs) within the mm subsystem.
Signed-off-by: Lorenzo Stoakes
---
arch/alpha/kernel/ptrace.c | 9 ++---
arch/blackfin/kernel/ptrace.c | 5 +++--
arch/cris/arch-v32/kernel/ptrace.c | 4 ++--
arch/ia64/kernel/ptrace.c | 14 +-
arch/m32r
behaviour
(and hence bugs) within the mm subsystem.
Signed-off-by: Lorenzo Stoakes
---
fs/proc/base.c | 19 +--
include/linux/mm.h | 2 +-
mm/memory.c| 11 +++
mm/nommu.c | 7 +++
4 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/fs/proc
behaviour
(and hence bugs) within the mm subsystem.
Signed-off-by: Lorenzo Stoakes
---
mm/memory.c | 23 +++
mm/nommu.c | 9 ++---
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 20a9adb..79ebed3 100644
--- a/mm/memory.c
+++ b
This patch removes the write and force parameters from get_user_pages_remote()
and replaces them with a gup_flags parameter to make the use of FOLL_FORCE
explicit in callers as use of this flag can result in surprising behaviour (and
hence bugs) within the mm subsystem.
Signed-off-by: Lorenzo
This patch removes the write and force parameters from get_user_pages() and
replaces them with a gup_flags parameter to make the use of FOLL_FORCE explicit
in callers as use of this flag can result in surprising behaviour (and hence
bugs) within the mm subsystem.
Signed-off-by: Lorenzo Stoakes
This patch removes the write and force parameters from get_vaddr_frames() and
replaces them with a gup_flags parameter to make the use of FOLL_FORCE explicit
in callers as use of this flag can result in surprising behaviour (and hence
bugs) within the mm subsystem.
Signed-off-by: Lorenzo Stoakes
This patch removes the write and force parameters from get_user_pages_locked()
and replaces them with a gup_flags parameter to make the use of FOLL_FORCE
explicit in callers as use of this flag can result in surprising behaviour (and
hence bugs) within the mm subsystem.
Signed-off-by: Lorenzo
This patch removes the write and force parameters from get_user_pages_unlocked()
and replaces them with a gup_flags parameter to make the use of FOLL_FORCE
explicit in callers as use of this flag can result in surprising behaviour (and
hence bugs) within the mm subsystem.
Signed-off-by: Lorenzo
1 - 100 of 103 matches
Mail list logo