Locking kdecore into memory

Lubos Lunak l.lunak at suse.cz
Sun Jan 21 21:33:19 GMT 2007


Dne pátek 19 leden 2007 23:04 Richard Moore napsal(a):
> On 1/19/07, Lubos Lunak <l.lunak at suse.cz> wrote:
> > > IIRC mlock is only available as root so we can't do that.
> >
> >  (Is it really simpler to send a mail that's wrong than just skimming
> > over the manpage?) Having a small setuid helper just locking all
> > libraries in memory wouldn't be a big deal. And in fact even non-root
> > apps can do that, up to the set ulimit, but it's set to quite low value,
> > at least here. It'd be nice if it was higher, important apps then could
> > just do mlockall() and that'd be it, but I'm not quite sure people
> > setting these limits would share our point of view.
> >
> >  PS: I wonder, would this be Linux-only or does OOM suck also with other
> > systems?
>
> And since I used to work on software that used to use this call a lot
> I know the answer to that question eg. from the freebsd man page
> 'These calls are only available to the super-user.'  or we could look
> at solaris 'Because of the  impact  on  system  resources,  the  use
> of mlock() and munlock() is restricted to the superuser.'
>
> Looking at a linux man page and generalising is often a mistake.

 Generalizing is when you look at the freebsd manpage and say we can't use it 
anywhere :). Looking at the linux manpage and saying it could help on Linux 
is perfectly fine, since OOM handling on Linux sucks for sure (actually, 
John, have you tried this for real or is this all just a theory?). Do Solaris 
or FreeBSD have such poor handling as well?

> You 
> can also get bitten by the fact that if two processes lock a page, and
> one unlocks it the page gets unlocked - there is no ref count.

 I don't think there'd be any unlocking.

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz




More information about the kde-core-devel mailing list