Re: [PATCH 0/4] per anon_vma lock and turn anon_vma rwsem lock to rwlock_t

Linus Torvalds
2013-11-01T18:55:07Z

On Fri, Nov 1, 2013 at 11:47 AM, Michel Lespinasse <walken@google.com> wrote:
>
> Should copy Andrea on this. I talked with him during KS, and there are
> no current in-tree users who are doing such sleeping; however there
> are prospective users for networking (RDMA) or GPU stuff who want to
> use this to let hardware directly copy data into user mappings.

Tough.

I spoke up the first time this came up and I'll say the same thing
again: we're not screwing over the VM subsystem because some crazy
user might want to do crazy and stupid things that nobody sane cares
about.

The whole "somebody might want to .." argument is just irrelevant.
Some people want to sleep in interrupt handlers too, or while holding
random spinlocks. Too bad. They don't get to, because doing that
results in problems for the rest of the system.

Our job in the kernel is to do the best job technically that we can.
And sometimes that very much involves saying "No, you can't do that".

We have limitations in the kernel. The stack is of limited size. You
can't allocate arbitrarily sized memory. You must follow some very
strict rules.

If people can't handle that, then they can go cry to mommy, and go
back to writing user mode code. In the kernel, you have to live with
certain constraints that makes the kernel better.

Linus