per user memory limit and LSM module

From: Iliya
Date: Fri May 29 2009 - 08:52:03 EST

Hi everyone,
I'd like to limit the memory usage per user, using LSM based module.
The vm_enough_memory LSM hook is convenient enough , but to make use
of it , I would need sum of all the memory usage by the current user.
The easiest way I could think of was traversing through all the
processes with for_each_process() , checking for the uid and summing
up , but this would get too slow when working with more processes.
The task_alloc_security/task_free_security LSM hooks are no longer
available and maintaining a list of processes per user through the
cred_prepare/commit/free will not be accurate and with too much
Any suggestions on how can I quickly get or maintain a list of all the
running tasks per user(or just the memory usage), without patching the
kernel would be greatly appreciated.
Best Regards,
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at