Re: [PATCH] binfmt: turn MAX_ARG_PAGES into a sysctl tunable

Linus Torvalds
2006-06-26T23:02:56Z

On Tue, 27 Jun 2006, Ingo Molnar wrote:
>
> i thought about your "map execve pages directly into target" (since the
> source gets destroyed anyway) suggestion back then, and unfortunately it
> gets quite complex.

No, you misunderstood.

I wasn't actually suggesting mapping pages directly from the source into
the destination. That is indeed horribly horribly complicated.

I really only wanted to avoid the "brpm->pages[]" indirection.

So right now, we copy the argument strings into new temporary pages and
put them in the ->pages[] array.

The "copy argument strings into new temporary pages" part is _fine_. I
wouldn't change that part at all.

I'd only really change the "into the ->pages[] array" part, and instead
move them directly into the destination page tables.

Why?

Two reasons:
- right now ->pages[] array is unswappable. Avoiding the temporary array
would allow the swapper to actually swap the pages out (no special
cases: it's a perfectly normal page table, it just hasn't actually
gotten activated yet).
- And the whole reason for having a limited array basically goes away
(the swappable thing is part of it, but the fact that the page tables
themselves are just a lot more extensible than the silly array is just
fundamentally a part of it too)

So it's literally just the array I'd get rid of. Instead of insertign the
page into the array, just insert it directly into the page table with
"install_arg_page()".

Linus