mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Iliya <vnsavage@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: per user memory limit and LSM module
Date: Fri, 29 May 2009 15:51:52 +0300	[thread overview]
Message-ID: <b0b0b0000905290551t7e0a081bm814de19a8101814a@mail.gmail.com> (raw)

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
overhead.
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,
Iliya

             reply	other threads:[~2009-05-29 12:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-29 12:51 Iliya [this message]
2009-05-29 12:57 ` Alan Cox
     [not found]   ` <b0b0b0000905290611r45b1d528o98ee26ec0f534639@mail.gmail.com>
2009-05-29 13:15     ` Fwd: " Iliya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0b0b0000905290551t7e0a081bm814de19a8101814a@mail.gmail.com \
    --to=vnsavage@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®