From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org
Cc: paulmck@kernel.org, mhocko@suse.com, peterz@infradead.org,
Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 2/4] kernel/smp: prepare more CSD lock debugging
Date: Tue, 2 Mar 2021 07:28:36 +0100 [thread overview]
Message-ID: <20210302062838.14267-3-jgross@suse.com> (raw)
In-Reply-To: <20210302062838.14267-1-jgross@suse.com>
In order to be able to easily add more CSD lock debugging data to
struct call_function_data->csd move the call_single_data_t element
into a sub-structure.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
kernel/smp.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/kernel/smp.c b/kernel/smp.c
index d5f0b21ab55e..6d7e6dbe33dc 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -31,8 +31,12 @@
#define CSD_TYPE(_csd) ((_csd)->node.u_flags & CSD_FLAG_TYPE_MASK)
+struct cfd_percpu {
+ call_single_data_t csd;
+};
+
struct call_function_data {
- call_single_data_t __percpu *csd;
+ struct cfd_percpu __percpu *pcpu;
cpumask_var_t cpumask;
cpumask_var_t cpumask_ipi;
};
@@ -55,8 +59,8 @@ int smpcfd_prepare_cpu(unsigned int cpu)
free_cpumask_var(cfd->cpumask);
return -ENOMEM;
}
- cfd->csd = alloc_percpu(call_single_data_t);
- if (!cfd->csd) {
+ cfd->pcpu = alloc_percpu(struct cfd_percpu);
+ if (!cfd->pcpu) {
free_cpumask_var(cfd->cpumask);
free_cpumask_var(cfd->cpumask_ipi);
return -ENOMEM;
@@ -71,7 +75,7 @@ int smpcfd_dead_cpu(unsigned int cpu)
free_cpumask_var(cfd->cpumask);
free_cpumask_var(cfd->cpumask_ipi);
- free_percpu(cfd->csd);
+ free_percpu(cfd->pcpu);
return 0;
}
@@ -694,7 +698,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
cpumask_clear(cfd->cpumask_ipi);
for_each_cpu(cpu, cfd->cpumask) {
- call_single_data_t *csd = per_cpu_ptr(cfd->csd, cpu);
+ call_single_data_t *csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd;
if (cond_func && !cond_func(cpu, info))
continue;
@@ -719,7 +723,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
for_each_cpu(cpu, cfd->cpumask) {
call_single_data_t *csd;
- csd = per_cpu_ptr(cfd->csd, cpu);
+ csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd;
csd_lock_wait(csd);
}
}
--
2.26.2
next prev parent reply other threads:[~2021-03-02 8:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 6:28 [PATCH v3 0/4] kernel/smp.c: add more CSD lock debugging Juergen Gross
2021-03-02 6:28 ` [PATCH v3 1/4] kernel/smp: add boot parameter for controlling " Juergen Gross
2021-03-02 6:28 ` Juergen Gross [this message]
2021-03-02 6:28 ` [PATCH v3 3/4] kernel/smp: add more data to " Juergen Gross
2021-03-24 10:18 ` Jürgen Groß
2021-03-30 17:33 ` Paul E. McKenney
2021-04-02 15:46 ` Juergen Gross
2021-04-02 16:11 ` Paul E. McKenney
2021-04-05 7:37 ` Juergen Gross
2021-04-05 15:29 ` Paul E. McKenney
2021-03-02 6:28 ` [PATCH v3 4/4] kernel/smp: fix flush_smp_call_function_queue() cpu offline detection Juergen Gross
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=20210302062838.14267-3-jgross@suse.com \
--to=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.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