From: Nigel Cunningham <ncunningham@linuxmail.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Pavel Machek <pavel@ucw.cz>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] -mm swsusp: copy_page is harmfull
Date: Mon, 04 Oct 2004 18:12:39 +1000 [thread overview]
Message-ID: <1096877559.9064.45.camel@desktop.cunninghams> (raw)
In-Reply-To: <1096847414.23142.42.camel@gaston>
Hi.
On Mon, 2004-10-04 at 09:50, Benjamin Herrenschmidt wrote:
> On Sat, 2004-09-25 at 10:27, Linux Kernel Mailing List wrote:
> > ChangeSet 1.1983.1.3, 2004/09/24 17:27:41-07:00, akpm@osdl.org
> >
> > [PATCH] -mm swsusp: copy_page is harmfull
> >
> > From: Pavel Machek <pavel@ucw.cz>
> >
> > This is my fault from long time ago: copy_page can't be used for copying
> > task struct, therefore we can't use it in swsusp.
>
> Hi !
>
> Just curious, but why ?
>
> It would be useful to have this in platform code, I don't see why I couldn't
> use copy_page() on ppc and I suspect it will be more efficient than memcpy
> since it has specific optimisations due to the fact that we are known to be
> fully aligned and the size of the copy is a constant aligned power of 2.
I think I can answer that one, seeing as Pavel seems to be asleep at the
mo :>.
On x86 at least (perhaps your platform is different), copy_page can
resolve to different implementations. If you have 3D_NOW, the preempt
count will be incremented prior to copying the page via a fpu_begin
call. Sooner or later in doing the atomic copy of memory, you'll be
copying the page containing the preempt count (the task struct) for the
process doing the suspending. At that stage, you'll copy the preempt
count being one too high, and at resume time it will still be one too
high (we definitely can't use copy_page then). The simple solution would
be to use copy_page and have something like
#ifdef 3D_NOW
dec_preempt_count();
#endif
But I'm sure you'll agree that even if it's faster, it's less clear and
uglier.
Regards,
Nigel
next prev parent reply other threads:[~2004-10-04 8:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200409292014.i8TKEhov023334@hera.kernel.org>
2004-10-03 23:50 ` [PATCH] -mm swsusp: copy_page is harmfull Benjamin Herrenschmidt
2004-10-04 8:12 ` Nigel Cunningham [this message]
2004-10-04 9:33 ` Pavel Machek
2004-10-04 11:20 ` Benjamin Herrenschmidt
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=1096877559.9064.45.camel@desktop.cunninghams \
--to=ncunningham@linuxmail.org \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
/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