mm, memcg: extract memcg maxable seq_file logic to seq_show_memcg_tunable
authorChris Down <chris@chrisdown.name>
Tue, 5 Mar 2019 23:45:55 +0000 (15:45 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 6 Mar 2019 05:07:17 +0000 (21:07 -0800)
commit677dc9731b54dccaaadbdcea18f8eecc95cee832
tree21784f11d6078f396b4c79b0b4221ae5f23b0555
parentaa9694bb78bf6eb03810108d5f6064fafa4ae1e1
mm, memcg: extract memcg maxable seq_file logic to seq_show_memcg_tunable

memcg has a significant number of files exposed to kernfs where their
value is either exposed directly or is "max" in the case of
PAGE_COUNTER_MAX.

This patch makes this generic by providing a single function to do this
work.  In combination with the previous patch adding
mem_cgroup_from_seq, this makes all of the seq_show feeder functions
significantly more simple.

Link: http://lkml.kernel.org/r/20190124194100.GA31425@chrisdown.name
Signed-off-by: Chris Down <chris@chrisdown.name>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Roman Gushchin <guro@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c