From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754095AbcHXIK3 (ORCPT ); Wed, 24 Aug 2016 04:10:29 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36475 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbcHXIK0 (ORCPT ); Wed, 24 Aug 2016 04:10:26 -0400 Date: Wed, 24 Aug 2016 10:10:24 +0200 From: Michal Hocko To: Oleg Nesterov Cc: Andrew Morton , linux-mm@kvack.org, LKML , Roland McGrath , Andreas Schwab , William Preston Subject: Re: [PATCH v2] kernel/fork: fix CLONE_CHILD_CLEARTID regression in nscd Message-ID: <20160824081023.GE31179@dhcp22.suse.cz> References: <1471968749-26173-1-git-send-email-mhocko@kernel.org> <20160823163233.GA7123@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160823163233.GA7123@redhat.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 23-08-16 18:32:34, Oleg Nesterov wrote: > On 08/23, Michal Hocko wrote: > > > > --- a/kernel/fork.c > > +++ b/kernel/fork.c > > @@ -913,14 +913,11 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) > > deactivate_mm(tsk, mm); > > > > /* > > - * If we're exiting normally, clear a user-space tid field if > > - * requested. We leave this alone when dying by signal, to leave > > - * the value intact in a core dump, and to save the unnecessary > > - * trouble, say, a killed vfork parent shouldn't touch this mm. > > - * Userland only wants this done for a sys_exit. > > + * Signal userspace if we're not exiting with a core dump > > + * or a killed vfork parent which shouldn't touch this mm. > > Well. ACK, but the comment looks wrong... > > The "killed vfork parent ..." part should be removed, as you pointed > out this is no longer true. > > OTOH, to me it would be better to not remove the "leave the value > intact in a core dump" part, otherwise the " we're not exiting with > a core dump" looks pointless because SIGNAL_GROUP_COREDUMP is self- > documenting. Sounds better? diff --git a/kernel/fork.c b/kernel/fork.c index b89f0eb99f0a..ddde5849df81 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -914,7 +914,8 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) /* * Signal userspace if we're not exiting with a core dump - * or a killed vfork parent which shouldn't touch this mm. + * because we want to leave the value intact for debugging + * purposes. */ if (tsk->clear_child_tid) { if (!(tsk->signal->flags & SIGNAL_GROUP_COREDUMP) && -- Michal Hocko SUSE Labs