Re: [PATCH] mm: Move maxable seq_file logic into a single place

2019-01-24 Thread Chris Down
I'm going to abandon this patch in favour of a patch series which does it without macros, but still reduces code duplication fairly significantly. I'll send it out shortly.

Re: [PATCH] mm: Move maxable seq_file logic into a single place

2019-01-24 Thread Chris Down
Johannes Weiner writes: I think this increases complexity more than it saves LOC, unfortunately. The current situation is a bit repetitive, but much more obviously correct. And we're not planning on adding many more of those memcg interface files, so I this doesn't seem to be an improvement re:

Re: [PATCH] mm: Move maxable seq_file logic into a single place

2019-01-24 Thread Johannes Weiner
On Thu, Jan 24, 2019 at 01:17:18AM -0500, Chris Down wrote: > 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. > > There's a fair amount of duplicated code here, since each file involves >

Re: [PATCH] mm: Move maxable seq_file logic into a single place

2019-01-24 Thread Michal Hocko
On Thu 24-01-19 01:17:18, Chris Down wrote: > 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. > > There's a fair amount of duplicated code here, since each file involves > turning a seq_file to

[PATCH] mm: Move maxable seq_file logic into a single place

2019-01-23 Thread Chris Down
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. There's a fair amount of duplicated code here, since each file involves turning a seq_file to a css, getting the memcg from the css, safely reading