Re: [PATCH v5 2/5] rust: firmware: introduce `firmware::ModInfoBuilder`

2025-03-05 Thread Danilo Krummrich
On Thu, Mar 06, 2025 at 12:24:21AM +, Benno Lossin wrote: > On Thu Mar 6, 2025 at 12:57 AM CET, Danilo Krummrich wrote: > > On Wed, Mar 05, 2025 at 11:36:54PM +, Benno Lossin wrote: > >> On Wed Mar 5, 2025 at 11:38 PM CET, Danilo Krummrich wrote: > >> > On Wed, Mar 05, 2025 at 10:30:31PM +0

Re: [PATCH v5 3/5] rust: firmware: add `module_firmware!` macro

2025-03-05 Thread Danilo Krummrich
On Thu, Mar 06, 2025 at 01:27:19AM +, Benno Lossin wrote: > On Thu Mar 6, 2025 at 2:04 AM CET, Danilo Krummrich wrote: > > On Thu, Mar 06, 2025 at 12:31:14AM +, Benno Lossin wrote: > >> On Tue Mar 4, 2025 at 6:34 PM CET, Danilo Krummrich wrote: > >> > >> > +#[macro_export] > >> > +macro_rul

[RFC 00/11] THP support for zone device pages

2025-03-05 Thread Balbir Singh
This patch series adds support for THP migration of zone device pages. To do so, the patches implement support for folio zone device pages by adding support for setting up larger order pages. These patches build on the earlier posts by Ralph Campbell [1] Two new flags are added in vma_migration t

[RFC 02/11] mm/migrate_device: flags for selecting device private THP pages

2025-03-05 Thread Balbir Singh
Add flags to mark zone device migration pages. MIGRATE_VMA_SELECT_COMPOUND will be used to select THP pages during migrate_vma_setup() and MIGRATE_PFN_COMPOUND will make migrating device pages as compound pages during device pfn migration. Signed-off-by: Balbir Singh --- include/linux/migrate.h

Re: [PATCH v5 2/5] rust: firmware: introduce `firmware::ModInfoBuilder`

2025-03-05 Thread Danilo Krummrich
On Thu, Mar 06, 2025 at 01:35:52AM +, Benno Lossin wrote: > On Thu Mar 6, 2025 at 2:29 AM CET, Danilo Krummrich wrote: > > On Thu, Mar 06, 2025 at 12:24:21AM +, Benno Lossin wrote: > >> On Thu Mar 6, 2025 at 12:57 AM CET, Danilo Krummrich wrote: > >> > On Wed, Mar 05, 2025 at 11:36:54PM +00

[RFC 06/11] lib/test_hmm: test cases and support for zone device private THP

2025-03-05 Thread Balbir Singh
Enhance the hmm test driver (lib/test_hmm) with support for THP pages. A new pool of free_folios() has now been added to the dmirror device, which can be allocated when a request for a THP zone device private page is made. Add compound page awareness to the allocation function during normal migra

[RFC 07/11] mm/memremap: Add folio_split support

2025-03-05 Thread Balbir Singh
When a zone device page is split (via huge pmd folio split). The driver callback for folio_split is invoked to let the device driver know that the folio size has been split into a smaller order. The HMM test driver has been updated to handle the split, since the test driver uses backing pages, it

[RFC 08/11] mm/thp: add split during migration support

2025-03-05 Thread Balbir Singh
Support splitting pages during THP zone device migration as needed. The common case that arises is that after setup, during migrate the destination might not be able to allocate MIGRATE_PFN_COMPOUND pages. Add a new routine migrate_vma_split_pages() to support the splitting of already isolated pag

[RFC 05/11] mm/memory/fault: Add support for zone device THP fault handling

2025-03-05 Thread Balbir Singh
When the CPU touches a zone device THP entry, the data needs to be migrated back to the CPU, call migrate_to_ram() on these pages via do_huge_pmd_device_private() fault handling helper. Signed-off-by: Balbir Singh --- include/linux/huge_mm.h | 7 +++ mm/huge_memory.c| 35 +++

[RFC 04/11] mm/migrate_device: THP migration of zone device pages

2025-03-05 Thread Balbir Singh
migrate_device code paths go through the collect, setup and finalize phases of migration. Support for MIGRATE_PFN_COMPOUND was added earlier in the series to mark THP pages as MIGRATE_PFN_COMPOUND. The entries in src and dst arrays passed to these functions still remain at a PAGE_SIZE granularity.

[RFC 11/11] gpu/drm/nouveau: Add THP migration support

2025-03-05 Thread Balbir Singh
Change the code to add support for MIGRATE_VMA_SELECT_COMPOUND and appropriately handling page sizes in the migrate/evict code paths. Signed-off-by: Balbir Singh --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 244 + drivers/gpu/drm/nouveau/nouveau_svm.c | 6 +- drivers/g

[RFC 09/11] lib/test_hmm: add test case for split pages

2025-03-05 Thread Balbir Singh
Add a new flag HMM_DMIRROR_FLAG_FAIL_ALLOC to emulate failure of allocating a large page. This tests the code paths involving split migration. Signed-off-by: Balbir Singh --- lib/test_hmm.c | 12 +++- lib/test_hmm_uapi.h | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) di

[RFC 10/11] selftests/mm/hmm-tests: new tests for zone device THP migration

2025-03-05 Thread Balbir Singh
Add new tests for migrating anon THP pages, including anon_huge, anon_huge_zero and error cases involving forced splitting of pages during migration. Signed-off-by: Balbir Singh --- tools/testing/selftests/mm/hmm-tests.c | 407 + 1 file changed, 407 insertions(+) diff --

[RFC 01/11] mm/zone_device: support large zone device private folios

2025-03-05 Thread Balbir Singh
Add routines to support allocation of large order zone device folios and helper functions for zone device folios, to check if a folio is device private and helpers for setting zone device data. When large folios are used, the existing page_free() callback in pgmap is called when the folio is freed

Re: [PATCH v5 3/5] rust: firmware: add `module_firmware!` macro

2025-03-05 Thread Danilo Krummrich
On Thu, Mar 06, 2025 at 12:31:14AM +, Benno Lossin wrote: > On Tue Mar 4, 2025 at 6:34 PM CET, Danilo Krummrich wrote: > > > +#[macro_export] > > +macro_rules! module_firmware { > > +($($builder:tt)*) => { > > This should probably be `$builder:expr` instead. That doesn't work, the compil

Re: [RFC PATCH 0/3] gpu: nova-core: add basic timer subdevice implementation

2025-03-05 Thread Jason Gunthorpe
On Wed, Mar 05, 2025 at 08:30:34AM +0100, Simona Vetter wrote: > - developers who want to quickly test new driver versions without full > reboot. They're often preferring convenience over correctness, like with > the removal of module refcounting that's strictly needed but means they > first

Re: [PATCH v5 0/5] Initial Nova Core series

2025-03-05 Thread Danilo Krummrich
On Tue, Mar 04, 2025 at 06:34:47PM +0100, Danilo Krummrich wrote: > Danilo Krummrich (5): > rust: module: add type `LocalModule` > rust: firmware: introduce `firmware::ModInfoBuilder` > rust: firmware: add `module_firmware!` macro Greg, Luis, Russ, any objections on me taking the two firmwar

Re: [PATCH v5 2/5] rust: firmware: introduce `firmware::ModInfoBuilder`

2025-03-05 Thread Danilo Krummrich
On Wed, Mar 05, 2025 at 10:30:31PM +, Benno Lossin wrote: > On Tue Mar 4, 2025 at 6:34 PM CET, Danilo Krummrich wrote: > > The `firmware` field of the `module!` only accepts literal strings, > > which is due to the fact that it is implemented as a proc macro. > > > > Some drivers require a lot

Re: [PATCH v5 0/5] Initial Nova Core series

2025-03-05 Thread Luis Chamberlain
On Wed, Mar 05, 2025 at 08:56:42PM +0100, Danilo Krummrich wrote: > On Tue, Mar 04, 2025 at 06:34:47PM +0100, Danilo Krummrich wrote: > > Danilo Krummrich (5): > > rust: module: add type `LocalModule` > > rust: firmware: introduce `firmware::ModInfoBuilder` > > rust: firmware: add `module_fir

Re: [PATCH v5 0/5] Initial Nova Core series

2025-03-05 Thread Danilo Krummrich
On Wed, Mar 05, 2025 at 03:27:13PM -0800, Luis Chamberlain wrote: > On Wed, Mar 05, 2025 at 08:56:42PM +0100, Danilo Krummrich wrote: > > On Tue, Mar 04, 2025 at 06:34:47PM +0100, Danilo Krummrich wrote: > > > Danilo Krummrich (5): > > > rust: module: add type `LocalModule` > > > rust: firmware

Re: [PATCH v5 2/5] rust: firmware: introduce `firmware::ModInfoBuilder`

2025-03-05 Thread Danilo Krummrich
On Wed, Mar 05, 2025 at 11:36:54PM +, Benno Lossin wrote: > On Wed Mar 5, 2025 at 11:38 PM CET, Danilo Krummrich wrote: > > On Wed, Mar 05, 2025 at 10:30:31PM +, Benno Lossin wrote: > >> On Tue Mar 4, 2025 at 6:34 PM CET, Danilo Krummrich wrote: > >> > +/// Push an additional path compo

Re: [PATCH v5 0/5] Initial Nova Core series

2025-03-05 Thread Luis Chamberlain
On Thu, Mar 06, 2025 at 12:40:44AM +0100, Danilo Krummrich wrote: > On Wed, Mar 05, 2025 at 03:27:13PM -0800, Luis Chamberlain wrote: > > On Wed, Mar 05, 2025 at 08:56:42PM +0100, Danilo Krummrich wrote: > > > On Tue, Mar 04, 2025 at 06:34:47PM +0100, Danilo Krummrich wrote: > > > > Danilo Krummric