2015-02-03 18:40:17

by Leonid Yegoshin

[permalink] [raw]
Subject: Re: mips: Re-introduce copy_user_page

On 01/30/2015 09:23 PM, Guenter Roeck wrote:
> Commit bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork") replaced
> the inline function copy_user_page for mips with an external reference,
> but neglected to introduce the actual non-inline function. Restore it.
>
> Fixes: bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork")
> Fixes: 4927b7d77c00 ("dax,ext2: replace the XIP page fault handler with the DAX page fault handler")
> Cc: Atsushi Nemoto <[email protected]>
> Cc: Matthew Wilcox <[email protected]>
> Signed-off-by: Guenter Roeck <[email protected]>
>

Why do you use copy_user_page?
It doesn't work properly in HIGHMEM environment and it is excluded from
MIPS because of that, I believe.

You should use copy_user_highpage() for user pages.

- Leonid.


2015-02-04 03:33:16

by Guenter Roeck

[permalink] [raw]
Subject: Re: mips: Re-introduce copy_user_page

On 02/03/2015 10:40 AM, Leonid Yegoshin wrote:
> On 01/30/2015 09:23 PM, Guenter Roeck wrote:
>> Commit bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork") replaced
>> the inline function copy_user_page for mips with an external reference,
>> but neglected to introduce the actual non-inline function. Restore it.
>>
>> Fixes: bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork")
>> Fixes: 4927b7d77c00 ("dax,ext2: replace the XIP page fault handler with the DAX page fault handler")
>> Cc: Atsushi Nemoto <[email protected]>
>> Cc: Matthew Wilcox <[email protected]>
>> Signed-off-by: Guenter Roeck <[email protected]>
>>
>
> Why do you use copy_user_page?
> It doesn't work properly in HIGHMEM environment and it is excluded from MIPS because of that, I believe.
>
> You should use copy_user_highpage() for user pages.
>

Then maybe mips should not declare it the function external, the commit log
of the patch removing it should have mentioned that and why it was removed,
and there should be a clear statement somewhere stating that copy_user_page
shall not be used. I don't find such a statement anywhere in the kernel.

Guenter

2015-02-04 16:25:35

by Matthew Wilcox

[permalink] [raw]
Subject: RE: mips: Re-introduce copy_user_page

There is no 'struct page' for the source of this data. We have a kernel address for it; that's all.

-----Original Message-----
From: Leonid Yegoshin [mailto:[email protected]]
Sent: Tuesday, February 03, 2015 10:40 AM
To: Guenter Roeck; Ralf Baechle
Cc: [email protected]; [email protected]; Atsushi Nemoto; Wilcox, Matthew R
Subject: Re: mips: Re-introduce copy_user_page

On 01/30/2015 09:23 PM, Guenter Roeck wrote:
> Commit bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork") replaced
> the inline function copy_user_page for mips with an external reference,
> but neglected to introduce the actual non-inline function. Restore it.
>
> Fixes: bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork")
> Fixes: 4927b7d77c00 ("dax,ext2: replace the XIP page fault handler with the DAX page fault handler")
> Cc: Atsushi Nemoto <[email protected]>
> Cc: Matthew Wilcox <[email protected]>
> Signed-off-by: Guenter Roeck <[email protected]>
>

Why do you use copy_user_page?
It doesn't work properly in HIGHMEM environment and it is excluded from
MIPS because of that, I believe.

You should use copy_user_highpage() for user pages.

- Leonid.