From: Leonardo Bras <leobras@redhat.com>
To: Jens Axboe <axboe@kernel.dk>,
Peter Zijlstra <peterz@infradead.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Palmer Dabbelt <palmer@rivosinc.com>,
Leonardo Bras <leobras@redhat.com>, Guo Ren <guoren@kernel.org>,
Valentin Schneider <vschneid@redhat.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
Juergen Gross <jgross@suse.com>,
Yury Norov <yury.norov@gmail.com>,
Marcelo Tosatti <mtosatti@redhat.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH v2 3/3] smp: Change signatures to use call_single_data_t
Date: Sat, 20 May 2023 02:29:58 -0300 [thread overview]
Message-ID: <20230520052957.798486-4-leobras@redhat.com> (raw)
In-Reply-To: <20230520052957.798486-1-leobras@redhat.com>
Every caller of smp_call_function_single_async() now makes use
of call_single_data_t, which is a size-aligned typedef of
struct __call_single_data.
Changing smp_call_function_single_async() csd parameter to
call_single_data_t makes possible to warn future callers if they
are using an unaligned csd, which can cause it to be split between 2
cachelines, which is usually bad for performance.
Also, for the same reason, change generic_exec_single().
Signed-off-by: Leonardo Bras <leobras@redhat.com>
---
include/linux/smp.h | 2 +-
kernel/smp.c | 4 ++--
kernel/up.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 91ea4a67f8ca..e87520dc2959 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -53,7 +53,7 @@ int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,
void *info, bool wait, const struct cpumask *mask);
-int smp_call_function_single_async(int cpu, struct __call_single_data *csd);
+int smp_call_function_single_async(int cpu, call_single_data_t *csd);
/*
* Cpus stopping functions in panic. All have default weak definitions.
diff --git a/kernel/smp.c b/kernel/smp.c
index ab3e5dad6cfe..919387be6d4e 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -361,7 +361,7 @@ void __smp_call_single_queue(int cpu, struct llist_node *node)
* for execution on the given CPU. data must already have
* ->func, ->info, and ->flags set.
*/
-static int generic_exec_single(int cpu, struct __call_single_data *csd)
+static int generic_exec_single(int cpu, call_single_data_t *csd)
{
if (cpu == smp_processor_id()) {
smp_call_func_t func = csd->func;
@@ -645,7 +645,7 @@ EXPORT_SYMBOL(smp_call_function_single);
*
* Return: %0 on success or negative errno value on error
*/
-int smp_call_function_single_async(int cpu, struct __call_single_data *csd)
+int smp_call_function_single_async(int cpu, call_single_data_t *csd)
{
int err = 0;
diff --git a/kernel/up.c b/kernel/up.c
index a38b8b095251..df50828cc2f0 100644
--- a/kernel/up.c
+++ b/kernel/up.c
@@ -25,7 +25,7 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
}
EXPORT_SYMBOL(smp_call_function_single);
-int smp_call_function_single_async(int cpu, struct __call_single_data *csd)
+int smp_call_function_single_async(int cpu, call_single_data_t *csd)
{
unsigned long flags;
--
2.40.1
next prev parent reply other threads:[~2023-05-20 5:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-20 5:29 [RFC PATCH v2 0/3] Move usages of struct __call_single_data to call_single_data_t Leonardo Bras
2023-05-20 5:29 ` [RFC PATCH v2 1/3] blk-mq: Move csd inside struct request so it's 32-byte aligned Leonardo Bras
2023-05-20 5:29 ` [RFC PATCH v2 2/3] blk-mq: Change request->csd type to call_single_data_t Leonardo Bras
2023-05-20 5:29 ` Leonardo Bras [this message]
2023-06-13 3:51 ` [RFC PATCH v2 0/3] Move usages of struct __call_single_data " Leonardo Bras Soares Passos
2023-07-04 7:22 ` Leonardo Brás
2023-08-29 0:55 ` Leonardo Brás
2023-08-29 2:29 ` Chengming Zhou
2023-08-30 22:29 ` Leonardo Brás
2023-08-30 22:48 ` Jens Axboe
2023-08-31 2:04 ` Leonardo Brás
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=20230520052957.798486-4-leobras@redhat.com \
--to=leobras@redhat.com \
--cc=axboe@kernel.dk \
--cc=guoren@kernel.org \
--cc=jgross@suse.com \
--cc=jpoimboe@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=palmer@rivosinc.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=vschneid@redhat.com \
--cc=yury.norov@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;
as well as URLs for NNTP newsgroup(s).