From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755643AbZELIDy (ORCPT ); Tue, 12 May 2009 04:03:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752598AbZELIDf (ORCPT ); Tue, 12 May 2009 04:03:35 -0400 Received: from TYO201.gate.nec.co.jp ([202.32.8.193]:48653 "EHLO tyo201.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751954AbZELIDb (ORCPT ); Tue, 12 May 2009 04:03:31 -0400 Date: Tue, 12 May 2009 17:00:07 +0900 From: Daisuke Nishimura To: KAMEZAWA Hiroyuki Cc: nishimura@mxp.nes.nec.co.jp, "linux-mm@kvack.org" , "balbir@linux.vnet.ibm.com" , "akpm@linux-foundation.org" , mingo@elte.hu, "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 4/3] memcg: call uncharge_swapcache outside of tree_lock (Re: [PATCH 0/3] fix stale swap cache account leak in memcg v7) Message-Id: <20090512170007.ad7f5c7b.nishimura@mxp.nes.nec.co.jp> In-Reply-To: <20090512160901.8a6c5f64.kamezawa.hiroyu@jp.fujitsu.com> References: <20090512104401.28edc0a8.kamezawa.hiroyu@jp.fujitsu.com> <20090512140648.0974cb10.nishimura@mxp.nes.nec.co.jp> <20090512160901.8a6c5f64.kamezawa.hiroyu@jp.fujitsu.com> Organization: NEC Soft, Ltd. X-Mailer: Sylpheed 2.6.0 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I understand the problem, but, wait a bit. NACK to this patch itself. > > 1. I placed _uncharge_ inside tree_lock because __remove_from_page_cache() does. > (i.e. using the same logic.) > So, plz change both logic at once.(change caller of mem_cgroup_uncharge_cache_page()) > hmm, I see. cache_charge is outside of tree_lock, so moving uncharge would make sense. IMHO, we should make the period of spinlock as small as possible, and charge/uncharge of pagecache/swapcache is protected by page lock, not tree_lock. > 2. Shouldn't we disable IRQ while __mem_cgroup_uncharge_common() rather than moving > function ? > Yes, this is another choise. But, isn't it better to disable IRQ at all users of lock_page_cgroup..unlock_page_cgroup to avoid this dead lock ? Anyway, I'll postpone this fix for a while. We should fix stale swap swapcache first. Thanks, Daisuke Nishimura. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with ESMTP id 7BA8B6B0055 for ; Tue, 12 May 2009 04:02:47 -0400 (EDT) Date: Tue, 12 May 2009 17:00:07 +0900 From: Daisuke Nishimura Subject: Re: [PATCH 4/3] memcg: call uncharge_swapcache outside of tree_lock (Re: [PATCH 0/3] fix stale swap cache account leak in memcg v7) Message-Id: <20090512170007.ad7f5c7b.nishimura@mxp.nes.nec.co.jp> In-Reply-To: <20090512160901.8a6c5f64.kamezawa.hiroyu@jp.fujitsu.com> References: <20090512104401.28edc0a8.kamezawa.hiroyu@jp.fujitsu.com> <20090512140648.0974cb10.nishimura@mxp.nes.nec.co.jp> <20090512160901.8a6c5f64.kamezawa.hiroyu@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: KAMEZAWA Hiroyuki Cc: nishimura@mxp.nes.nec.co.jp, "linux-mm@kvack.org" , "balbir@linux.vnet.ibm.com" , "akpm@linux-foundation.org" , mingo@elte.hu, "linux-kernel@vger.kernel.org" List-ID: > I understand the problem, but, wait a bit. NACK to this patch itself. > > 1. I placed _uncharge_ inside tree_lock because __remove_from_page_cache() does. > (i.e. using the same logic.) > So, plz change both logic at once.(change caller of mem_cgroup_uncharge_cache_page()) > hmm, I see. cache_charge is outside of tree_lock, so moving uncharge would make sense. IMHO, we should make the period of spinlock as small as possible, and charge/uncharge of pagecache/swapcache is protected by page lock, not tree_lock. > 2. Shouldn't we disable IRQ while __mem_cgroup_uncharge_common() rather than moving > function ? > Yes, this is another choise. But, isn't it better to disable IRQ at all users of lock_page_cgroup..unlock_page_cgroup to avoid this dead lock ? Anyway, I'll postpone this fix for a while. We should fix stale swap swapcache first. Thanks, Daisuke Nishimura. -- 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: email@kvack.org