[PATCH V2 4/4] riscv: mm: Optimize TASK_SIZE definition

Guo Ren guoren at kernel.org
Fri Dec 22 18:38:35 PST 2023


Hi David,

On Fri, Dec 22, 2023 at 7:52 PM David Laight <David.Laight at aculab.com> wrote:
>
> From: Guo Ren
> > Sent: 22 December 2023 11:25
> ...
> > > > +#define TASK_SIZE    (is_compat_task() ? \
> > > >                        TASK_SIZE_32 : TASK_SIZE_64)
> > I would remove is_compat_task() in the next version because your patch
> > contains that.
>
> Does TASK_SIZE get used in access_ok() ?
> If so the repeated expansion of that 'mess' will slow things down.
>
> OTOH access_ok(ptr, len) can just check (ptr | (ptr + len)) < 0)
> and rely on the page faults for everything else.
I mean, I would remove is_compat_task() optimization.
test_thread_flag(TIF_32BIT) -> (is_compat_task() ?
Sorry for the bad wording.

Leonardo's new patch series contains the optimization on
is_compat_task(), so I canceled mine.


>
>         David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)



-- 
Best Regards
 Guo Ren



More information about the linux-riscv mailing list