lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200916081225.GJ2674@hirez.programming.kicks-ass.net>
Date:   Wed, 16 Sep 2020 10:12:25 +0200
From:   peterz@...radead.org
To:     Xu Wang <vulab@...as.ac.cn>
Cc:     mingo@...hat.com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] stats: Replace seq_printf with seq_puts

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@...as.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ