Re: [PATCH] fs/select.c: batch user writes in do_sys_poll

2020-08-13 Thread Al Viro
On Thu, Aug 13, 2020 at 09:36:52PM +1000, Daniel Axtens wrote: > Hi, > > >> Seem like this could simply use a copy_to_user to further simplify > >> things? > > > > I'll benchmark it and find out. > > I tried this: > > for (walk = head; walk; walk = walk->next) { > - struct

RE: [PATCH] fs/select.c: batch user writes in do_sys_poll

2020-08-13 Thread David Laight
From: Daniel Axtens > Sent: 13 August 2020 12:37 > > >> Seem like this could simply use a copy_to_user to further simplify > >> things? > > > > I'll benchmark it and find out. > > I tried this: > > for (walk = head; walk; walk = walk->next) { > - struct pollfd *fds =

Re: [PATCH] fs/select.c: batch user writes in do_sys_poll

2020-08-13 Thread Daniel Axtens
Hi, >> Seem like this could simply use a copy_to_user to further simplify >> things? > > I'll benchmark it and find out. I tried this: for (walk = head; walk; walk = walk->next) { - struct pollfd *fds = walk->entries; - int j; - - for (j = 0; j

RE: [PATCH] fs/select.c: batch user writes in do_sys_poll

2020-08-13 Thread David Laight
From: Christoph Hellwig > Sent: 13 August 2020 08:32 > > On Thu, Aug 13, 2020 at 05:11:20PM +1000, Daniel Axtens wrote: > > When returning results to userspace, do_sys_poll repeatedly calls > > put_user() - once per fd that it's watching. > > > > This means that on architectures that support some

Re: [PATCH] fs/select.c: batch user writes in do_sys_poll

2020-08-13 Thread Daniel Axtens
Christoph Hellwig writes: > On Thu, Aug 13, 2020 at 05:11:20PM +1000, Daniel Axtens wrote: >> When returning results to userspace, do_sys_poll repeatedly calls >> put_user() - once per fd that it's watching. >> >> This means that on architectures that support some form of >> kernel-to-userspace

Re: [PATCH] fs/select.c: batch user writes in do_sys_poll

2020-08-13 Thread Christoph Hellwig
On Thu, Aug 13, 2020 at 05:11:20PM +1000, Daniel Axtens wrote: > When returning results to userspace, do_sys_poll repeatedly calls > put_user() - once per fd that it's watching. > > This means that on architectures that support some form of > kernel-to-userspace access protection, we end up