Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: document mmu_notifier_invalidate_range_start_nonblock()

Document what mmu_notifier_invalidate_range_start_nonblock() is for. Also
add a __must_check annotation to signal that callers must bail out if a
notifier vetoes the operation.

Link: https://lkml.kernel.org/r/20230918201832.265108-1-jannh@google.com
Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Jann Horn and committed by
Andrew Morton
7ced098f 840ea53a

+8 -1
+8 -1
include/linux/mmu_notifier.h
··· 459 459 lock_map_release(&__mmu_notifier_invalidate_range_start_map); 460 460 } 461 461 462 - static inline int 462 + /* 463 + * This version of mmu_notifier_invalidate_range_start() avoids blocking, but it 464 + * can return an error if a notifier can't proceed without blocking, in which 465 + * case you're not allowed to modify PTEs in the specified range. 466 + * 467 + * This is mainly intended for OOM handling. 468 + */ 469 + static inline int __must_check 463 470 mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range) 464 471 { 465 472 int ret = 0;