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

Configure Feed

Select the types of activity you want to include in your feed.

maple_tree: total is not changed for nomem_one case

If it jumps to nomem_one, the total allocated number is not changed. So
we don't need to adjust it.

For the nomem_bulk case, we know there is a valid mas->alloc. So we don't
need to do the check.

Link: https://lkml.kernel.org/r/20241015120746.15850-3-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Wei Yang and committed by
Andrew Morton
4223dd93 e852cb1d

+1 -2
+1 -2
lib/maple_tree.c
··· 1297 1297 nomem_bulk: 1298 1298 /* Clean up potential freed allocations on bulk failure */ 1299 1299 memset(slots, 0, max_req * sizeof(unsigned long)); 1300 + mas->alloc->total = allocated; 1300 1301 nomem_one: 1301 1302 mas_set_alloc_req(mas, requested); 1302 - if (mas->alloc && !(((unsigned long)mas->alloc & 0x1))) 1303 - mas->alloc->total = allocated; 1304 1303 mas_set_err(mas, -ENOMEM); 1305 1304 } 1306 1305