* Re: [PATCH] -mm swsusp: copy_page is harmfull
[not found] <200409292014.i8TKEhov023334@hera.kernel.org>
@ 2004-10-03 23:50 ` Benjamin Herrenschmidt
2004-10-04 8:12 ` Nigel Cunningham
2004-10-04 9:33 ` Pavel Machek
0 siblings, 2 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2004-10-03 23:50 UTC (permalink / raw)
To: Pavel Machek; +Cc: Linux Kernel list
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.
Ben.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] -mm swsusp: copy_page is harmfull
2004-10-03 23:50 ` [PATCH] -mm swsusp: copy_page is harmfull Benjamin Herrenschmidt
@ 2004-10-04 8:12 ` Nigel Cunningham
2004-10-04 9:33 ` Pavel Machek
1 sibling, 0 replies; 4+ messages in thread
From: Nigel Cunningham @ 2004-10-04 8:12 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Pavel Machek, Linux Kernel Mailing List
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] -mm swsusp: copy_page is harmfull
2004-10-03 23:50 ` [PATCH] -mm swsusp: copy_page is harmfull Benjamin Herrenschmidt
2004-10-04 8:12 ` Nigel Cunningham
@ 2004-10-04 9:33 ` Pavel Machek
2004-10-04 11:20 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2004-10-04 9:33 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Linux Kernel list
Hi!
> > [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 ?
Nigel already provided right explanation.
> 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.
Hmm but does it matter? Is that operation really that slow on ppc?
This whole copy takes maybe second on x86, other operations are way
slower...
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] -mm swsusp: copy_page is harmfull
2004-10-04 9:33 ` Pavel Machek
@ 2004-10-04 11:20 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2004-10-04 11:20 UTC (permalink / raw)
To: Pavel Machek; +Cc: Linux Kernel list
On Mon, 2004-10-04 at 19:33, Pavel Machek wrote:
> Hmm but does it matter? Is that operation really that slow on ppc?
> This whole copy takes maybe second on x86, other operations are way
> slower...
No, you are right, it probably doesn't matter.
Ben.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-10-04 11:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
2004-10-04 9:33 ` Pavel Machek
2004-10-04 11:20 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox