Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Johannes Weiner
On Fri, Mar 05, 2021 at 08:42:00AM -0800, Shakeel Butt wrote: > On Fri, Mar 5, 2021 at 8:25 AM Johannes Weiner wrote: > > > [...] > > I'd also rename cgroup_memory_noswap to cgroup_swapaccount - to match > > the commandline and (hopefully) make a bit clearer what it effects. > > Do we really need

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Shakeel Butt
On Fri, Mar 5, 2021 at 8:25 AM Johannes Weiner wrote: > > On Fri, Mar 05, 2021 at 12:06:31AM -0800, Hugh Dickins wrote: > > On Wed, 3 Mar 2021, Shakeel Butt wrote: > > > > > Currently the kernel adds the page, allocated for swapin, to the > > > swapcache before charging the page. This is fine but

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Shakeel Butt
On Fri, Mar 5, 2021 at 8:25 AM Johannes Weiner wrote: > [...] > I'd also rename cgroup_memory_noswap to cgroup_swapaccount - to match > the commandline and (hopefully) make a bit clearer what it effects. Do we really need to keep supporting "swapaccount=0"? Is swap page_counter really a performan

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Johannes Weiner
On Fri, Mar 05, 2021 at 12:06:31AM -0800, Hugh Dickins wrote: > On Wed, 3 Mar 2021, Shakeel Butt wrote: > > > Currently the kernel adds the page, allocated for swapin, to the > > swapcache before charging the page. This is fine but now we want a > > per-memcg swapcache stat which is essential for

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Hugh Dickins
On Wed, 3 Mar 2021, Shakeel Butt wrote: > Currently the kernel adds the page, allocated for swapin, to the > swapcache before charging the page. This is fine but now we want a > per-memcg swapcache stat which is essential for folks who wants to > transparently migrate from cgroup v1's memsw to cgr

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-04 Thread Shakeel Butt
On Thu, Mar 4, 2021 at 7:48 AM Johannes Weiner wrote: > > On Wed, Mar 03, 2021 at 05:42:29PM -0800, Shakeel Butt wrote: > > Currently the kernel adds the page, allocated for swapin, to the > > swapcache before charging the page. This is fine but now we want a > > per-memcg swapcache stat which is

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-04 Thread Johannes Weiner
On Wed, Mar 03, 2021 at 05:42:29PM -0800, Shakeel Butt wrote: > Currently the kernel adds the page, allocated for swapin, to the > swapcache before charging the page. This is fine but now we want a > per-memcg swapcache stat which is essential for folks who wants to > transparently migrate from cgr

[PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-03 Thread Shakeel Butt
Currently the kernel adds the page, allocated for swapin, to the swapcache before charging the page. This is fine but now we want a per-memcg swapcache stat which is essential for folks who wants to transparently migrate from cgroup v1's memsw to cgroup v2's memory and swap counters. In addition ch