Re: [PATCH] mm/oom_killer: Add task UID to info message on an oom kill

From: David Rientjes
Date: Thu Apr 25 2019 - 18:45:12 EST

On Wed, 24 Apr 2019, Joel Savitz wrote:

> In the event of an oom kill, useful information about the killed
> process is printed to dmesg. Users, especially system administrators,
> will find it useful to immediately see the UID of the process.
> In the following example, abuse_the_ram is the name of a program
> that attempts to iteratively allocate all available memory until it is
> stopped by force.
> Current message:
> Out of memory: Killed process 35389 (abuse_the_ram)
> total-vm:133718232kB, anon-rss:129624980kB, file-rss:0kB,
> shmem-rss:0kB
> Patched message:
> Out of memory: Killed process 2739 (abuse_the_ram), UID 0,
> total-vm:133880028kB, anon-rss:129754836kB, file-rss:0kB,
> shmem-rss:0kB
> Signed-off-by: Joel Savitz <jsavitz@xxxxxxxxxx>

Makes sense, could you add it to the end of the message in case anybody is
parsing the current string and we would now break their regex?

This would also need from_kuid(&init_user_ns, task_uid(task)) instead.