From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759954Ab2CVVgP (ORCPT ); Thu, 22 Mar 2012 17:36:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60911 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031091Ab2CVVgM (ORCPT ); Thu, 22 Mar 2012 17:36:12 -0400 Date: Thu, 22 Mar 2012 14:36:10 -0700 From: Andrew Morton To: KAMEZAWA Hiroyuki Cc: "linux-mm@kvack.org" , Linux Kernel , "cgroups@vger.kernel.org" , Hugh Dickins , "n-horiguchi@ah.jp.nec.com" , Johannes Weiner , Michal Hocko , Glauber Costa Subject: Re: [PATCH] memcg: change behavior of moving charges at task move Message-Id: <20120322143610.e4df49c9.akpm@linux-foundation.org> In-Reply-To: <4F69A4C4.4080602@jp.fujitsu.com> References: <4F69A4C4.4080602@jp.fujitsu.com> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) 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 On Wed, 21 Mar 2012 18:52:04 +0900 KAMEZAWA Hiroyuki wrote: > static struct page *mc_handle_swap_pte(struct vm_area_struct *vma, > unsigned long addr, pte_t ptent, swp_entry_t *entry) > { > - int usage_count; > struct page *page = NULL; > swp_entry_t ent = pte_to_swp_entry(ptent); > > if (!move_anon() || non_swap_entry(ent)) > return NULL; > - usage_count = mem_cgroup_count_swap_user(ent, &page); > - if (usage_count > 1) { /* we don't move shared anon */ > - if (page) > - put_page(page); > - return NULL; > - } > +#ifdef CONFIG_SWAP > + /* > + * Avoid lookup_swap_cache() not to update statistics. > + */ I don't understand this comment - what is it trying to tell us? > + page = find_get_page(&swapper_space, ent.val); The code won't even compile if CONFIG_SWAP=n? > +#endif > if (do_swap_account) > entry->val = ent.val; > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx149.postini.com [74.125.245.149]) by kanga.kvack.org (Postfix) with SMTP id 023786B0044 for ; Thu, 22 Mar 2012 17:36:12 -0400 (EDT) Date: Thu, 22 Mar 2012 14:36:10 -0700 From: Andrew Morton Subject: Re: [PATCH] memcg: change behavior of moving charges at task move Message-Id: <20120322143610.e4df49c9.akpm@linux-foundation.org> In-Reply-To: <4F69A4C4.4080602@jp.fujitsu.com> References: <4F69A4C4.4080602@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: KAMEZAWA Hiroyuki Cc: "linux-mm@kvack.org" , Linux Kernel , "cgroups@vger.kernel.org" , Hugh Dickins , "n-horiguchi@ah.jp.nec.com" , Johannes Weiner , Michal Hocko , Glauber Costa On Wed, 21 Mar 2012 18:52:04 +0900 KAMEZAWA Hiroyuki wrote: > static struct page *mc_handle_swap_pte(struct vm_area_struct *vma, > unsigned long addr, pte_t ptent, swp_entry_t *entry) > { > - int usage_count; > struct page *page = NULL; > swp_entry_t ent = pte_to_swp_entry(ptent); > > if (!move_anon() || non_swap_entry(ent)) > return NULL; > - usage_count = mem_cgroup_count_swap_user(ent, &page); > - if (usage_count > 1) { /* we don't move shared anon */ > - if (page) > - put_page(page); > - return NULL; > - } > +#ifdef CONFIG_SWAP > + /* > + * Avoid lookup_swap_cache() not to update statistics. > + */ I don't understand this comment - what is it trying to tell us? > + page = find_get_page(&swapper_space, ent.val); The code won't even compile if CONFIG_SWAP=n? > +#endif > if (do_swap_account) > entry->val = ent.val; > -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH] memcg: change behavior of moving charges at task move Date: Thu, 22 Mar 2012 14:36:10 -0700 Message-ID: <20120322143610.e4df49c9.akpm@linux-foundation.org> References: <4F69A4C4.4080602@jp.fujitsu.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F69A4C4.4080602-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: KAMEZAWA Hiroyuki Cc: "linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org" , Linux Kernel , "cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Hugh Dickins , "n-horiguchi-PaJj6Psr51x8UrSeD/g0lQ@public.gmane.org" , Johannes Weiner , Michal Hocko , Glauber Costa On Wed, 21 Mar 2012 18:52:04 +0900 KAMEZAWA Hiroyuki wrote: > static struct page *mc_handle_swap_pte(struct vm_area_struct *vma, > unsigned long addr, pte_t ptent, swp_entry_t *entry) > { > - int usage_count; > struct page *page = NULL; > swp_entry_t ent = pte_to_swp_entry(ptent); > > if (!move_anon() || non_swap_entry(ent)) > return NULL; > - usage_count = mem_cgroup_count_swap_user(ent, &page); > - if (usage_count > 1) { /* we don't move shared anon */ > - if (page) > - put_page(page); > - return NULL; > - } > +#ifdef CONFIG_SWAP > + /* > + * Avoid lookup_swap_cache() not to update statistics. > + */ I don't understand this comment - what is it trying to tell us? > + page = find_get_page(&swapper_space, ent.val); The code won't even compile if CONFIG_SWAP=n? > +#endif > if (do_swap_account) > entry->val = ent.val; >