From: Srikar Dronamraju <srikar@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
linux-kernel@vger.kernel.org,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Srikar Dronamraju <srikar@linux.ibm.com>
Subject: [PATCH 1/2] pseries/dtl: Use counter in !native case too
Date: Wed, 12 Nov 2025 16:40:50 +0530 [thread overview]
Message-ID: <20251112111051.826922-1-srikar@linux.ibm.com> (raw)
Currently dtl_count is only under CONFIG_VIRT_CPU_ACCOUNTING_NATIVE.
Its used to track and clear dtl_consumer callback.
Going forward will be using this counter to track if dtl is in-use across
configs. Hence adding its use in !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE case
too.
Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
---
arch/powerpc/platforms/pseries/dtl.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
index f293588b8c7b..6c95781cafb7 100644
--- a/arch/powerpc/platforms/pseries/dtl.c
+++ b/arch/powerpc/platforms/pseries/dtl.c
@@ -36,6 +36,8 @@ static u8 dtl_event_mask = DTL_LOG_ALL;
* not cross a 4k boundary.
*/
static int dtl_buf_entries = N_DISPATCH_LOG;
+static atomic_t dtl_count;
+
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
@@ -56,8 +58,6 @@ struct dtl_ring {
static DEFINE_PER_CPU(struct dtl_ring, dtl_rings);
-static atomic_t dtl_count;
-
/*
* The cpu accounting code controls the DTL ring buffer, and we get
* given entries as they are processed.
@@ -158,7 +158,7 @@ static int dtl_start(struct dtl *dtl)
/* enable event logging */
lppaca_of(dtl->cpu).dtl_enable_mask = dtl_event_mask;
-
+ atomic_inc(&dtl_count);
return 0;
}
@@ -169,6 +169,7 @@ static void dtl_stop(struct dtl *dtl)
lppaca_of(dtl->cpu).dtl_enable_mask = 0x0;
unregister_dtl(hwcpu);
+ atomic_dec(&dtl_count);
}
static u64 dtl_current_index(struct dtl *dtl)
--
2.43.7
next reply other threads:[~2025-11-12 11:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 11:10 Srikar Dronamraju [this message]
2025-11-12 11:10 ` [PATCH 2/2] pseries/dtl: Remove locks held warning Srikar Dronamraju
2025-11-13 16:37 ` kernel test robot
2026-03-31 6:11 ` [PATCH 1/2] pseries/dtl: Use counter in !native case too Srikar Dronamraju
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=20251112111051.826922-1-srikar@linux.ibm.com \
--to=srikar@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
/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®