From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753964Ab2GIOWa (ORCPT ); Mon, 9 Jul 2012 10:22:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41038 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767Ab2GIOW3 (ORCPT ); Mon, 9 Jul 2012 10:22:29 -0400 Date: Mon, 9 Jul 2012 16:22:27 +0200 From: Michal Hocko To: Johannes Weiner Cc: Andrew Morton , KAMEZAWA Hiroyuki , Hugh Dickins , David Rientjes , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [patch 02/11] mm: swapfile: clean up unuse_pte race handling Message-ID: <20120709142227.GE4627@tiehlicka.suse.cz> References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-3-git-send-email-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1341449103-1986-3-git-send-email-hannes@cmpxchg.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 05-07-12 02:44:54, Johannes Weiner wrote: > The conditional mem_cgroup_cancel_charge_swapin() is a leftover from > when the function would continue to reestablish the page even after > mem_cgroup_try_charge_swapin() failed. After 85d9fc8 "memcg: fix > refcnt handling at swapoff", the condition is always true when this > code is reached. > > Signed-off-by: Johannes Weiner Acked-by: Michal Hocko > --- > mm/swapfile.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 64408be..75881ca 100644 > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@ -845,8 +845,7 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd, > > pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); > if (unlikely(!pte_same(*pte, swp_entry_to_pte(entry)))) { > - if (ret > 0) > - mem_cgroup_cancel_charge_swapin(memcg); > + mem_cgroup_cancel_charge_swapin(memcg); > ret = 0; > goto out; > } > -- > 1.7.7.6 > -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx129.postini.com [74.125.245.129]) by kanga.kvack.org (Postfix) with SMTP id 414F96B006E for ; Mon, 9 Jul 2012 10:22:30 -0400 (EDT) Date: Mon, 9 Jul 2012 16:22:27 +0200 From: Michal Hocko Subject: Re: [patch 02/11] mm: swapfile: clean up unuse_pte race handling Message-ID: <20120709142227.GE4627@tiehlicka.suse.cz> References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-3-git-send-email-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1341449103-1986-3-git-send-email-hannes@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Andrew Morton , KAMEZAWA Hiroyuki , Hugh Dickins , David Rientjes , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org On Thu 05-07-12 02:44:54, Johannes Weiner wrote: > The conditional mem_cgroup_cancel_charge_swapin() is a leftover from > when the function would continue to reestablish the page even after > mem_cgroup_try_charge_swapin() failed. After 85d9fc8 "memcg: fix > refcnt handling at swapoff", the condition is always true when this > code is reached. > > Signed-off-by: Johannes Weiner Acked-by: Michal Hocko > --- > mm/swapfile.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 64408be..75881ca 100644 > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@ -845,8 +845,7 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd, > > pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); > if (unlikely(!pte_same(*pte, swp_entry_to_pte(entry)))) { > - if (ret > 0) > - mem_cgroup_cancel_charge_swapin(memcg); > + mem_cgroup_cancel_charge_swapin(memcg); > ret = 0; > goto out; > } > -- > 1.7.7.6 > -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [patch 02/11] mm: swapfile: clean up unuse_pte race handling Date: Mon, 9 Jul 2012 16:22:27 +0200 Message-ID: <20120709142227.GE4627@tiehlicka.suse.cz> References: <1341449103-1986-1-git-send-email-hannes@cmpxchg.org> <1341449103-1986-3-git-send-email-hannes@cmpxchg.org> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <1341449103-1986-3-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Johannes Weiner Cc: Andrew Morton , KAMEZAWA Hiroyuki , Hugh Dickins , David Rientjes , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Thu 05-07-12 02:44:54, Johannes Weiner wrote: > The conditional mem_cgroup_cancel_charge_swapin() is a leftover from > when the function would continue to reestablish the page even after > mem_cgroup_try_charge_swapin() failed. After 85d9fc8 "memcg: fix > refcnt handling at swapoff", the condition is always true when this > code is reached. > > Signed-off-by: Johannes Weiner Acked-by: Michal Hocko > --- > mm/swapfile.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 64408be..75881ca 100644 > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@ -845,8 +845,7 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd, > > pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); > if (unlikely(!pte_same(*pte, swp_entry_to_pte(entry)))) { > - if (ret > 0) > - mem_cgroup_cancel_charge_swapin(memcg); > + mem_cgroup_cancel_charge_swapin(memcg); > ret = 0; > goto out; > } > -- > 1.7.7.6 > -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic