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.

Merge tag 'mm-stable-2022-12-17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull more mm updates from Andrew Morton:

- A few late-breaking minor fixups

- Two minor feature patches which were awkwardly dependent on mm-nonmm.
I need to set up a new branch to handle such things.

* tag 'mm-stable-2022-12-17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
MAINTAINERS: zram: zsmalloc: Add an additional co-maintainer
mm/kmemleak: use %pK to display kernel pointers in backtrace
mm: use stack_depot for recording kmemleak's backtrace
maple_tree: update copyright dates for test code
maple_tree: fix mas_find_rev() comment
mm/gup_test: free memory allocated via kvcalloc() using kvfree()

+42 -28
+4
CREDITS
··· 1439 1439 E: jguyett@andrew.cmu.edu 1440 1440 D: via-rhine net driver hacking 1441 1441 1442 + N: Nitin Gupta 1443 + E: ngupta@vflare.org 1444 + D: zsmalloc memory allocator and zram block device driver 1445 + 1442 1446 N: Danny ter Haar 1443 1447 E: dth@cistron.nl 1444 1448 D: /proc/cpuinfo, reboot on panic , kernel pre-patch tester ;)
+2 -4
MAINTAINERS
··· 23055 23055 23056 23056 ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER 23057 23057 M: Minchan Kim <minchan@kernel.org> 23058 - M: Nitin Gupta <ngupta@vflare.org> 23059 - R: Sergey Senozhatsky <senozhatsky@chromium.org> 23058 + M: Sergey Senozhatsky <senozhatsky@chromium.org> 23060 23059 L: linux-kernel@vger.kernel.org 23061 23060 S: Maintained 23062 23061 F: Documentation/admin-guide/blockdev/zram.rst ··· 23068 23069 23069 23070 ZSMALLOC COMPRESSED SLAB MEMORY ALLOCATOR 23070 23071 M: Minchan Kim <minchan@kernel.org> 23071 - M: Nitin Gupta <ngupta@vflare.org> 23072 - R: Sergey Senozhatsky <senozhatsky@chromium.org> 23072 + M: Sergey Senozhatsky <senozhatsky@chromium.org> 23073 23073 L: linux-mm@kvack.org 23074 23074 S: Maintained 23075 23075 F: Documentation/mm/zsmalloc.rst
+1
lib/Kconfig.debug
··· 728 728 select STACKTRACE if STACKTRACE_SUPPORT 729 729 select KALLSYMS 730 730 select CRC32 731 + select STACKDEPOT 731 732 help 732 733 Say Y here if you want to enable the memory leak 733 734 detector. The memory allocation/freeing is traced in a way
+1 -1
lib/maple_tree.c
··· 6062 6062 if (mas->index < min) 6063 6063 return NULL; 6064 6064 6065 - /* Retries on dead nodes handled by mas_next_entry */ 6065 + /* Retries on dead nodes handled by mas_prev_entry */ 6066 6066 return mas_prev_entry(mas, min); 6067 6067 } 6068 6068 EXPORT_SYMBOL_GPL(mas_find_rev);
+2 -2
mm/gup_test.c
··· 214 214 if (pin_longterm_test_nr_pages) 215 215 unpin_user_pages(pin_longterm_test_pages, 216 216 pin_longterm_test_nr_pages); 217 - kfree(pin_longterm_test_pages); 217 + kvfree(pin_longterm_test_pages); 218 218 pin_longterm_test_pages = NULL; 219 219 pin_longterm_test_nr_pages = 0; 220 220 } ··· 255 255 fast = !!(args.flags & PIN_LONGTERM_TEST_FLAG_USE_FAST); 256 256 257 257 if (!fast && mmap_read_lock_killable(current->mm)) { 258 - kfree(pages); 258 + kvfree(pages); 259 259 return -EINTR; 260 260 } 261 261
+29 -19
mm/kmemleak.c
··· 79 79 #include <linux/mutex.h> 80 80 #include <linux/rcupdate.h> 81 81 #include <linux/stacktrace.h> 82 + #include <linux/stackdepot.h> 82 83 #include <linux/cache.h> 83 84 #include <linux/percpu.h> 84 85 #include <linux/memblock.h> ··· 160 159 u32 checksum; 161 160 /* memory ranges to be scanned inside an object (empty for all) */ 162 161 struct hlist_head area_list; 163 - unsigned long trace[MAX_TRACE]; 164 - unsigned int trace_len; 162 + depot_stack_handle_t trace_handle; 165 163 unsigned long jiffies; /* creation timestamp */ 166 164 pid_t pid; /* pid of the current task */ 167 165 char comm[TASK_COMM_LEN]; /* executable name */ ··· 346 346 struct kmemleak_object *object) 347 347 { 348 348 int i; 349 + unsigned long *entries; 350 + unsigned int nr_entries; 349 351 unsigned int msecs_age = jiffies_to_msecs(jiffies - object->jiffies); 350 352 353 + nr_entries = stack_depot_fetch(object->trace_handle, &entries); 351 354 warn_or_seq_printf(seq, "unreferenced object 0x%08lx (size %zu):\n", 352 - object->pointer, object->size); 355 + object->pointer, object->size); 353 356 warn_or_seq_printf(seq, " comm \"%s\", pid %d, jiffies %lu (age %d.%03ds)\n", 354 - object->comm, object->pid, object->jiffies, 355 - msecs_age / 1000, msecs_age % 1000); 357 + object->comm, object->pid, object->jiffies, 358 + msecs_age / 1000, msecs_age % 1000); 356 359 hex_dump_object(seq, object); 357 360 warn_or_seq_printf(seq, " backtrace:\n"); 358 361 359 - for (i = 0; i < object->trace_len; i++) { 360 - void *ptr = (void *)object->trace[i]; 361 - warn_or_seq_printf(seq, " [<%p>] %pS\n", ptr, ptr); 362 + for (i = 0; i < nr_entries; i++) { 363 + void *ptr = (void *)entries[i]; 364 + warn_or_seq_printf(seq, " [<%pK>] %pS\n", ptr, ptr); 362 365 } 363 366 } 364 367 ··· 373 370 static void dump_object_info(struct kmemleak_object *object) 374 371 { 375 372 pr_notice("Object 0x%08lx (size %zu):\n", 376 - object->pointer, object->size); 373 + object->pointer, object->size); 377 374 pr_notice(" comm \"%s\", pid %d, jiffies %lu\n", 378 - object->comm, object->pid, object->jiffies); 375 + object->comm, object->pid, object->jiffies); 379 376 pr_notice(" min_count = %d\n", object->min_count); 380 377 pr_notice(" count = %d\n", object->count); 381 378 pr_notice(" flags = 0x%x\n", object->flags); 382 379 pr_notice(" checksum = %u\n", object->checksum); 383 380 pr_notice(" backtrace:\n"); 384 - stack_trace_print(object->trace, object->trace_len, 4); 381 + if (object->trace_handle) 382 + stack_depot_print(object->trace_handle); 385 383 } 386 384 387 385 /* ··· 595 591 return object; 596 592 } 597 593 598 - /* 599 - * Save stack trace to the given array of MAX_TRACE size. 600 - */ 601 - static int __save_stack_trace(unsigned long *trace) 594 + static noinline depot_stack_handle_t set_track_prepare(void) 602 595 { 603 - return stack_trace_save(trace, MAX_TRACE, 2); 596 + depot_stack_handle_t trace_handle; 597 + unsigned long entries[MAX_TRACE]; 598 + unsigned int nr_entries; 599 + 600 + if (!kmemleak_initialized) 601 + return 0; 602 + nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 3); 603 + trace_handle = stack_depot_save(entries, nr_entries, GFP_NOWAIT); 604 + 605 + return trace_handle; 604 606 } 605 607 606 608 /* ··· 663 653 } 664 654 665 655 /* kernel backtrace */ 666 - object->trace_len = __save_stack_trace(object->trace); 656 + object->trace_handle = set_track_prepare(); 667 657 668 658 raw_spin_lock_irqsave(&kmemleak_lock, flags); 669 659 ··· 702 692 rb_link_node(&object->rb_node, rb_parent, link); 703 693 rb_insert_color(&object->rb_node, is_phys ? &object_phys_tree_root : 704 694 &object_tree_root); 705 - 706 695 list_add_tail_rcu(&object->object_list, &object_list); 707 696 out: 708 697 raw_spin_unlock_irqrestore(&kmemleak_lock, flags); ··· 1100 1091 } 1101 1092 1102 1093 raw_spin_lock_irqsave(&object->lock, flags); 1103 - object->trace_len = __save_stack_trace(object->trace); 1094 + object->trace_handle = set_track_prepare(); 1104 1095 raw_spin_unlock_irqrestore(&object->lock, flags); 1105 1096 1106 1097 put_object(object); ··· 2093 2084 if (kmemleak_error) 2094 2085 return; 2095 2086 2087 + stack_depot_init(); 2096 2088 jiffies_min_age = msecs_to_jiffies(MSECS_MIN_AGE); 2097 2089 jiffies_scan_wait = msecs_to_jiffies(SECS_SCAN_WAIT * 1000); 2098 2090
+3 -2
tools/testing/radix-tree/maple.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0+ 2 2 /* 3 - * maple_tree.c: Userspace shim for maple tree test-suite 4 - * Copyright (c) 2018 Liam R. Howlett <Liam.Howlett@Oracle.com> 3 + * maple_tree.c: Userspace testing for maple tree test-suite 4 + * Copyright (c) 2018-2022 Oracle Corporation 5 + * Author: Liam R. Howlett <Liam.Howlett@Oracle.com> 5 6 * 6 7 * Any tests that require internal knowledge of the tree or threads and other 7 8 * difficult to handle in kernel tests.