Re: [PATCH 2/3] mm: update core kernel code to use vm_flags_t consistently

2025-08-01 Thread Lorenzo Stoakes
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

Re: [PATCH 2/3] mm: update core kernel code to use vm_flags_t consistently

2025-07-28 Thread Lorenzo Stoakes
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

Re: [PATCH v1 23/29] mm/page-alloc: remove PageMappingFlags()

2025-07-02 Thread Lorenzo Stoakes
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

Re: [PATCH v1 22/29] mm/page-flags: rename PAGE_MAPPING_MOVABLE to PAGE_MAPPING_ANON_KSM

2025-07-02 Thread Lorenzo Stoakes
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

Re: [PATCH v1 23/29] mm/page-alloc: remove PageMappingFlags()

2025-07-02 Thread Lorenzo Stoakes
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

Re: [PATCH v1 26/29] mm: rename PAGE_MAPPING_* to FOLIO_MAPPING_*

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 29/29] mm/balloon_compaction: provide single balloon_page_insert() and balloon_mapping_gfp_mask()

2025-07-01 Thread Lorenzo Stoakes
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 >

Re: [PATCH v1 28/29] mm/balloon_compaction: "movable_ops" doc updates

2025-07-01 Thread 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

Re: [PATCH v1 27/29] docs/mm: convert from "Non-LRU page migration" to "movable_ops page migration"

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 25/29] mm: simplify folio_expected_ref_count()

2025-07-01 Thread Lorenzo Stoakes
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-

Re: [PATCH v1 23/29] mm/page-alloc: remove PageMappingFlags()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 24/29] mm/page-flags: remove folio_mapping_flags()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 22/29] mm/page-flags: rename PAGE_MAPPING_MOVABLE to PAGE_MAPPING_ANON_KSM

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 21/29] mm: rename PG_isolated to PG_movable_ops_isolated

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 20/29] mm: convert "movable" flag in page->mapping to a page flag

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 19/29] mm: stop storing migration_ops in page->mapping

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 18/29] mm: remove __folio_test_movable()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 13/29] mm/balloon_compaction: stop using __ClearPageMovable()

2025-07-01 Thread Lorenzo Stoakes
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 > > >

Re: [PATCH v1 10/29] mm/migrate: remove folio_test_movable() and folio_movable_ops()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 17/29] mm/page_isolation: drop __folio_test_movable() check for large folios

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 16/29] mm: rename __PageMovable() to page_has_movable_ops()

2025-07-01 Thread Lorenzo Stoakes
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()

Re: [PATCH v1 15/29] mm/migration: remove PageMovable()

2025-07-01 Thread Lorenzo Stoakes
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(-) >

Re: [PATCH v1 14/29] mm/migrate: remove __ClearPageMovable()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 12/29] mm/zsmalloc: stop using __ClearPageMovable()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 13/29] mm/balloon_compaction: stop using __ClearPageMovable()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 11/29] mm/migrate: move movable_ops page handling out of move_to_new_folio()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 07/29] mm/migrate: rename isolate_movable_page() to isolate_movable_ops_page()

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 04/29] mm/page_alloc: let page freeing clear any set page type

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 02/29] mm/balloon_compaction: convert balloon_page_delete() to balloon_page_finalize()

2025-07-01 Thread Lorenzo Stoakes
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 >

Re: [PATCH v1 03/29] mm/zsmalloc: drop PageIsolated() related VM_BUG_ONs

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 04/29] mm/page_alloc: let page freeing clear any set page type

2025-07-01 Thread Lorenzo Stoakes
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

Re: [PATCH v1 10/29] mm/migrate: remove folio_test_movable() and folio_movable_ops()

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 09/29] mm/migrate: factor out movable_ops page handling into migrate_movable_ops_page()

2025-06-30 Thread Lorenzo Stoakes
> > 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

Re: [PATCH v1 08/29] mm/migrate: rename putback_movable_folio() to putback_movable_ops_page()

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 07/29] mm/migrate: rename isolate_movable_page() to isolate_movable_ops_page()

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 05/29] mm/balloon_compaction: make PageOffline sticky until the page is freed

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 06/29] mm/zsmalloc: make PageZsmalloc() sticky until the page is freed

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 05/29] mm/balloon_compaction: make PageOffline sticky until the page is freed

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 04/29] mm/page_alloc: let page freeing clear any set page type

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 03/29] mm/zsmalloc: drop PageIsolated() related VM_BUG_ONs

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 02/29] mm/balloon_compaction: convert balloon_page_delete() to balloon_page_finalize()

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH v1 01/29] mm/balloon_compaction: we cannot have isolated pages in the balloon list

2025-06-30 Thread Lorenzo Stoakes
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

Re: [PATCH 0/3] use vm_flags_t consistently

2025-06-25 Thread Lorenzo Stoakes
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

Re: [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument

2025-06-19 Thread Lorenzo Stoakes
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 ---

Re: [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument

2025-06-19 Thread 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

Re: [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument

2025-06-19 Thread Lorenzo Stoakes
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

Re: [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument

2025-06-19 Thread Lorenzo Stoakes
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

[PATCH 2/3] mm: update core kernel code to use vm_flags_t consistently

2025-06-18 Thread Lorenzo Stoakes
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

[PATCH 3/3] mm: update architecture and driver code to use vm_flags_t

2025-06-18 Thread Lorenzo Stoakes
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

[PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument

2025-06-18 Thread Lorenzo Stoakes
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

[PATCH 0/3] use vm_flags_t consistently

2025-06-18 Thread Lorenzo Stoakes
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

Re: [PATCH 03/12] mm/pagewalk: Skip dax pages in pagewalk

2025-06-12 Thread Lorenzo Stoakes
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

Re: [RFC PATCH v1 0/6] Lazy mmu mode fixes and improvements

2025-05-30 Thread Lorenzo Stoakes
+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

Re: [PATCH] xarray: port tests to kunit

2025-01-30 Thread Lorenzo Stoakes
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

Re: [PATCH] xarray: port tests to kunit

2025-01-30 Thread Lorenzo Stoakes
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

Re: [PATCH mm-unstable v2 00/16] mm: Introduce arch_mmap_hint()

2024-12-13 Thread Lorenzo Stoakes
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

Re: [PATCH mm-unstable v2 00/16] mm: Introduce arch_mmap_hint()

2024-12-13 Thread Lorenzo Stoakes
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'

Re: [PATCH mm-unstable v2 00/16] mm: Introduce arch_mmap_hint()

2024-12-12 Thread Lorenzo Stoakes
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

Re: [PATCH 5/5] [RFC] mm: Remove MAP_UNINITIALIZED support

2024-10-09 Thread Lorenzo Stoakes
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.

Re: [PATCH 4/5] asm-generic: use asm-generic/mman-common.h on parisc and alpha

2024-10-09 Thread Lorenzo Stoakes
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

Re: [PATCH 2/5] asm-generic: move MAP_* flags from mman-common.h to mman.h

2024-10-09 Thread Lorenzo Stoakes
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

Re: [PATCH 1/5] asm-generic: cosmetic updates to uapi/asm/mman.h

2024-10-09 Thread Lorenzo Stoakes
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

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-13 Thread Lorenzo Stoakes
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

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Lorenzo Stoakes
(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

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Lorenzo Stoakes
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

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Lorenzo Stoakes
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

Re: [PATCH 3/3] mm: Care about shadow stack guard gap when getting an unmapped area

2024-09-03 Thread Lorenzo Stoakes
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 > &

Re: [PATCH 3/3] mm: Care about shadow stack guard gap when getting an unmapped area

2024-09-03 Thread Lorenzo Stoakes
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

Re: [PATCH 2/3] mm: Pass vm_flags to generic_get_unmapped_area()

2024-09-03 Thread Lorenzo Stoakes
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

Re: [PATCH 1/3] mm: Make arch_get_unmapped_area() take vm_flags by default

2024-09-03 Thread Lorenzo Stoakes
_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.

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-08-30 Thread Lorenzo Stoakes
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

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-08-30 Thread Lorenzo Stoakes
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

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-08-29 Thread Lorenzo Stoakes
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 >

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-08-29 Thread Lorenzo Stoakes
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

Re: [PATCH RFC v2 2/4] mm: Add hint and mmap_flags to struct vm_unmapped_area_info

2024-08-29 Thread Lorenzo Stoakes
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

Re: [PATCH 16/16] selftests/mm: Create MAP_BELOW_HINT test

2024-08-28 Thread Lorenzo Stoakes
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

Re: [PATCH 00/16] mm: Introduce MAP_BELOW_HINT

2024-08-28 Thread Lorenzo Stoakes
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

Re: [PATCH v5 17/21] mm/mmap: Relocate arch_unmap() to vms_complete_munmap_vmas()

2024-07-22 Thread Lorenzo Stoakes
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

Re: [PATCH v3 16/16] mm/mmap: Move may_expand_vm() check in mmap_region()

2024-07-10 Thread 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()

Re: [powerpc] Kernel crash while running LTP (bisected)

2023-10-17 Thread Lorenzo Stoakes
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

Re: [PATCH v2 1/2] mm: hugetlb: Add huge page size param to set_huge_pte_at()

2023-09-29 Thread Lorenzo Stoakes
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)

[PATCH v6 5/6] mm/gup: remove vmas parameter from pin_user_pages()

2023-05-17 Thread Lorenzo Stoakes
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

[PATCH v5 5/6] mm/gup: remove vmas parameter from pin_user_pages()

2023-05-14 Thread Lorenzo Stoakes
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

[PATCH v4 5/6] mm/gup: remove vmas parameter from pin_user_pages()

2023-04-18 Thread Lorenzo Stoakes
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

[PATCH v3 6/7] mm/gup: remove vmas parameter from pin_user_pages()

2023-04-15 Thread Lorenzo Stoakes
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

[PATCH v2 6/7] mm/gup: remove vmas parameter from pin_user_pages()

2023-04-15 Thread Lorenzo Stoakes
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

[PATCH 6/7] mm/gup: remove vmas parameter from pin_user_pages()

2023-04-14 Thread Lorenzo Stoakes
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

Re: [linux-next:master] BUILD REGRESSION 7c4a254d78f89546d0e74a40617ef24c6151c8d1

2023-03-23 Thread Lorenzo Stoakes
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

Re: [PATCH 08/10] mm: replace __access_remote_vm() write parameter with gup_flags

2016-10-19 Thread Lorenzo Stoakes
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

Re: [PATCH 00/10] mm: adjust get_user_pages* functions to explicitly pass FOLL_* flags

2016-10-19 Thread Lorenzo Stoakes
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

Re: [PATCH 08/10] mm: replace __access_remote_vm() write parameter with gup_flags

2016-10-19 Thread Lorenzo Stoakes
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 > > >

Re: [PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags

2016-10-18 Thread Lorenzo Stoakes
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

[PATCH 10/10] mm: replace access_process_vm() write parameter with gup_flags

2016-10-12 Thread Lorenzo Stoakes
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

[PATCH 09/10] mm: replace access_remote_vm() write parameter with gup_flags

2016-10-12 Thread Lorenzo Stoakes
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

[PATCH 08/10] mm: replace __access_remote_vm() write parameter with gup_flags

2016-10-12 Thread Lorenzo Stoakes
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

[PATCH 07/10] mm: replace get_user_pages_remote() write/force parameters with gup_flags

2016-10-12 Thread Lorenzo Stoakes
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

[PATCH 06/10] mm: replace get_user_pages() write/force parameters with gup_flags

2016-10-12 Thread Lorenzo Stoakes
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

[PATCH 05/10] mm: replace get_vaddr_frames() write/force parameters with gup_flags

2016-10-12 Thread 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

[PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags

2016-10-12 Thread 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

[PATCH 03/10] mm: replace get_user_pages_unlocked() write/force parameters with gup_flags

2016-10-12 Thread Lorenzo Stoakes
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   2   >