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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Jun 2011 09:33:00 +0200
From:	Michal Hocko <mhocko@...e.cz>
To:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"nishimura@....nes.nec.co.jp" <nishimura@....nes.nec.co.jp>,
	"bsingharora@...il.com" <bsingharora@...il.com>,
	Ying Han <yinghan@...gle.com>
Subject: Re: [PATCH] [Cleanup] memcg: export memory cgroup's swappiness v2

On Thu 30-06-11 16:10:39, KAMEZAWA Hiroyuki wrote:
> On Thu, 30 Jun 2011 08:32:32 +0200
> Michal Hocko <mhocko@...e.cz> wrote:
> 
> > On Thu 30-06-11 12:32:29, KAMEZAWA Hiroyuki wrote:
> > [...]
> > > @@ -4288,7 +4287,7 @@ static u64 mem_cgroup_swappiness_read(struct cgroup *cgrp, struct cftype *cft)
> > >  {
> > >  	struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp);
> > >  
> > > -	return get_swappiness(memcg);
> > > +	return mem_cgroup_swappiness(memcg);
> > >  }
> > 
> > If you want to be type clean you should change this one as well. I
> > think it is worth it, though. The function is called only to return the
> > current value to userspace and mem_cgroup_swappiness_write guaranties
> > that it falls down into <0,100> interval. Additionally, cftype doesn't
> > have any read specialization for int values so you would need to use a
> > generic one. Finally if you changed read part you should change also
> > write part and add > 0 check which is a lot of code for not that good
> > reason.
> 
> I don't want to make this type-clean. 

Agreed.

> Should I add type casting as
> ==
>  return (u64) mem_cgroup_swappiness(memcg);
> ==
> ?

I do not think it is necessary. The value is promoted to u64
automatically.

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic
--
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