All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Efremov <efremov@linux.com>
To: Joe Perches <joe@perches.com>, cocci@systeme.lip6.fr
Cc: Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	linux-kernel@vger.kernel.org
Subject: Re: [Cocci] [PATCH] scripts: coccinelle: check for !(un)?likely usage
Date: Mon, 26 Aug 2019 00:19:34 +0300	[thread overview]
Message-ID: <25032fea-bda4-a491-def3-05bb5f569875@linux.com> (raw)
In-Reply-To: <88f6e48e-1230-9488-a973-397f4e6dfbb5@linux.com>

> I think it's incorrect to say so in general. For example, on x86/64:
> 
> $ make mrproper
> $ make allyesconfig
> $ make && mv vmlinux vmlinux-000
> $ make coccicheck MODE=patch COCCI=scripts/coccinelle/misc/unlikely.cocci | patch -p1
> $ make 
> $ ./scripts/bloat-o-meter ./vmlinux-000 ./vmlinux
> add/remove: 0/0 grow/shrink: 3/4 up/down: 41/-35 (6)
> Function                                     old     new   delta
> dpaa2_io_service_rearm                       357     382     +25
> intel_pmu_hw_config                         1277    1285      +8
> get_sigframe.isra.constprop                 1657    1665      +8
> csum_partial_copy_from_user                  605     603      -2
> wait_consider_task                          3807    3797     -10
> __acct_update_integrals                      384     373     -11
> pipe_to_sendpage                             459     447     -12
> Total: Before=312759461, After=312759467, chg +0.00%
> 
> It definitely influence the way the compiler optimizes the code.  

Small addition:

Results with allyesconfig and KCOV, KASAN, KUBSAN, FTRACE, TRACE_BRANCH_PROFILING,
PROFILE_ALL_BRANCHES disabled:
./scripts/bloat-o-meter ./vmlinux-000 ./vmlinux
add/remove: 0/0 grow/shrink: 2/3 up/down: 22/-22 (0)
Function                                     old     new   delta
i40e_xmit_xdp_ring                           457     477     +20
__acct_update_integrals                      127     129      +2
csum_partial_copy_from_user                  208     207      -1
dpaa2_io_service_rearm                       180     177      -3
wait_consider_task                          1338    1320     -18

For defconfig:
./scripts/bloat-o-meter ./vmlinux-000 ./vmlinux 
add/remove: 0/0 grow/shrink: 3/1 up/down: 16/-5 (11)
Function                                     old     new   delta
do_signal                                   1513    1521      +8
wait_consider_task                          2151    2157      +6
__acct_update_integrals                      127     129      +2
csum_partial_copy_from_user                  223     218      -5

Denis
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

WARNING: multiple messages have this Message-ID (diff)
From: Denis Efremov <efremov@linux.com>
To: Joe Perches <joe@perches.com>, cocci@systeme.lip6.fr
Cc: linux-kernel@vger.kernel.org, Julia Lawall <Julia.Lawall@lip6.fr>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Michal Marek <michal.lkml@markovi.net>
Subject: Re: [PATCH] scripts: coccinelle: check for !(un)?likely usage
Date: Mon, 26 Aug 2019 00:19:34 +0300	[thread overview]
Message-ID: <25032fea-bda4-a491-def3-05bb5f569875@linux.com> (raw)
In-Reply-To: <88f6e48e-1230-9488-a973-397f4e6dfbb5@linux.com>

> I think it's incorrect to say so in general. For example, on x86/64:
> 
> $ make mrproper
> $ make allyesconfig
> $ make && mv vmlinux vmlinux-000
> $ make coccicheck MODE=patch COCCI=scripts/coccinelle/misc/unlikely.cocci | patch -p1
> $ make 
> $ ./scripts/bloat-o-meter ./vmlinux-000 ./vmlinux
> add/remove: 0/0 grow/shrink: 3/4 up/down: 41/-35 (6)
> Function                                     old     new   delta
> dpaa2_io_service_rearm                       357     382     +25
> intel_pmu_hw_config                         1277    1285      +8
> get_sigframe.isra.constprop                 1657    1665      +8
> csum_partial_copy_from_user                  605     603      -2
> wait_consider_task                          3807    3797     -10
> __acct_update_integrals                      384     373     -11
> pipe_to_sendpage                             459     447     -12
> Total: Before=312759461, After=312759467, chg +0.00%
> 
> It definitely influence the way the compiler optimizes the code.  

Small addition:

Results with allyesconfig and KCOV, KASAN, KUBSAN, FTRACE, TRACE_BRANCH_PROFILING,
PROFILE_ALL_BRANCHES disabled:
./scripts/bloat-o-meter ./vmlinux-000 ./vmlinux
add/remove: 0/0 grow/shrink: 2/3 up/down: 22/-22 (0)
Function                                     old     new   delta
i40e_xmit_xdp_ring                           457     477     +20
__acct_update_integrals                      127     129      +2
csum_partial_copy_from_user                  208     207      -1
dpaa2_io_service_rearm                       180     177      -3
wait_consider_task                          1338    1320     -18

For defconfig:
./scripts/bloat-o-meter ./vmlinux-000 ./vmlinux 
add/remove: 0/0 grow/shrink: 3/1 up/down: 16/-5 (11)
Function                                     old     new   delta
do_signal                                   1513    1521      +8
wait_consider_task                          2151    2157      +6
__acct_update_integrals                      127     129      +2
csum_partial_copy_from_user                  223     218      -5

Denis

  parent reply	other threads:[~2019-08-25 21:19 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-25 13:05 [Cocci] [PATCH] scripts: coccinelle: check for !(un)?likely usage Denis Efremov
2019-08-25 13:05 ` Denis Efremov
2019-08-25 15:30 ` [Cocci] " Markus Elfring
2019-08-25 15:30   ` Markus Elfring
2019-08-25 21:06   ` [Cocci] " Denis Efremov
2019-08-25 21:06     ` Denis Efremov
2019-08-25 15:30 ` [Cocci] " Markus Elfring
2019-08-25 15:30   ` Markus Elfring
2019-08-25 16:37 ` [Cocci] " Joe Perches
2019-08-25 16:37   ` Joe Perches
2019-08-25 18:59   ` [Cocci] " Denis Efremov
2019-08-25 18:59     ` Denis Efremov
2019-08-25 19:19     ` [Cocci] " Julia Lawall
2019-08-25 19:19       ` Julia Lawall
2019-08-28 11:33       ` [Cocci] " Rasmus Villemoes
2019-08-28 11:33         ` Rasmus Villemoes
2019-08-28 11:59         ` [Cocci] " Joe Perches
2019-08-28 11:59           ` Joe Perches
2019-08-28 12:33         ` [Cocci] " Denis Efremov
2019-08-28 12:33           ` Denis Efremov
2019-08-28 13:05           ` Rasmus Villemoes
2019-08-28 13:14             ` Denis Efremov
2019-08-28 12:33         ` [Cocci] " Julia Lawall
2019-08-28 12:33           ` Julia Lawall
2019-08-28 12:41       ` [Cocci] " Denis Efremov
2019-08-28 12:41         ` Denis Efremov
2019-08-28 13:57         ` [Cocci] " Denis Efremov
2019-08-28 13:57           ` Denis Efremov
2019-08-25 21:19     ` Denis Efremov [this message]
2019-08-25 21:19       ` Denis Efremov
2019-09-01 17:24   ` Pavel Machek
2019-09-01 17:39     ` [Cocci] " Denis Efremov
2019-09-01 17:39       ` Denis Efremov
2019-08-29 17:10 ` [Cocci] [PATCH v2] " Denis Efremov
2019-08-29 17:10   ` Denis Efremov
2019-08-29 17:13   ` [Cocci] " Denis Efremov
2019-08-29 17:13     ` Denis Efremov
2019-08-30  0:42     ` [Cocci] " Julia Lawall
2019-08-30  0:42       ` Julia Lawall
2019-08-30  6:56       ` [Cocci] " Denis Efremov
2019-08-30  6:56         ` Denis Efremov
2019-08-30  8:06         ` [Cocci] " Rasmus Villemoes
2019-08-30  8:06           ` Rasmus Villemoes
2019-08-29 20:07   ` [Cocci] " Markus Elfring
2019-08-29 20:07     ` Markus Elfring
2019-08-30  7:55   ` [Cocci] " Markus Elfring
2019-08-30  7:55     ` Markus Elfring
2019-08-30  7:55     ` Markus Elfring
2019-09-06 20:19   ` [Cocci] " Julia Lawall
2019-09-06 20:19     ` Julia Lawall
2019-09-06 20:55     ` [Cocci] " Denis Efremov
2019-09-06 20:55       ` Denis Efremov
2019-09-07  8:05       ` [Cocci] [v2] " Markus Elfring
2019-09-07  8:05         ` Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25032fea-bda4-a491-def3-05bb5f569875@linux.com \
    --to=efremov@linux.com \
    --cc=cocci@systeme.lip6.fr \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.