linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: eric.miao@canonical.com (Eric Miao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC] Introduce one machine_desc instance and get_machine_desc()
Date: Wed, 7 Jul 2010 22:14:12 +0800	[thread overview]
Message-ID: <AANLkTinxZYUrIva6vOVwTY3yDDl5ziAI4Jhx1UJsYssn@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1007070918320.6020@xanadu.home>

On Wed, Jul 7, 2010 at 9:32 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> On Wed, 7 Jul 2010, Eric Miao wrote:
>
>> commit 5d5d90e5d41bb0842559dd2b00f00f2a0f532a3a
>> Author: Eric Miao <eric.miao@canonical.com>
>> Date: ? Wed Jul 7 16:47:20 2010 +0800
>>
>> ? ? [ARM] Introduce one machine_desc instance and get_machine_desc()
>>
>> ? ? If some of the fields remains useful in 'struct machine_desc', it's
>> ? ? normally a bit convenient to keep one instance there for reference.
>>
>> ? ? (along with more and more machine specific fields coming into this
>> ? ? structure, e.g. pcibios_min_{io,mem})
>>
>> ? ? It also improves modularity a bit by not exporting variables like
>> ? ? system_timer, init_arch_irq etc.
>>
>> ? ? However, the drawbacks are 1) a bit increased data and 2) increased
>> ? ? risk of accessing those fields which are marked as __init.
>
> That makes me worried. ?Access to __init data/functions after __init
> stuff is freed is amongst the nastiest subtle bugs that are hard to
> reproduce and therefore fix. ?And copying such pointers is probably
> defeating the simple compile time checks we currently have against that.

Indeed I was upset as well :-)

>
> Maybe those fields should be partitioned differently. ?Having a new
> structure to encapsulate all fields that should be kept after __init
> stuff is gone might be a better way.

That's going to invent another similar structure and produce more code
when copying over. What about keeping those __init function pointers
as NULL, and copying the rest?

>
>
> Nicolas
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

  reply	other threads:[~2010-07-07 14:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07  9:19 [PATCH RFC] Introduce one machine_desc instance and get_machine_desc() Eric Miao
2010-07-07 13:32 ` Nicolas Pitre
2010-07-07 14:14   ` Eric Miao [this message]
2010-07-07 15:03     ` Nicolas Pitre
2010-07-07 15:07       ` Eric Miao

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=AANLkTinxZYUrIva6vOVwTY3yDDl5ziAI4Jhx1UJsYssn@mail.gmail.com \
    --to=eric.miao@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.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).