linux.conf.au Optimization From: Andrew Morton To: Rusty Russell Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org, k-suganuma@mvj.biglobe.ne.jp Subject: Re: [PATCH] 2.5.21 Nonlinear CPU support Rusty Russell wrote: > Linus, please apply. Tested on my dual x86 box. > > This patch removes smp_num_cpus, cpu_number_map and cpu_logical_map > from generic code, and uses cpu_online(cpu) instead, in preparation > for hotplug CPUS. umm. This patch does introduce a non-zero amount of bloat: > ... > - ntfs_compression_buffers = (u8**)kmalloc(smp_num_cpus * sizeof(u8*), > + ntfs_compression_buffers = (u8**)kmalloc(NR_CPUS * sizeof(u8*), and slowdown: > ... > busiest = NULL; > max_load = 1; > - for (i = 0; i < smp_num_cpus; i++) { > - int logical = cpu_logical_map(i); > + for (i = 0; i < NR_CPUS; i++) { > + if (!cpu_online(i)) > + continue; and for the majority of SMP machines it gives nothing back, yes? Is there some way of optimising all that?