From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: vegard.nossum@oracle.com, penberg@kernel.org,
jamie.iles@oracle.com, hpa@zytor.com, mingo@redhat.com,
tglx@linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] x86: Move instruction decoder data into header
Date: Wed, 16 Apr 2014 12:06:36 +0900 [thread overview]
Message-ID: <534DF3BC.8050803@hitachi.com> (raw)
In-Reply-To: <534D412A.30504@oracle.com>
(2014/04/15 23:24), Sasha Levin wrote:
> On 04/14/2014 11:10 PM, Masami Hiramatsu wrote:
>> (2014/04/15 11:28), Sasha Levin wrote:
>>> On 04/14/2014 09:41 PM, Masami Hiramatsu wrote:
>>>> (2014/04/15 2:44), Sasha Levin wrote:
>>>>>> Right now we generate data for the instruction decoder and place it
>>>>>> as a code file which gets #included directly (yuck).
>>>>>>
>>>>>> Instead, make it a header which will also be usable by other code
>>>>>> that wants to use the data in there.
>>>> Hmm, making the generated data into a header file may clone
>>>> the data table instances for each object file. Since the inat
>>>> table is not so small, I think we'd better just export the tables.
>>>
>>> The tables are defined as static, so the compiler drops them
>>> once it detects they are not used.
>>
>> No, I meant that if the table is used in the different object files,
>> will the copies of the tables be compiled in several different
>> instances?
>
> That's true, but there was and after this patchset there will still
> be only one user that touches the table. I also doubt that more users
> will appear since users of the table should be going through the API
> and not touching it directly, so I don't think it should be a concern
> at this point.
Agreed, so I don't like to expose it. If no one need them, then give
it to the owner. That must be the safest.
>> And I can't see the part which makes the tables static in this patch...
>
> Right, it sneaked to the next patch in this patchset. I'll pull it
> into this one in the next version.
>
>>> I feel it would be easier to let the compiler do it's job rather
>>> than do optimizations we don't need to do and which will complicate
>>> the code quite a bit.
>>
>> I haven't tend to optimize it, but just encapsulate it, to hide from other parts.
>
> We could hide it under #ifdef, but that wouldn't change anything for
> the user or for the generated code itself.
>
> Splitting code generation into two different files would complicate
> everything IMO.
No, mixing data (definitions) and declarations on one header should be
avoided, especially that is generated in the build path. I'd like to ask
you to split them into header and body. I know it will be harder to
implement, but worth to maintain.
Thank you,
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2014-04-16 3:06 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-14 17:44 [PATCH 1/4] kmemcheck: add additional selfchecks Sasha Levin
2014-04-14 17:44 ` [PATCH 2/4] x86: Move instruction decoder data into header Sasha Levin
2014-04-15 1:41 ` Masami Hiramatsu
2014-04-15 2:28 ` Sasha Levin
2014-04-15 3:10 ` Masami Hiramatsu
2014-04-15 14:24 ` Sasha Levin
2014-04-16 3:06 ` Masami Hiramatsu [this message]
2014-04-14 17:44 ` [PATCH 3/4] x86/insn: Extract more information about instructions Sasha Levin
2014-04-15 3:12 ` Masami Hiramatsu
2014-04-15 4:36 ` Masami Hiramatsu
2014-04-15 15:10 ` Sasha Levin
2014-04-16 3:26 ` H. Peter Anvin
2014-04-16 3:47 ` Sasha Levin
2014-04-16 3:54 ` H. Peter Anvin
2014-04-16 4:03 ` Sasha Levin
2014-04-16 4:31 ` H. Peter Anvin
2014-04-16 5:30 ` Masami Hiramatsu
2014-04-17 15:20 ` Sasha Levin
2014-04-17 15:28 ` H. Peter Anvin
2014-04-17 17:31 ` Sasha Levin
2014-04-18 3:40 ` Masami Hiramatsu
2014-04-18 3:45 ` H. Peter Anvin
2014-04-18 15:47 ` Sasha Levin
2014-04-18 16:48 ` H. Peter Anvin
2014-04-16 5:44 ` Masami Hiramatsu
2014-04-17 15:33 ` Sasha Levin
2014-04-18 3:25 ` Masami Hiramatsu
2014-04-14 17:44 ` [PATCH 4/4] kmemcheck: Switch to using kernel disassembler Sasha Levin
2014-04-15 8:17 ` 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=534DF3BC.8050803@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=hpa@zytor.com \
--cc=jamie.iles@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=penberg@kernel.org \
--cc=sasha.levin@oracle.com \
--cc=tglx@linutronix.de \
--cc=vegard.nossum@oracle.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).