Skip to contentSkip to conversation

core_pattern-add-cpu-specifier.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Nov 15, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: core_pattern: add CPU specifier
has been removed from the -mm tree. Its filename was
core_pattern-add-cpu-specifier.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Oleksandr Natalenko <[email protected]>
Subject: core_pattern: add CPU specifier
Date: Sat, 3 Sep 2022 08:43:30 +0200

Statistically, in a large deployment regular segfaults may indicate a CPU issue.

Currently, it is not possible to find out what CPU the segfault happened on. There are at least two attempts to improve segfault logging with this regard, but they do not help in case the logs rotate.

Hence, lets make sure it is possible to permanently record a CPU the task ran on using a new core_pattern specifier.

Cc Alexander Viro <[email protected]>
Cc "Eric W . Biederman" <[email protected]>
Cc Grzegorz Halat <[email protected]>
Cc "Guilherme G. Piccoli" <[email protected]>
Cc "Huang, Ying" <[email protected]>
Cc Jason A. Donenfeld <[email protected]>
Cc Joel Savitz <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Kees Cook <[email protected]>
Cc Laurent Dufour <[email protected]>
Cc Luis Chamberlain <[email protected]>
Cc Rob Herring <[email protected]>
Cc Stephen Kitt <[email protected]>
Cc Will Deacon <[email protected]>
Cc Xiaoming Ni <[email protected]>

---

 Documentation/admin-guide/sysctl/kernel.rst |    1 +
 fs/coredump.c                               |    5 +++++
 include/linux/coredump.h                    |    1 +
 3 files changed, 7 insertions(+)
Documentation/admin-guide/sysctl/kernel.rst renamed from Documentation/admin-guide/sysctl/kernel.rst~core_pattern-add-cpu-specifier +1 -0
@@ -174,6 +174,7 @@ core_pattern
 	%f      	executable filename
 	%E		executable path
 	%c		maximum size of core file by resource limit RLIMIT_CORE
+	%C		CPU the task ran on
 	%<OTHER>	both are dropped
 	========	==========================================
 
fs/coredump.c renamed from fs/coredump.c~core_pattern-add-cpu-specifier +5 -0
@@ -325,6 +325,10 @@ static int format_corename(struct core_n
 				err = cn_printf(cn, "%lu",
 					      rlimit(RLIMIT_CORE));
 				break;
+			/* CPU the task ran on */
+			case 'C':
+				err = cn_printf(cn, "%d", cprm->cpu);
+				break;
 			default:
 				break;
 			}
@@ -534,6 +538,7 @@ void do_coredump(const kernel_siginfo_t
 		 */
 		.mm_flags = mm->flags,
 		.vma_meta = NULL,
+		.cpu = raw_smp_processor_id(),
 	};
 
 	audit_core_dumps(siginfo->si_signo);
include/linux/coredump.h renamed from include/linux/coredump.h~core_pattern-add-cpu-specifier +1 -0
@@ -22,6 +22,7 @@ struct coredump_params {
 	struct file *file;
 	unsigned long limit;
 	unsigned long mm_flags;
+	int cpu;
 	loff_t written;
 	loff_t pos;
 	loff_t to_skip;

_

Patches currently in -mm which might be from [email protected] are