The patch titled Subject: mm-document-memalloc_noreclaim_save-and-memalloc_pin_save-v2 has been added to the -mm mm-unstable branch. Its filename is mm-document-memalloc_noreclaim_save-and-memalloc_pin_save-v2.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-document-memalloc_noreclaim_save-and-memalloc_pin_save-v2.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Vlastimil Babka <vbabka@xxxxxxx> Subject: mm-document-memalloc_noreclaim_save-and-memalloc_pin_save-v2 Date: Thu, 15 Feb 2024 10:58:28 +0100 fix issues that Mike pointed out Link: https://lkml.kernel.org/r/20240215095827.13756-2-vbabka@xxxxxxx Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Reviewed-by: Mike Rapoport (IBM) <rppt@xxxxxxxxxx> Cc: Kent Overstreet <kent.overstreet@xxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/sched/mm.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) --- a/include/linux/sched/mm.h~mm-document-memalloc_noreclaim_save-and-memalloc_pin_save-v2 +++ a/include/linux/sched/mm.h @@ -315,7 +315,8 @@ static inline void might_alloc(gfp_t gfp * point of view. Use memalloc_noio_restore to end the scope with flags * returned by this function. * - * This function is safe to be used from any context. + * Context: This function is safe to be used from any context. + * Return: The saved flags to be passed to memalloc_noio_restore. */ static inline unsigned int memalloc_noio_save(void) { @@ -346,7 +347,8 @@ static inline void memalloc_noio_restore * point of view. Use memalloc_nofs_restore to end the scope with flags * returned by this function. * - * This function is safe to be used from any context. + * Context: This function is safe to be used from any context. + * Return: The saved flags to be passed to memalloc_nofs_restore. */ static inline unsigned int memalloc_nofs_save(void) { @@ -371,7 +373,7 @@ static inline void memalloc_nofs_restore /** * memalloc_noreclaim_save - Marks implicit __GFP_MEMALLOC scope. * - * This functions marks the beginning of the __GFP_MEMALLOC allocation scope. + * This function marks the beginning of the __GFP_MEMALLOC allocation scope. * All further allocations will implicitly add the __GFP_MEMALLOC flag, which * prevents entering reclaim and allows access to all memory reserves. This * should only be used when the caller guarantees the allocation will allow more @@ -386,8 +388,10 @@ static inline void memalloc_nofs_restore * * Individual allocations under the scope can opt out using __GFP_NOMEMALLOC * - * This function should not be used in an interrupt context as that one does not - * give PF_MEMALLOC access to reserves, see __gfp_pfmemalloc_flags(). + * Context: This function should not be used in an interrupt context as that one + * does not give PF_MEMALLOC access to reserves. + * See __gfp_pfmemalloc_flags(). + * Return: The saved flags to be passed to memalloc_noreclaim_restore. */ static inline unsigned int memalloc_noreclaim_save(void) { @@ -412,10 +416,12 @@ static inline void memalloc_noreclaim_re /** * memalloc_pin_save - Marks implicit ~__GFP_MOVABLE scope. * - * This functions marks the beginning of the ~__GFP_MOVABLE allocation scope. + * This function marks the beginning of the ~__GFP_MOVABLE allocation scope. * All further allocations will implicitly remove the __GFP_MOVABLE flag, which * will constraint the allocations to zones that allow long term pinning, i.e. * not ZONE_MOVABLE zones. + * + * Return: The saved flags to be passed to memalloc_pin_restore. */ static inline unsigned int memalloc_pin_save(void) { _ Patches currently in -mm which might be from vbabka@xxxxxxx are mm-document-memalloc_noreclaim_save-and-memalloc_pin_save.patch mm-document-memalloc_noreclaim_save-and-memalloc_pin_save-v2.patch