Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1221398 > unrolled thread
| Started by | Matt Fleming <matt@codeblueprint.co.uk> |
|---|---|
| First post | 2015-09-09 14:30 +0200 |
| Last post | 2015-09-13 05:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints Matt Fleming <matt@codeblueprint.co.uk> - 2015-09-09 14:30 +0200
Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints joeyli <jlee@suse.com> - 2015-09-13 05:00 +0200
| From | Matt Fleming <matt@codeblueprint.co.uk> |
|---|---|
| Date | 2015-09-09 14:30 +0200 |
| Subject | Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints |
| Message-ID | <q6MFJ-2Ym-19@gated-at.bofh.it> |
On Thu, 27 Aug, at 06:21:44PM, joeyli wrote:
> On Fri, Aug 21, 2015 at 02:27:53PM +0100, Matt Fleming wrote:
> > On Tue, 11 Aug, at 02:16:29PM, Lee, Chun-Yi wrote:
> > > +static int __init init_hibernation_keys(void)
> > > +{
> > > + struct hibernation_keys *keys;
> > > + int ret = 0;
> > > +
> > > + if (!keys_phys_addr)
> > > + return -ENODEV;
> > > +
> > > + keys = early_memremap(keys_phys_addr, sizeof(struct hibernation_keys));
> > > +
> > > + /* Copy hibernation keys to a allocated page */
> > > + hibernation_keys = (struct hibernation_keys *)get_zeroed_page(GFP_KERNEL);
> > > + if (hibernation_keys) {
> > > + *hibernation_keys = *keys;
> > > + } else {
> > > + pr_err("PM: Allocate hibernation keys page failed\n");
> > > + ret = -ENOMEM;
> > > + }
> >
> > It seems overkill to allocate an entire page for 28 bytes of data.
> >
>
> Here to allocate an entire page because the basic unit is 'page' when
> hibernation code checking saveable page that should included/excluded in
> snapshot image.
> Allocating an page to hibernation key can clearer to check the page should
> excluded in snapshot image.
Do other pieces of code do something similar, i.e. allocate an entire
page because the hibernation code deals with pages? If so, it might be
possible to lump all these pieces of data together into a single
'auxiliary' page.
--
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | joeyli <jlee@suse.com> |
|---|---|
| Date | 2015-09-13 05:00 +0200 |
| Message-ID | <q85Gh-38Q-1@gated-at.bofh.it> |
| In reply to | #1221398 |
On Wed, Sep 09, 2015 at 01:24:08PM +0100, Matt Fleming wrote:
> On Thu, 27 Aug, at 06:21:44PM, joeyli wrote:
> > On Fri, Aug 21, 2015 at 02:27:53PM +0100, Matt Fleming wrote:
> > > On Tue, 11 Aug, at 02:16:29PM, Lee, Chun-Yi wrote:
> > > > +static int __init init_hibernation_keys(void)
> > > > +{
> > > > + struct hibernation_keys *keys;
> > > > + int ret = 0;
> > > > +
> > > > + if (!keys_phys_addr)
> > > > + return -ENODEV;
> > > > +
> > > > + keys = early_memremap(keys_phys_addr, sizeof(struct hibernation_keys));
> > > > +
> > > > + /* Copy hibernation keys to a allocated page */
> > > > + hibernation_keys = (struct hibernation_keys *)get_zeroed_page(GFP_KERNEL);
> > > > + if (hibernation_keys) {
> > > > + *hibernation_keys = *keys;
> > > > + } else {
> > > > + pr_err("PM: Allocate hibernation keys page failed\n");
> > > > + ret = -ENOMEM;
> > > > + }
> > >
> > > It seems overkill to allocate an entire page for 28 bytes of data.
> > >
> >
> > Here to allocate an entire page because the basic unit is 'page' when
> > hibernation code checking saveable page that should included/excluded in
> > snapshot image.
> > Allocating an page to hibernation key can clearer to check the page should
> > excluded in snapshot image.
>
> Do other pieces of code do something similar, i.e. allocate an entire
> page because the hibernation code deals with pages? If so, it might be
> possible to lump all these pieces of data together into a single
> 'auxiliary' page.
>
> --
> Matt Fleming, Intel Open Source Technology Center
Thanks for your suggestions, I will lump all these data to into a single page
with the key. I want keep all the contents in the page only for hibernation's
usage but not to share with other subsystem in kernel, that's more safe to avoid
the key be accessed by with other code.
Thanks a lot!
Joey Lee
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web