From: Ingo Molnar <mingo@kernel.org>
To: Alexander Kuleshov <kuleshovmail@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H . Peter Anvin" <hpa@zytor.com>, Borislav Petkov <bp@suse.de>,
Joerg Roedel <jroedel@suse.de>, Dave Young <dyoung@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jiri Kosina <jkosina@suse.cz>, Baoquan He <bhe@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Mark Salter <msalter@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function
Date: Tue, 9 Feb 2016 13:10:16 +0100 [thread overview]
Message-ID: <20160209121016.GD500@gmail.com> (raw)
In-Reply-To: <CANCZXo6w_oMP=VUcAe1B=i-SDPgjQqOCq0HVPAFO43aO-Hrn0g@mail.gmail.com>
* Alexander Kuleshov <kuleshovmail@gmail.com> wrote:
> Hello Ingo,
>
> On Tue, Feb 9, 2016 at 3:16 PM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > So I don't think the code got easier to understand - in particular the
> > memblock_reserve()/free() pattern, depending on a flag value, is confusing.
> >
> > The duplication is there - but please factor it out into a helper structure
> > ('struct ramdisk') and a helper function that sets up the structure.
>
> What if instead of `struct ramdisk`, we will move all definitions/check from
> the early_reserve_initrd to the setup_arch() and than will pass these values
> to the reserve_initrd()?
There's too many of them, putting them into 'struct ramdisk' cleans up and
documents the whole code.
And yes, 'struct ramdisk' state should be defined in setup_arch(), that way it
does not have to be calculated twice: so the patch becomes not just a code size
reduction but a (small) runtime reduction as well.
Should be tested with a real ramdisk, to make sure everything still works fine.
Thanks,
Ingo
prev parent reply other threads:[~2016-02-09 12:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 18:02 [PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function Alexander Kuleshov
2016-02-09 9:16 ` Ingo Molnar
2016-02-09 11:35 ` Alexander Kuleshov
2016-02-09 12:10 ` Ingo Molnar [this message]
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=20160209121016.GD500@gmail.com \
--to=mingo@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=bp@suse.de \
--cc=dyoung@redhat.com \
--cc=hpa@zytor.com \
--cc=jkosina@suse.cz \
--cc=jroedel@suse.de \
--cc=kuleshovmail@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=msalter@redhat.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--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).