lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu,  4 Dec 2008 16:15:37 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-mm <linux-mm@...ck.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Rik van Riel <riel@...hat.com>
Cc:	kosaki.motohiro@...fujitsu.com
Subject: Re: [PATCH 08/11] memcg: make zone_reclaim_stat


> > +struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg,
> > +						      struct zone *zone)
> > +{
> > +	int nid = zone->zone_pgdat->node_id;
> > +	int zid = zone_idx(zone);
> > +	struct mem_cgroup_per_zone *mz = mem_cgroup_zoneinfo(memcg, nid, zid);
> > +
> > +	return &mz->reclaim_stat;
> > +}
> > +
> > +struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat_by_page(struct page *page)
> > +{
> 
> I would prefer to use stat_from_page instead of stat_by_page, by page
> is confusing.

ok.
will fix.


> > @@ -172,6 +173,12 @@ void activate_page(struct page *page)
> > 
> >  		reclaim_stat->recent_rotated[!!file]++;
> >  		reclaim_stat->recent_scanned[!!file]++;
> > +
> > +		memcg_reclaim_stat = mem_cgroup_get_reclaim_stat_by_page(page);
> > +		if (memcg_reclaim_stat) {
> > +			memcg_reclaim_stat->recent_rotated[!!file]++;
> > +			memcg_reclaim_stat->recent_scanned[!!file]++;
> > +		}
> 
> Does it make sense to write two inline routines like
> 
> update_recent_rotated(page)
> {
>         zone = page_zone(page);
> 
>         zone->reclaim_stat->recent_rotated[!!file]++;
>         mem_reclaim_stat = mem_cgroup_get_reclaim_stat_by_page(page);
>         if (mem_reclaim_stat)
>                 mem_cg_reclaim_stat->recent_rotated[!!file]++;
>         ...
> 
> }
> 
> and similarly update_recent_reclaimed(page)

makes sense. good cleanup.

will fix.



> > Index: b/mm/vmscan.c
> > ===================================================================
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -134,6 +134,9 @@ static DECLARE_RWSEM(shrinker_rwsem);
> >  static struct zone_reclaim_stat *get_reclaim_stat(struct zone *zone,
> >  						  struct scan_control *sc)
> >  {
> > +	if (!scan_global_lru(sc))
> > +		mem_cgroup_get_reclaim_stat(sc->mem_cgroup, zone);
> 
> What do we gain by just calling mem_cgroup_get_reclaim_stat? Where do
> we return/use this value?

Agghh.
My last cleanup is _not_ cleanup..

thanks! will fix.





--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ