Re: [Nouveau] [PATCH v5 1/8] mm: Remove special swap entry functions

2021-03-09 Thread kernel test robot
Hi Alistair, Thank you for the patch! Yet something to improve: [auto build test ERROR on s390/features] [also build test ERROR on kselftest/next linus/master v5.12-rc2 next-20210309] [cannot apply to hnaz-linux-mm/master] [If your patch is applied to the wrong git tree, kindly drop us a note

[Nouveau] [PATCH v5 8/8] nouveau/svm: Implement atomic SVM access

2021-03-09 Thread Alistair Popple
Some NVIDIA GPUs do not support direct atomic access to system memory via PCIe. Instead this must be emulated by granting the GPU exclusive access to the memory. This is achieved by replacing CPU page table entries with special swap entries that fault on userspace access. The driver then grants

[Nouveau] [PATCH v5 7/8] nouveau/svm: Refactor nouveau_range_fault

2021-03-09 Thread Alistair Popple
Call mmu_interval_notifier_insert() as part of nouveau_range_fault(). This doesn't introduce any functional change but makes it easier for a subsequent patch to alter the behaviour of nouveau_range_fault() to support GPU atomic operations. Signed-off-by: Alistair Popple ---

Re: [Nouveau] [PATCH v5 1/8] mm: Remove special swap entry functions

2021-03-09 Thread Matthew Wilcox
On Tue, Mar 09, 2021 at 11:14:58PM +1100, Alistair Popple wrote: > -static inline struct page *migration_entry_to_page(swp_entry_t entry) > -{ > - struct page *p = pfn_to_page(swp_offset(entry)); > - /* > - * Any use of migration entries may only occur while the > - *

[Nouveau] [PATCH v5 6/8] mm: Selftests for exclusive device memory

2021-03-09 Thread Alistair Popple
Adds some selftests for exclusive device memory. Signed-off-by: Alistair Popple Acked-by: Jason Gunthorpe Tested-by: Ralph Campbell Reviewed-by: Ralph Campbell --- lib/test_hmm.c | 126 +- lib/test_hmm_uapi.h| 2 +

[Nouveau] [PATCH v5 5/8] mm: Device exclusive memory access

2021-03-09 Thread Alistair Popple
Some devices require exclusive write access to shared virtual memory (SVM) ranges to perform atomic operations on that memory. This requires CPU page tables to be updated to deny access whilst atomic operations are occurring. In order to do this introduce a new swap entry type

[Nouveau] [PATCH v5 4/8] mm/rmap: Split migration into its own function

2021-03-09 Thread Alistair Popple
Migration is currently implemented as a mode of operation for try_to_unmap_one() generally specified by passing the TTU_MIGRATION flag or in the case of splitting a huge anonymous page TTU_SPLIT_FREEZE. However it does not have much in common with the rest of the unmap functionality of

[Nouveau] [PATCH v5 3/8] mm/rmap: Split try_to_munlock from try_to_unmap

2021-03-09 Thread Alistair Popple
The behaviour of try_to_unmap_one() is difficult to follow because it performs different operations based on a fairly large set of flags used in different combinations. TTU_MUNLOCK is one such flag. However it is exclusively used by try_to_munlock() which specifies no other flags. Therefore

[Nouveau] [PATCH v5 2/8] mm/swapops: Rework swap entry manipulation code

2021-03-09 Thread Alistair Popple
Both migration and device private pages use special swap entries that are manipluated by a range of inline functions. The arguments to these are somewhat inconsitent so rework them to remove flag type arguments and to make the arguments similar for both read and write entry creation.

[Nouveau] [PATCH v5 1/8] mm: Remove special swap entry functions

2021-03-09 Thread Alistair Popple
Remove the migration and device private entry_to_page() and entry_to_pfn() inline functions and instead open code them directly. This results in shorter code which is easier to understand. Signed-off-by: Alistair Popple Reviewed-by: Ralph Campbell --- v4: * Added pfn_swap_entry_to_page() *

[Nouveau] [PATCH v5 0/8] Add support for SVM atomics in Nouveau

2021-03-09 Thread Alistair Popple
This is the fifth version of a series to add support to Nouveau for atomic memory operations on OpenCL shared virtual memory (SVM) regions. The main changes since v4 are a rebase onto v5.12-rc2, the removal of check_device_exclusive_range() and the addition of MMU_NOTIFY_EXCLUSIVE which makes the