All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Sebastian Capella <sebastian.capella@linaro.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Russ Dill <Russ.Dill@ti.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Russell King <linux@arm.linux.org.uk>,
	Len Brown <len.brown@intel.com>, Nicolas Pitre <nico@linaro.org>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Will Deacon <Will.Deacon@arm.com>,
	Jonathan Austin <Jonathan.Austin@arm.com>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>,
	Stephen Boyd <sboyd@codeaurora.org>
Subject: Re: [PATCH v6 2/2] ARM hibernation / suspend-to-disk
Date: Tue, 4 Mar 2014 11:17:46 +0000	[thread overview]
Message-ID: <20140304111745.GB21431@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <5315a319.a3b2440a.039b.ffffc66e@mx.google.com>

On Tue, Mar 04, 2014 at 09:55:31AM +0000, Sebastian Capella wrote:
> Quoting Sebastian Capella (2014-02-28 15:38:54)
> > Quoting Lorenzo Pieralisi (2014-02-28 14:49:33)
> > > On Fri, Feb 28, 2014 at 08:15:57PM +0000, Sebastian Capella wrote:
> > > > > 
> > > > > This does not guarantee your stack is 8-byte aligned, that's not AAPCS
> > > > > compliant and might buy you trouble.
> > > > > 
> > > > > Either you align the stack or you align the pointer you are passing.
> > > > > 
> > > > > Please have a look at kernel/process.c
> > > > 
> > > > I've added this for now, do you see any issues?
> > > > 
> > > > -static u8 resume_stack[PAGE_SIZE/2] __nosavedata;
> > > > +static u64 resume_stack[PAGE_SIZE/2/sizeof(u64)] __nosavedata;
> > > > -               resume_stack + sizeof(resume_stack));
> > > > +               resume_stack + ARRAY_SIZE(resume_stack));
> > > 
> > > I do not see why the stack depends on the PAGE_SIZE. I would be surprised
> > > if you need more than a few bytes (given that soft_restart switches stack
> > > again...), go through it with a debugger, it is easy to check the stack
> > > usage and allow for some extra buffer (but half a page is not needed).
> > 
> > I assuming this is becase the no-save region is one page anyway (we skip
> > restoring the no-save region physical page).  So maybe 1/2 is a way to
> > leave some room for whatever else may need to be here, but in any case
> > the 4k is used for nosave.  I think you're right that it can be much less.
> 
> Hi Lorenzo,
> 
> Are you ok with this just being half a page?  Or do you want me to try
> to reduce the stack size?  I am at Connect without my debugger, so in
> that case it would have to wait until next week.

I am ok, either you leave that as it is (that multiple division looks
horrible but it is just nitpicking on my side) or define it as an u8 array,
stick __attribute__((aligned(8)) to the definition (and explain why) and be
done with it.

You can add my:

Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>


WARNING: multiple messages have this Message-ID (diff)
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 2/2] ARM hibernation / suspend-to-disk
Date: Tue, 4 Mar 2014 11:17:46 +0000	[thread overview]
Message-ID: <20140304111745.GB21431@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <5315a319.a3b2440a.039b.ffffc66e@mx.google.com>

On Tue, Mar 04, 2014 at 09:55:31AM +0000, Sebastian Capella wrote:
> Quoting Sebastian Capella (2014-02-28 15:38:54)
> > Quoting Lorenzo Pieralisi (2014-02-28 14:49:33)
> > > On Fri, Feb 28, 2014 at 08:15:57PM +0000, Sebastian Capella wrote:
> > > > > 
> > > > > This does not guarantee your stack is 8-byte aligned, that's not AAPCS
> > > > > compliant and might buy you trouble.
> > > > > 
> > > > > Either you align the stack or you align the pointer you are passing.
> > > > > 
> > > > > Please have a look at kernel/process.c
> > > > 
> > > > I've added this for now, do you see any issues?
> > > > 
> > > > -static u8 resume_stack[PAGE_SIZE/2] __nosavedata;
> > > > +static u64 resume_stack[PAGE_SIZE/2/sizeof(u64)] __nosavedata;
> > > > -               resume_stack + sizeof(resume_stack));
> > > > +               resume_stack + ARRAY_SIZE(resume_stack));
> > > 
> > > I do not see why the stack depends on the PAGE_SIZE. I would be surprised
> > > if you need more than a few bytes (given that soft_restart switches stack
> > > again...), go through it with a debugger, it is easy to check the stack
> > > usage and allow for some extra buffer (but half a page is not needed).
> > 
> > I assuming this is becase the no-save region is one page anyway (we skip
> > restoring the no-save region physical page).  So maybe 1/2 is a way to
> > leave some room for whatever else may need to be here, but in any case
> > the 4k is used for nosave.  I think you're right that it can be much less.
> 
> Hi Lorenzo,
> 
> Are you ok with this just being half a page?  Or do you want me to try
> to reduce the stack size?  I am at Connect without my debugger, so in
> that case it would have to wait until next week.

I am ok, either you leave that as it is (that multiple division looks
horrible but it is just nitpicking on my side) or define it as an u8 array,
stick __attribute__((aligned(8)) to the definition (and explain why) and be
done with it.

You can add my:

Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

  reply	other threads:[~2014-03-04 11:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27 23:57 [PATCH v6 0/2] hibernation support on ARM Sebastian Capella
2014-02-27 23:57 ` Sebastian Capella
2014-02-27 23:57 ` [PATCH v6 1/2] ARM: avoid tracers in soft_restart Sebastian Capella
2014-02-27 23:57   ` Sebastian Capella
2014-02-27 23:57 ` [PATCH v6 2/2] ARM hibernation / suspend-to-disk Sebastian Capella
2014-02-27 23:57   ` Sebastian Capella
2014-02-28  0:09   ` Stephen Boyd
2014-02-28  0:09     ` Stephen Boyd
2014-02-28  1:47     ` Russ Dill
2014-02-28  1:47       ` Russ Dill
2014-02-28  1:47       ` Russ Dill
2014-02-28  2:19       ` Stephen Boyd
2014-02-28  2:19         ` Stephen Boyd
2014-02-28 10:20         ` Russell King - ARM Linux
2014-02-28 10:20           ` Russell King - ARM Linux
     [not found]           ` <20140228181731.29118.41809@capellas-linux>
2014-03-05  2:28             ` Sebastian Capella
2014-03-05  2:28               ` Sebastian Capella
2014-03-05  2:28               ` Sebastian Capella
2014-06-02 16:57               ` Sebastian Capella
2014-06-02 16:57                 ` Sebastian Capella
2014-02-28  9:50   ` Lorenzo Pieralisi
2014-02-28  9:50     ` Lorenzo Pieralisi
2014-02-28  9:50     ` Lorenzo Pieralisi
2014-02-28 20:15     ` Sebastian Capella
2014-02-28 20:15       ` Sebastian Capella
2014-02-28 22:49       ` Lorenzo Pieralisi
2014-02-28 22:49         ` Lorenzo Pieralisi
2014-02-28 22:49         ` Lorenzo Pieralisi
2014-02-28 23:38         ` Sebastian Capella
2014-02-28 23:38           ` Sebastian Capella
2014-03-04  9:55           ` Sebastian Capella
2014-03-04  9:55             ` Sebastian Capella
2014-03-04  9:55             ` Sebastian Capella
2014-03-04 11:17             ` Lorenzo Pieralisi [this message]
2014-03-04 11:17               ` Lorenzo Pieralisi
2014-03-04 11:17               ` Lorenzo Pieralisi
2014-03-05  0:18               ` Sebastian Capella
2014-03-05  0:18                 ` Sebastian Capella

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=20140304111745.GB21431@e102568-lin.cambridge.arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Jonathan.Austin@arm.com \
    --cc=Russ.Dill@ti.com \
    --cc=Will.Deacon@arm.com \
    --cc=len.brown@intel.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nico@linaro.org \
    --cc=rjw@rjwysocki.net \
    --cc=santosh.shilimkar@ti.com \
    --cc=sboyd@codeaurora.org \
    --cc=sebastian.capella@linaro.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.