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: <f6wx4yueffde7tflj6nhws5o4hf3tlg4hwr6x5hfiyndrjfgyz@v44emi2dodbz>
Date: Wed, 31 Jul 2024 19:33:32 +0530
From: Mukesh Kumar Chaurasiya <mchauras@...ux.ibm.com>
To: Li Zetao <lizetao1@...wei.com>
Cc: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        vschneid@...hat.com, zhangqiao22@...wei.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next v2] sched/fair: inline cpu_util_without and
 cpu_util to improve performance

On Wed, Jul 31, 2024 at 05:24:00PM GMT, Li Zetao wrote:
> The commit 3eb6d6ececca ("sched/fair: Refactor CPU utilization functions")
> refactored cpu_util_without and cpu_util functions. Since the size of
> cpu_util function has increased, the inline cpu_util is dropped. This had
> a negative impact on performance, in the scenario of updating
> sched_group's statistics, cpu_util_without and cpu_util functions are on
> the hotspot path.
> 
> Inlining cpu_util_without and cpu_util functions have been shown to
> significantly improve performance in lmbench as follow:
> 
>   Machine: Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz
>                      before          after          diff
>   fork+exit          317.0625        303.6667       -4.22%
>   fork+execve        1482.5000       1407.0000      -5.09%
>   fork+/bin/sh       2096.0000       2020.3333      -3.61%
> 
> This patch introduces inlining to cpu_util_without and cpu_util functions.
> While this increases the size of kernel/sched/fair.o, the performance
> gains in critical workloads make this an acceptable trade-off.
> 
> Size comparison before and after patch:
>      text	   data	    bss	    dec	    hex	filename
>    0x1264a	 0x1506	   0xb0	  80896	  13c00	kernel/sched/fair.o.before
>    0x12672	 0x14fe	   0xb0	  80928	  13c20	kernel/sched/fair.o.after
> 
> Co-developed-by: Zhang Qiao <zhangqiao22@...wei.com>
> Signed-off-by: Zhang Qiao <zhangqiao22@...wei.com>
> Signed-off-by: Li Zetao <lizetao1@...wei.com>

I ran the same tests on lmbench on Power9 (ppc64le)

Size Comparison

        text	   data	    bss	    dec	    hex	filename
before 111311	  14943	    440	 126694	  1eee6	kernel/sched/fair.o.before
after  111679	  14903	    440	 127022	  1f02e	kernel/sched/fair.o.after

Test comparison
                    before      after     % diff
fork+exit	          698.375	    688	      -1.51%
fork+execve	        2748	      2730.5	  -0.64%
fork+/bin/sh -c	    4298	      4293.5	  -0.10%

Tested-by: Mukesh Kumar Chaurasiya <mchauras@...ux.ibm.com>
Reviewed-by: Mukesh Kumar Chaurasiya <mchauras@...ux.ibm.com>

Thanks,
Mukesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ