Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753510Ab1FKSo2 (ORCPT ); Sat, 11 Jun 2011 14:44:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2537 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318Ab1FKSo1 (ORCPT ); Sat, 11 Jun 2011 14:44:27 -0400 Date: Sat, 11 Jun 2011 20:44:16 +0200 From: Andrea Arcangeli To: Johannes Weiner Cc: Hugh Dickins , KAMEZAWA Hiroyuki , Ying Han , Dave Jones , Linux Kernel , "linux-mm@kvack.org" , Oleg Nesterov , "akpm@linux-foundation.org" Subject: Re: [PATCH] [BUGFIX] update mm->owner even if no next owner. Message-ID: <20110611184416.GB3238@redhat.com> References: <20110610091355.2ce38798.kamezawa.hiroyu@jp.fujitsu.com> <20110610113311.409bb423.kamezawa.hiroyu@jp.fujitsu.com> <20110610121949.622e4629.kamezawa.hiroyu@jp.fujitsu.com> <20110610125551.385ea7ed.kamezawa.hiroyu@jp.fujitsu.com> <20110610133021.2eaaf0da.kamezawa.hiroyu@jp.fujitsu.com> <20110610235442.GA21413@cmpxchg.org> <20110611175136.GA31154@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110611175136.GA31154@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 978 Lines: 23 On Sat, Jun 11, 2011 at 07:51:36PM +0200, Johannes Weiner wrote: > This is a problem with the patch, but I think Kame's analysis and > approach to fix it are still correct. I agree with Kame's analysis too. This explains why removing the mmap_sem read mode introduced the problem, it was quite some unexpected subtleness not apparent to the naked eye, as memcg didn't explicitly relay on mmap_sem but it did implicitly during exit because of the __khugepaged_exit waiting if we were collapsing an hugepage... So the fix is safe because the task struct is freed with delayed_put_task_struct and that won't run until we rcu_read_unlock after mem_cgroup_from_task. Reviewed-by: Andrea Arcangeli Thanks, Andrea -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/