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

David Laight David.Laight at ACULAB.COM
Fri Dec 22 03:52:39 PST 2023


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)


More information about the linux-riscv mailing list