Re: Making OOM-killer more informative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mulyadi Santosa wrote:

I suggest to create a /proc entry or similar to toggle this behaviour

Might be a nice idea, I'll look into it.

I strongly suggest to CC that patch to LKML. IMHO, there is a chance it could go into -mm

Indeed I intend to bring it up there eventually - but first I'd like to discuss it here and refine it a little :).

* What would be a suitable place for [the code for getting the cmdline-string]?

How about include/linux/mm.h?

Not sure, it's not really a memory management thing. Perhaps include/linux/sched.h, as that's where task_struct is defined also?

* What about the buffer size for the oom_pid_cmdline()-function? Is there a known upper bound for the length of a commandline?

One thing I see here (I could be wrong). You declare char buffer[1024], IIRC that means 2 byte * 1024 = 2K, while there "len" could be as big as PAGE_SIZE (4K in x86 32 bit). Don't you think, it would create stack overflow?

I think you're right - and that's exactly the reason I wanted to know the upper bound for the length of a commandline :). So the maximum size is PAGE_SIZE, and the buffer can safely be declared as 'char buffer [PAGE_SIZE / sizeof(char)]'?


Arnout

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux