Re: [RFC PATCH 09/15] epoll: introduce stand-alone helpers for polling from userspace

From: Linus Torvalds
Date: Wed Jan 09 2019 - 12:29:41 EST


On Wed, Jan 9, 2019 at 8:40 AM Roman Penyaev <rpenyaev@xxxxxxx> wrote:
>
> ep_vrealloc*()
> realloc user header, user index or bitmap memory

What? No.

This is wrong, it's much too complicated. And because your
'vrealloc()' doesn't follow the normal realloc rules, it looks both
confusing and buggy, and people have to remember that "oh, vrealloc()
isn't actually vrealloc(), it's really vdupalloc()".

Your other patch to allow users to apparently also do mremap of these
things seems entirely wrongheaded too. Especially when you then have
magical rules for vm_pgoff, which is one of the things that unmapping
parts of a mmap will touch.

So I say no, no, no. This is all *much* too complicated, and the
interfaces are mis-designed to be overly generous to people doing odd
and pointless things.

If you can't have a fixed-size user buffer that stays in one place,
don't even bother.

Linus