From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753909AbbIXTpn (ORCPT ); Thu, 24 Sep 2015 15:45:43 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:46938 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753171AbbIXTpj (ORCPT ); Thu, 24 Sep 2015 15:45:39 -0400 Date: Thu, 24 Sep 2015 15:45:28 -0400 From: Johannes Weiner To: David Rientjes Cc: Andrew Morton , Oleg Nesterov , Michal Hocko , Linus Torvalds , Kyle Walker , Christoph Lameter , Vladimir Davydov , linux-mm , Linux Kernel Mailing List , Stanislav Kozina , Tetsuo Handa Subject: Re: [patch] mm, oom: remove task_lock protecting comm printing Message-ID: <20150924194528.GB3009@cmpxchg.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2015 at 04:30:13PM -0700, David Rientjes wrote: > The oom killer takes task_lock() in a couple of places solely to protect > printing the task's comm. > > A process's comm, including current's comm, may change due to > /proc/pid/comm or PR_SET_NAME. > > The comm will always be NULL-terminated, so the worst race scenario would > only be during update. We can tolerate a comm being printed that is in > the middle of an update to avoid taking the lock. > > Other locations in the kernel have already dropped task_lock() when > printing comm, so this is consistent. > > Suggested-by: Oleg Nesterov > Signed-off-by: David Rientjes Acked-by: Johannes Weiner