Re: [patch] mlock-as-nonroot revisted

From: Rik van Riel
Date: Thu Jul 29 2004 - 21:48:18 EST


On Thu, 29 Jul 2004, Chris Wright wrote:

> 2) mlock_user isn't ever set, so SHM_LOCK accounting looks broken
> (trivial to fix).

Woops, looks like Arjan's patch is missed a little piece of
the code there when going throug the forward port...

> 3) now the RLIMIT_MEMLOCK value represents at best half of what a user
> can acutally lock. because half of the accounting (mlock) is done against
> locked_vm, and the other half against locked_shm. and as i mentioned
> above, seems that hugetlb is unaccounted for.

Well, the RLIMIT_MEMLOCK is a per-process limit anyway so the
total amount of memory a user can mlock isn't really limited
by it. The user_struct itself just gets the same limit as each
of the user's processes, to account for memory that doesn't
have the same life time as processes.

> I do agree, however, that storing in user struct allows for quota like
> accounting that matches the shm_lock and hugetlb use cases.

Ok, cool ;)

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/