Re: [PATCH 1/6] proc, oom: drop bogus task_lock and mm check
From: Michal Hocko <mhocko@kernel.org>
Date: 2016-06-01 06:53:44
Also in:
lkml
On Wed 01-06-16 00:53:03, Oleg Nesterov wrote:
On 05/31, Michal Hocko wrote:quoted
Oleg has pointed out that can simplify both oom_adj_write and oom_score_adj_write even further and drop the sighand lock. The only purpose of the lock was to protect p->signal from going away but this will not happen since ea6d290ca34c ("signals: make task_struct->signal immutable/refcountable").Sorry for confusion, I meant oom_adj_read() and oom_score_adj_read(). As for oom_adj_write/oom_score_adj_write we can remove it too, but then we need to ensure (say, using cmpxchg) that unpriviliged user can not not decrease signal->oom_score_adj_min if its oom_score_adj_write() races with someone else (say, admin) which tries to increase the same oom_score_adj_min.
I am introducing oom_adj_mutex in a later patch so I will move it here.
If you think this is not a problem - I am fine with this change. But please also update oom_adj_read/oom_score_adj_read ;)
will do. It stayed in the blind spot... Thanks for pointing that out Thanks! -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>