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

From: David Laight
Date: Fri Dec 22 2023 - 06:53:05 EST


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.

David

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