public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	Dipankar Sarma <dipankar@in.ibm.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] kmemtrace: Use tracepoints instead of markers.
Date: Mon, 5 Jan 2009 13:09:33 -0500	[thread overview]
Message-ID: <20090105180933.GB10366@Krystal> (raw)
In-Reply-To: <20090105175750.GB5196@localhost>

* Eduard - Gabriel Munteanu (eduard.munteanu@linux360.ro) wrote:
> On Mon, Jan 05, 2009 at 11:05:34AM -0500, Mathieu Desnoyers wrote:
> > Hopefully it does, especially when there are no side-effects. Can you
> > also try with -Os ?
> > 
> > Mathieu
> 
> Here's the disassembled code when using -Os. It seems it's optimised, as
> with -O2. My GCC's version is 4.3.2 (Gentoo Linux).
> 
> If you want to test yourself, the output was generated with 'objdump -d
> -S -a'.
> 
> What do you think?
> 
> static void print_that(unsigned long num)
> {
> 	printf("input << 5 == %lu\n", num);
>   40062d:	48 c1 e6 05          	shl    $0x5,%rsi
>   400631:	bf 5e 07 40 00       	mov    $0x40075e,%edi
>   400636:	31 c0                	xor    %eax,%eax
>   400638:	e8 6b fe ff ff       	callq  4004a8 <printf@plt>
> 	sscanf(argv[2], "%lu", &in);
> 
> 	call_do_something(in);
> 
> 	return 0;
> }
>   40063d:	5a                   	pop    %rdx
>   40063e:	59                   	pop    %rcx
>   40063f:	31 c0                	xor    %eax,%eax
>   400641:	5b                   	pop    %rbx
>   400642:	c3                   	retq   
> 
> 
> 	Eduard
> 

It looks good. Although I wonder if gcc will still optimize this in more
complicated functions. Just to be 100% sure, I would recommend testing
it in larger functions like schedule() in the kernel tree. But so far it
looks like it does not hurt much to leave a small supplementary operation
in the unlikely() branch.

Mathieu

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

  reply	other threads:[~2009-01-05 18:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-29  1:40 [PATCH 0/3] kmemtrace over tracepoints Eduard - Gabriel Munteanu
2008-12-29  1:40 ` [PATCH 1/3] RCU: Move some definitions to minimal headers Eduard - Gabriel Munteanu
2008-12-29  9:42   ` Pekka Enberg
2008-12-29 12:32     ` Ingo Molnar
2008-12-30  6:31     ` Paul E. McKenney
2008-12-29 14:56   ` Ingo Molnar
2008-12-29  1:40 ` [PATCH 2/3] tracepoints: Include only minimal RCU headers in linux/tracepoint.h Eduard - Gabriel Munteanu
2008-12-29  1:40 ` [PATCH 3/3] kmemtrace: Use tracepoints instead of markers Eduard - Gabriel Munteanu
2008-12-29  9:44   ` Pekka Enberg
2009-01-02 20:54     ` Mathieu Desnoyers
2009-01-02 23:03       ` Eduard - Gabriel Munteanu
2008-12-29 13:43   ` Pekka Enberg
2008-12-29 20:11     ` Eduard - Gabriel Munteanu
2009-01-02 20:53   ` Mathieu Desnoyers
2009-01-02 23:01     ` Eduard - Gabriel Munteanu
2009-01-02 23:42       ` Mathieu Desnoyers
2009-01-04  1:53         ` Eduard - Gabriel Munteanu
2009-01-04  4:10         ` Eduard - Gabriel Munteanu
2009-01-05 16:05           ` Mathieu Desnoyers
2009-01-05 17:57             ` Eduard - Gabriel Munteanu
2009-01-05 18:09               ` Mathieu Desnoyers [this message]
2008-12-29  9:41 ` [PATCH 0/3] kmemtrace over tracepoints Pekka Enberg

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=20090105180933.GB10366@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    --cc=adobriyan@gmail.com \
    --cc=dipankar@in.ibm.com \
    --cc=eduard.munteanu@linux360.ro \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@cs.helsinki.fi \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox