linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Borislav Petkov <bp@amd64.org>
Cc: Andi Kleen <andi@firstfloor.org>,
	tony.luck@intel.com, gong.chen@linux.intel.com,
	ananth@in.ibm.com, masbock@linux.vnet.ibm.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, lcm@us.ibm.com, mingo@redhat.com,
	tglx@linutronix.de, linux-edac@vger.kernel.org
Subject: Re: [PATCH 1/2] x86/mce: Pack boolean MCE boot flags into a structure
Date: Tue, 28 Aug 2012 12:25:25 +0530	[thread overview]
Message-ID: <503C6B5D.9030100@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120827141845.GB27979@aftab.osrc.amd.com>

On 08/27/2012 07:48 PM, Borislav Petkov wrote:
> On Mon, Aug 27, 2012 at 03:58:59PM +0200, Andi Kleen wrote:
>> On Mon, Aug 27, 2012 at 04:55:03PM +0530, Naveen N. Rao wrote:
>>> Many MCE boot flags are boolean in nature, but are declared as integers
>>> currently. We can pack these into a bitfield to save some space.
>>
>> Note that this doesn't necessarily save anything because it needs more
>> code to access, and accesses are more common than the flag
>>
>> 	cmpl  $0,foo(%rip)            7 bytes
>>          testl $1,foo(%rip)           10 bytes
>
> I got 7 bytes:
>
> 12e9:       f6 05 00 00 00 00 02    testb  $0x2,0x0(%rip)        # 12f0 <mce_start_timer.isra.18+0x30>
>
> vs the old:
>
> 1654:       83 3d 00 00 00 00 00    cmpl   $0x0,0x0(%rip)        # 165b <mce_start_timer.clone.15+0x37>
>
> also 7 bytes.
>

I'm seeing the same here. GCC v4.7 with -O2 generates testb and cmpb, 
which are both 7 bytes long.

Thanks,
Naveen


  reply	other threads:[~2012-08-28  6:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-27 11:25 [PATCH 1/2] x86/mce: Pack boolean MCE boot flags into a structure Naveen N. Rao
2012-08-27 11:25 ` [PATCH 2/2] x86/mce: Honour bios-set CMCI threshold Naveen N. Rao
2012-08-27 14:48   ` Borislav Petkov
2012-08-27 15:11     ` Naveen N. Rao
2012-08-27 15:21       ` Borislav Petkov
2012-08-27 13:58 ` [PATCH 1/2] x86/mce: Pack boolean MCE boot flags into a structure Andi Kleen
2012-08-27 14:18   ` Borislav Petkov
2012-08-28  6:55     ` Naveen N. Rao [this message]
2012-08-27 14:36 ` Borislav Petkov
2012-08-27 15:35   ` Naveen N. Rao
2012-08-27 15:47     ` Borislav Petkov
2012-08-27 16:01       ` Naveen N. Rao
2012-08-27 16:34         ` Borislav Petkov
2012-08-27 17:14           ` Naveen N. Rao
2012-08-27 20:18             ` Borislav Petkov
2012-08-28  7:17               ` Naveen N. Rao

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=503C6B5D.9030100@linux.vnet.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ananth@in.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=bp@amd64.org \
    --cc=gong.chen@linux.intel.com \
    --cc=lcm@us.ibm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masbock@linux.vnet.ibm.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).