linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"xemul@openvz.org" <xemul@openvz.org>,
	"yamamoto@valinux.co.jp" <yamamoto@valinux.co.jp>,
	"hugh@veritas.com" <hugh@veritas.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC/PATCH 2/6] memcg: remove refcnt
Date: Thu, 15 May 2008 10:57:40 +0900	[thread overview]
Message-ID: <20080515105740.66e210db.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <482B950C.2060408@cn.fujitsu.com>

On Thu, 15 May 2008 09:42:36 +0800
Li Zefan <lizf@cn.fujitsu.com> wrote:

> >  /*
> > - * Uncharging is always a welcome operation, we never complain, simply
> > - * uncharge.
> > + * uncharge if !page_mapped(page)
> >   */
> > -void mem_cgroup_uncharge_page(struct page *page)
> > +void __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
> 
> static void ?
> 
Ah yes. will fix.

> > Index: linux-2.6.26-rc2/include/linux/memcontrol.h
> > ===================================================================
> > --- linux-2.6.26-rc2.orig/include/linux/memcontrol.h
> > +++ linux-2.6.26-rc2/include/linux/memcontrol.h
> > @@ -35,6 +35,8 @@ extern int mem_cgroup_charge(struct page
> >  extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
> >  					gfp_t gfp_mask);
> >  extern void mem_cgroup_uncharge_page(struct page *page);
> > +extern void mem_cgroup_uncharge_cache_page(struct page *page);
> > +extern int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask);
> 
> This function is defined and used in the 4th patch, so the declaration
> should be moved to that patch.
Ouch, I'll fix.


> 
> >  extern void mem_cgroup_move_lists(struct page *page, bool active);
> >  extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
> >  					struct list_head *dst,
> > @@ -53,7 +55,6 @@ extern struct mem_cgroup *mem_cgroup_fro
> >  extern int
> >  mem_cgroup_prepare_migration(struct page *page, struct page *newpage);
> >  extern void mem_cgroup_end_migration(struct page *page);
> > -extern int mem_cgroup_getref(struct page *page);
> >  
> >  /*
> >   * For memory reclaim.
> > @@ -97,6 +98,14 @@ static inline int mem_cgroup_cache_charg
> >  static inline void mem_cgroup_uncharge_page(struct page *page)
> >  {
> >  }
> 
> need a blank line here
> 
ok.

> > +static inline void mem_cgroup_uncharge_cache_page(struct page *page)
> > +{
> > +}
> > +
> 
> [..snip..]
> 
> >  #ifdef CONFIG_DEBUG_VM
> > Index: linux-2.6.26-rc2/mm/shmem.c
> > ===================================================================
> > --- linux-2.6.26-rc2.orig/mm/shmem.c
> > +++ linux-2.6.26-rc2/mm/shmem.c
> > @@ -961,13 +961,14 @@ found:
> >  		shmem_swp_unmap(ptr);
> >  	spin_unlock(&info->lock);
> >  	radix_tree_preload_end();
> > -uncharge:
> > -	mem_cgroup_uncharge_page(page);
> >  out:
> >  	unlock_page(page);
> >  	page_cache_release(page);
> >  	iput(inode);		/* allows for NULL */
> >  	return error;
> > +uncharge:
> > +	mem_cgroup_uncharge_cache_page(page);
> > +	goto out;
> >  }
> >  
> 
> Seems the logic is changed here. is it intended ?
> 
intended. (if success, uncharge is not necessary because there is no refcnt.
I'll add comment.

Thanks,
-Kame

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-05-15  1:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-14  8:02 [RFC/PATCH 0/6] memcg: peformance improvement at el. v3 KAMEZAWA Hiroyuki
2008-05-14  8:04 ` [RFC/PATCH 1/6] memcg: drop_pages at force_empty KAMEZAWA Hiroyuki
2008-05-14  8:07 ` [RFC/PATCH 2/6] memcg: remove refcnt KAMEZAWA Hiroyuki
2008-05-15  1:42   ` Li Zefan
2008-05-15  1:57     ` KAMEZAWA Hiroyuki [this message]
2008-05-15  3:34       ` KAMEZAWA Hiroyuki
2008-05-14  8:08 ` [RFC/PATCH 3/6] memcg: handle swapcache KAMEZAWA Hiroyuki
2008-05-14  8:10 ` [RFC/PATCH 4/6] memcg: shmem reclaim helper KAMEZAWA Hiroyuki
2008-05-14  8:15   ` Li Zefan
2008-05-14  8:25     ` KAMEZAWA Hiroyuki
2008-05-14  8:23       ` Li Zefan
2008-05-14  8:32         ` KAMEZAWA Hiroyuki
2008-05-14  8:11 ` [RFC/PATCH 5/6] memcg: optimize branch KAMEZAWA Hiroyuki
2008-05-14  8:13 ` [RFC/PATCH 6/6] memcg: remove redundant check at charge KAMEZAWA Hiroyuki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080515105740.66e210db.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=xemul@openvz.org \
    --cc=yamamoto@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox