+ panic-use-atomic_try_cmpxchg-in-panic-and-nmi_panic-v2.patch added to mm-nonmm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: panic-use-atomic_try_cmpxchg-in-panic-and-nmi_panic-v2
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     panic-use-atomic_try_cmpxchg-in-panic-and-nmi_panic-v2.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/panic-use-atomic_try_cmpxchg-in-panic-and-nmi_panic-v2.patch

This patch will later appear in the mm-nonmm-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: Uros Bizjak <ubizjak@xxxxxxxxx>
Subject: panic-use-atomic_try_cmpxchg-in-panic-and-nmi_panic-v2
Date: Wed, 6 Sep 2023 21:11:28 +0200

clean up if/else block

Link: https://lkml.kernel.org/r/20230906191200.68707-1-ubizjak@xxxxxxxxx
Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/panic.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/kernel/panic.c~panic-use-atomic_try_cmpxchg-in-panic-and-nmi_panic-v2
+++ a/kernel/panic.c
@@ -321,9 +321,9 @@ void panic(const char *fmt, ...)
 	this_cpu = raw_smp_processor_id();
 
 	/* atomic_try_cmpxchg updates old_cpu on failure */
-	if (atomic_try_cmpxchg(&panic_cpu, &old_cpu, this_cpu))
-		;
-	else if (old_cpu != this_cpu)
+	if (atomic_try_cmpxchg(&panic_cpu, &old_cpu, this_cpu)) {
+		/* go ahead */
+	} else if (old_cpu != this_cpu)
 		panic_smp_self_stop();
 
 	console_verbose();
_

Patches currently in -mm which might be from ubizjak@xxxxxxxxx are

mm-vmstat-use-this_cpu_try_cmpxchg-in-mod_zonenode_state.patch
panic-use-atomic_try_cmpxchg-in-panic-and-nmi_panic.patch
panic-use-atomic_try_cmpxchg-in-panic-and-nmi_panic-v2.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux