From mboxrd@z Thu Jan 1 00:00:00 1970 From: Balbir Singh Subject: Re: [RFC] memory controller : backgorund reclaim and avoid excessive locking [5/5] lazy page_cgroup freeing Date: Mon, 18 Feb 2008 10:05:16 +0530 Message-ID: <47B90B04.3090001@linux.vnet.ibm.com> References: <20080214172148.bfd564d5.kamezawa.hiroyu@jp.fujitsu.com> <20080214173624.d29b26d9.kamezawa.hiroyu@jp.fujitsu.com> Reply-To: balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20080214173624.d29b26d9.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: KAMEZAWA Hiroyuki Cc: "containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org" , "yamamoto-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org" , xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org List-Id: containers.vger.kernel.org KAMEZAWA Hiroyuki wrote: > A big lock contetion of memory controller is mz->lru_lock. > > This is acquired when > 1. add to lru > 2. remove from lru > 3. scan lru list > > It seems 1. and 3. are unavoidable. but 2. can be delayed. > > This patch make removing page_cgorup from lru-list be lazy and batched. > (Like pagevec..) > > This patch adds a new flag page_cgroup and make lru scan routine > ignores it. > > > I think this reduces lock contention especially when > - several tasks are exiting at once. > - several files are removed at once. > > > Signed-off-by: KAMEZAWA Hiroyuki > Hi, KAMEZAWA-San, For this and the next patch, do you know if there is a performance improvement? Have we measured it. The complexity of the code seems to be high, want to make sure it is worth it. Could we re-use the pagevec mechansim for LRU handling? That was my long term plan and I also wanted to move the kmalloc's to their own cache and use kmem_cache_alloc and try some other experiments. May be batching the alloc's for page_container can be done in the same way that you've proposed LRU and accounting changes. -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL