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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1327648147.2919.29.camel@edumazet-laptop>
Date:	Fri, 27 Jan 2012 08:09:07 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Glauber Costa <glommer@...allels.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	Paul Tuner <pjt@...gle.com>
Subject: Re: [PATCH v2] proc:  speedup /proc/stat handling

Le vendredi 27 janvier 2012 à 10:09 +0900, KAMEZAWA Hiroyuki a écrit :
> On Thu, 26 Jan 2012 16:43:42 -0800
> Andrew Morton <akpm@...ux-foundation.org> wrote:
> 
> > 
> > I expect most of these numbers are zero.  I wonder if we would get
> > useful speedups from
> > 
> > 	for_each_irq_nr(j) {
> > 		/* Apologetic comment goes here */
> > 		if (kstat_irqs(j))
> > 			seq_printf(p, " %u", kstat_irqs(j));
> > 		else
> > 			seq_puts(p, " 0");
> > 	}
> 
> Yes. This is very good optimization and shows much optimization.
> I did this at first try  but did complicated ones because it seems
> not interesting. (This is my bad habit...)
> 
> I'll try again and measure time.
> 

Also make it generic maybe, and evaluate kstat_irqs(i) once.

seq_put_u32(struct seq_file *m, u32 val);

Converting an "u32" to its decimal representation should be fast, even
for non zero values. Many other users could benefit from this.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ