* [PATCH] stats: Replace seq_printf with seq_puts
@ 2020-09-16 3:44 Xu Wang
2020-09-16 8:12 ` peterz
0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-09-16 3:44 UTC (permalink / raw)
To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
rostedt, bsegall, mgorman
Cc: linux-kernel, Xu Wang
seq_puts is a lot cheaper than seq_printf, so use that to print
literal strings.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
kernel/sched/stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c
index 750fb3c67eed..0818fe03407a 100644
--- a/kernel/sched/stats.c
+++ b/kernel/sched/stats.c
@@ -37,7 +37,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
rq->rq_cpu_time,
rq->rq_sched_info.run_delay, rq->rq_sched_info.pcount);
- seq_printf(seq, "\n");
+ seq_putc(seq, '\n');
#ifdef CONFIG_SMP
/* domain-specific stats */
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] stats: Replace seq_printf with seq_puts
2020-09-16 3:44 [PATCH] stats: Replace seq_printf with seq_puts Xu Wang
@ 2020-09-16 8:12 ` peterz
0 siblings, 0 replies; 2+ messages in thread
From: peterz @ 2020-09-16 8:12 UTC (permalink / raw)
To: Xu Wang
Cc: mingo, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
bsegall, mgorman, linux-kernel
On Wed, Sep 16, 2020 at 03:44:15AM +0000, Xu Wang wrote:
> seq_puts is a lot cheaper than seq_printf, so use that to print
> literal strings.
performance is not a consideration here.
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
> kernel/sched/stats.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c
> index 750fb3c67eed..0818fe03407a 100644
> --- a/kernel/sched/stats.c
> +++ b/kernel/sched/stats.c
> @@ -37,7 +37,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
> rq->rq_cpu_time,
> rq->rq_sched_info.run_delay, rq->rq_sched_info.pcount);
>
> - seq_printf(seq, "\n");
> + seq_putc(seq, '\n');
And yet, the changelog says seq_put*s*().
>
> #ifdef CONFIG_SMP
> /* domain-specific stats */
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-16 8:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 3:44 [PATCH] stats: Replace seq_printf with seq_puts Xu Wang
2020-09-16 8:12 ` peterz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.