Skip to contentSkip to conversation

Hashing and directories

DISCUSSION Manfred Spraul 3 participants 4 messages Mar 7, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Jamie
Quoted 1 line · Linus Torvalds

The long-term solution for this is to create the new VM space for

the

Quoted 2 lines
Quoted 2 lines

new process early, and add it to the list of mm_struct's that the swapper knows about, and then just get rid of the

pages[MAX_ARG_PAGES]

Quoted 3 lines
Quoted 3 lines

array completely and instead just populate the new VM directly. That way the destination is swappable etc, and you can also remove the "put_dirty_page()" loop later on, as the pages will already be in

their

Quoted 3 lines
Quoted 3 lines

right places.

It's definitely not a one-liner, but if somebody really feels

strongly

Quoted 1 line
Quoted 1 line

about this, then I can tell already that the above is the only way

to do

Quoted 9 lines
Quoted 1 line

it sanely.

Yup. We discussed this years ago, and it nobody thought it important

enough. mm->mmlist didn't exist then, and creating it it _just_ for

this feature seemed too intrusive. I agree it's the only sane way to

completely remove the limit.

I'm not sure that this is the right way: It means that every exec() must call dup_mmap(), and usually only to copy a few hundert bytes. But I don't see a sane alternative. I won't propose to create a temporary file in a kernel tmpfs mount ;-)

--

Manfred

#1 lore raw
Quoted 4 lines · Manfred Spraul

I'm not sure that this is the right way: It means that every exec() must call dup_mmap(), and usually only to copy a few hundert bytes. But I don't see a sane alternative. I won't propose to create a temporary file in a kernel tmpfs mount ;-)

Every exec creates a whole new mm anyway, after copying data from the old mm. The suggestion is to create the new mm before copying the data, and to copy the data from the old mm directly to the new one.

-- Jamie

#2 lore raw
In reply to Manfred Spraul

From: "Jamie Lokier" <[email protected]>

Quoted 10 lines
Quoted 4 lines · Manfred Spraul

I'm not sure that this is the right way: It means that every exec() must call dup_mmap(), and usually only to copy a few hundert bytes. But I don't see a sane alternative. I won't propose to create a temporary file in a kernel tmpfs mount ;-)

Every exec creates a whole new mm anyway, after copying data from the old mm. The suggestion is to create the new mm before copying the data, and to copy the data from the old mm directly to the new one.

exec_mmap currenly avoids mm_alloc()/activate_mm()/mm_drop() for single threaded apps, and that would become impossible.
I'm not sure how expensive these calls are.

--
Manfred

#3 lore raw
In reply to Manfred Spraul

In article <003701c0a722$f6b02700$5517fea9@local>,

Quoted 4 lines · Manfred Spraul

exec_mmap currenly avoids mm_alloc()/activate_mm()/mm_drop() for single threaded apps, and that would become impossible.
I'm not sure how expensive these calls are.

They aren't that expensive: activate_mm() needs to flush the TLB, but we do that anyway in the re-use case too, so on the whole the expense is limited to having to do the extra allocation.

That expense might be at least partially offset by being able to do some things more simply - right now the mm re-use case actually has to be more careful than I really like for security and protection reasons, for example. We've had bugs in this area before - simplifying it would be nice. And it also gets rid of the special cases.

I don't think the patches to do this should be all that huge, but who knows? It's not a trivial part of the kernel.

Linus