mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat (Microsoft)" <srivatsa@csail.mit.edu>
To: Jonathan Corbet <corbet@lwn.net>,
	 Shuah Khan <skhan@linuxfoundation.org>,
	 Randy Dunlap <rdunlap@infradead.org>,
	Thomas Gleixner <tglx@kernel.org>,
	 Peter Zijlstra <peterz@infradead.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	 "Srivatsa S. Bhat" <srivatsa@csail.mit.edu>,
	 Prasanna Kumar T S M <ptsm@linux.microsoft.com>,
	 Saurabh Sengar <ssengar@linux.microsoft.com>
Subject: [PATCH 3/4] cpu/hotplug: Demystify the terms 'BP' and 'AP' in the code
Date: Fri, 27 Nov 2026 12:57:00 +0530	[thread overview]
Message-ID: <20261127-docs-cpuhp-v1-3-a34a2c9f66fa@csail.mit.edu> (raw)
In-Reply-To: <20261127-docs-cpuhp-v1-0-a34a2c9f66fa@csail.mit.edu>

The terms 'BP' and 'AP' appear throughout the CPU hotplug code and
documentation, but there is no mention of what these acronyms expand
to and what do they actually represent in the context of the CPU
hotplug state machine.

Provide some background in the code and the docs to demystify these
terms.

Signed-off-by: Srivatsa S. Bhat (Microsoft) <srivatsa@csail.mit.edu>
---
 Documentation/core-api/cpu_hotplug.rst | 20 ++++++++++++++++++++
 include/linux/cpuhotplug.h             |  5 +++++
 2 files changed, 25 insertions(+)

diff --git a/Documentation/core-api/cpu_hotplug.rst b/Documentation/core-api/cpu_hotplug.rst
index 4e228fc00624..fe5385a8bd8e 100644
--- a/Documentation/core-api/cpu_hotplug.rst
+++ b/Documentation/core-api/cpu_hotplug.rst
@@ -143,6 +143,26 @@ at state ``CPUHP_OFFLINE``. This includes:
 The CPU hotplug API
 ===================
 
+CPU roles in CPU hotplug operations
+-----------------------------------
+
+Any CPU hotplug operation involves at least 2 CPUs performing different roles: a
+control CPU that drives the online or offline operation, and a target CPU which
+is actually onlined or offlined as a result.
+
+The CPU which takes the role of a control CPU for a given hotplug operation is
+referred to as BP (Boot Processor), and the target CPU is referred to as AP
+(Application Processor) in the code.
+
+The terms BP and AP make the most literal sense when we consider the very first
+CPU online in the system, where the Boot Processor is already up and running the
+kernel in uniprocessor mode, and onlines the first secondary CPU (i.e.,
+Application Processor). After this step, for any subsequent CPU online or
+offline operation, any CPU can take the role of the control CPU and any CPU can
+be the target. Hence, the terms BP and AP lose their literal meaning but they
+are used as a shorthand in the code for what they represent (i.e., the control
+and the hotplugged CPUs respectively).
+
 CPU hotplug state machine
 -------------------------
 
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index f51303255bf0..52c42db50ec2 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -5,6 +5,11 @@
 #include <linux/types.h>
 
 /*
+ * CPU hotplug state machine:
+ *
+ * BP = "Boot Processor" or control CPU for the hotplug operation.
+ * AP = "Application Processor" or "hotplugged" (target) CPU.
+ *
  * CPU-up			CPU-down
  *
  * BP		AP		BP		AP

-- 
2.43.0


  parent reply	other threads:[~2026-11-27  7:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  7:26 [PATCH 0/4] cpu/hotplug: Update documentation and naming convention for hotplug callbacks Srivatsa S. Bhat (Microsoft)
2026-11-27  7:26 ` [PATCH 1/4] Documentation: core-api/cpuhotplug: Fix a few minor inconsistencies Srivatsa S. Bhat (Microsoft)
2026-11-27  7:26 ` [PATCH 2/4] cpu/hotplug: Trivial doc updates in cpuhotplug.h Srivatsa S. Bhat (Microsoft)
2026-11-27  7:27 ` Srivatsa S. Bhat (Microsoft) [this message]
2026-11-27  7:27 ` [PATCH 4/4] Documentation: core-api/cpuhotplug: Add naming convention for callbacks Srivatsa S. Bhat (Microsoft)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127-docs-cpuhp-v1-3-a34a2c9f66fa@csail.mit.edu \
    --to=srivatsa@csail.mit.edu \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=ptsm@linux.microsoft.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=ssengar@linux.microsoft.com \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®