On Thu, Nov 24, 2011 at 10:33:49AM +0100, Michal Hocko wrote: > On Wed 23-11-11 16:42:26, Johannes Weiner wrote: > > From: Johannes Weiner <jweiner@xxxxxxxxxx> > > > > The fault accounting functions have a single, memcg-internal user, so > > they don't need to be global. In fact, their one-line bodies can be > > directly folded into the caller. > > At first I thought that this doesn't help much because the generated > code should be exactly same but thinking about it some more it makes > sense. > We should have a single place where we account for events. Maybe we > should include also accounting done in mem_cgroup_charge_statistics > (this would however mean that mem_cgroup_count_vm_event would have to be > split). What do you think? I'm all for unifying all the stats crap into a single place. Optimally, we should have been able to put memcg hooks below count_vm_event* but maybe that ship has sailed with PGPGIN/PGPGOUT having different meanings between memcg and the rest of the system :/ Anything in that direction is improvement, IMO. > > And since faults happen one at a time, use this_cpu_inc() directly > > instead of this_cpu_add(foo, 1). > > The generated code will be same but it is easier to read, so agreed. And it fits within 80 columns :-) > > Signed-off-by: Johannes Weiner <jweiner@xxxxxxxxxx> > > Anyway > Acked-by: Michal Hocko <mhocko@xxxxxxx> Thanks. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. 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: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>