Re: [PATCH 2/3] mm/memcg: Simplify mem_cgroup_get_max()

2020-08-20 Thread Johannes Weiner
On Thu, Aug 20, 2020 at 09:03:49AM -0400, Waiman Long wrote: > The mem_cgroup_get_max() function used to get memory+swap max from > both the v1 memsw and v2 memory+swap page counters & return the maximum > of these 2 values. This is redundant and it is more efficient to just > get either the v1 or

Re: [PATCH 1/3] mm/memcg: Clean up obsolete enum charge_type

2020-08-20 Thread Johannes Weiner
er, the enum itself > was not removed at that time. Remove the obsolete enum charge_type now. > > Signed-off-by: Waiman Long Acked-by: Johannes Weiner

Re: [RFC PATCH 0/8] memcg: Enable fine-grained per process memory control

2020-08-18 Thread Johannes Weiner
On Tue, Aug 18, 2020 at 12:18:44PM +0200, pet...@infradead.org wrote: > What you need is a feeback loop against the rate of freeing pages, and > when you near the saturation point, the allocation rate should exactly > match the freeing rate. IO throttling solves a slightly different problem. IO o

Re: upstream boot error: WARNING in mem_cgroup_css_alloc

2020-08-13 Thread Johannes Weiner
On Thu, Aug 13, 2020 at 12:44:16PM +0200, Michal Hocko wrote: > This smells like 3e38e0aaca9e ("mm: memcg: charge memcg percpu memory to > the parent cgroup"). I just replied to the other thread on this issue here: https://lore.kernel.org/lkml/20200813152033.ga701...@cmpxchg.org/

Re: linux-next: runtime warning in Linus' tree

2020-08-13 Thread Johannes Weiner
atch in linux-next up tuntil today > is different. :-( Sorry, I made a last-minute request to include these checks in that patch to make the code a bit more robust, but they trigger a false positive here. Let's remove them. --- >From de8ea7c96c056c3cbe7b93995029986a158fb9cd Mon Sep 17 00:00

Re: [PATCH v3 4/5] mm: memcg: charge memcg percpu memory to the parent cgroup

2020-08-11 Thread Johannes Weiner
ount the consumed percpu memory to the parent cgroup. > > Signed-off-by: Roman Gushchin > Acked-by: Dennis Zhou Acked-by: Johannes Weiner This makes sense, and the accounting is in line with how we track and distribute child creation quotas (cgroup.max.descendants and cgroup.max.depth) up t

Re: [PATCH v3 3/5] mm: memcg/percpu: per-memcg percpu memory statistics

2020-08-11 Thread Johannes Weiner
> > Signed-off-by: Roman Gushchin > Acked-by: Dennis Zhou Acked-by: Johannes Weiner

Re: [PATCH v7 05/19] mm: memcontrol: decouple reference counting from page accounting

2020-08-03 Thread Johannes Weiner
On Mon, Aug 03, 2020 at 11:00:33AM +0200, Michal Hocko wrote: > On Tue 23-06-20 10:40:23, Roman Gushchin wrote: > > @@ -5456,7 +5460,10 @@ static int mem_cgroup_move_account(struct page *page, > > */ > > smp_mb(); > > > > - page->mem_cgroup = to; /* caller should have done css_get */

Re: [PATCH] mm/memcg: remove useless check on page->mem_cgroup

2020-07-31 Thread Johannes Weiner
On Fri, Jul 31, 2020 at 11:34:40AM +0800, Alex Shi wrote: > Since readahead page will be charged on memcg too. We don't need to > check this exception now. Rmove them is safe as all user pages are > charged before use. > > Signed-off-by: Alex Shi > Cc: Johannes Weiner &

Re: [PATCH mmotm] mm: memcontrol: decouple reference counting from page accounting fix

2020-07-31 Thread Johannes Weiner
references along with the page (move_account), and swap entries use the mem_cgroup_id references which pin the css indirectly. Leaving that css_put_many behind in the swap path was an oversight. Acked-by: Johannes Weiner > --- > Fixes mm-memcontrol-decouple-reference-counting-from-page-ac

[PATCH] mm: memcontrol: restore proper dirty throttling when memory.high changes

2020-07-28 Thread Johannes Weiner
high") Signed-off-by: Johannes Weiner --- mm/memcontrol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 13f559af1ab6..805a44bf948c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6071,6 +6071,7 @@ static ssize_t memory_high_write(str

[PATCH] mm: memcontrol: don't count limit-setting reclaim as memory pressure

2020-07-28 Thread Johannes Weiner
allocation context, and thereby no longer count any limit-setting reclaim as memory pressure. If the newly set limit causes the workload inside the cgroup into direct reclaim, that of course will continue to count as memory pressure. Signed-off-by: Johannes Weiner --- mm/memcontrol.c | 12

Re: PROBLEM: cgroup cost too much memory when transfer small files to tmpfs

2020-07-21 Thread Johannes Weiner
On Tue, Jul 21, 2020 at 11:19:52AM +, jingrui wrote: > Cc: Johannes Weiner ; Michal Hocko ; > Vladimir Davydov > > Thanks. > > --- > PROBLEM: cgroup cost too much memory when transfer small files to tmpfs. > > keywords: cgroup PERCPU/memory cost too much. >

Re: [PATCH v6 5/6] mm/swap: implement workingset detection for anonymous LRU

2020-07-17 Thread Johannes Weiner
ling/retrieving > the shadow entry. > > Signed-off-by: Joonsoo Kim Acked-by: Johannes Weiner

Re: [PATCH v6 2/6] mm/vmscan: protect the workingset on anonymous LRU

2020-07-17 Thread Johannes Weiner
On Wed, Jun 17, 2020 at 02:26:19PM +0900, js1...@gmail.com wrote: > From: Joonsoo Kim > > In current implementation, newly created or swap-in anonymous page > is started on active list. Growing active list results in rebalancing > active/inactive list so old pages on active list are demoted to in

Re: [PATCH] mm: memcontrol: avoid workload stalls when lowering memory.high

2020-07-15 Thread Johannes Weiner
On Tue, Jul 14, 2020 at 10:06:32AM -0700, Shakeel Butt wrote: > On Tue, Jul 14, 2020 at 8:39 AM Johannes Weiner wrote: > > The way we do this right now is having the reclaimer daemon in a > > dedicated top-level cgroup with memory.min protection. > > > > This w

Re: [PATCH v2 1/2] mm, memcg: reclaim more aggressively before high allocator throttling

2020-07-14 Thread Johannes Weiner
nefit: it unifies the reclaim behaviour between > the two. > > There's precedent for this behaviour: we already do reclaim retries when > writing to memory.{high,max}, in max reclaim, and in the page allocator > itself. > > Signed-off-by: Chris Down > Cc: Andrew Morton > Cc: Johannes Weiner > Cc: Tejun Heo > Cc: Michal Hocko Acked-by: Johannes Weiner

Re: [PATCH] mm: memcontrol: avoid workload stalls when lowering memory.high

2020-07-14 Thread Johannes Weiner
On Fri, Jul 10, 2020 at 12:19:37PM -0700, Shakeel Butt wrote: > On Fri, Jul 10, 2020 at 11:42 AM Roman Gushchin wrote: > > > > On Fri, Jul 10, 2020 at 07:12:22AM -0700, Shakeel Butt wrote: > > > On Fri, Jul 10, 2020 at 5:29 AM Michal Hocko wrote: > > > > > > > > On Thu 09-07-20 12:47:18, Roman Gu

Re: [PATCH for 5.8] mm: do_swap_page fix up the error code instantiation

2020-06-17 Thread Johannes Weiner
iation") > Signed-off-by: Michal Hocko Good catch, thanks Michal. Acked-by: Johannes Weiner

Re: [PATCH for v5.8 3/3] mm/memory: fix IO cost for anonymous page

2020-06-16 Thread Johannes Weiner
ly biased. Fix it to count it > in fault code. > > Signed-off-by: Joonsoo Kim Acked-by: Johannes Weiner

Re: [PATCH for v5.8 2/3] mm/swap: fix for "mm: workingset: age nonresident information alongside anonymous pages"

2020-06-16 Thread Johannes Weiner
it's better for this patch to be squashed into the patch > "mm: workingset: age nonresident information alongside anonymous pages". > > Signed-off-by: Joonsoo Kim Acked-by: Johannes Weiner

Re: [mm] 1431d4d11a: vm-scalability.throughput -11.5% regression

2020-06-16 Thread Johannes Weiner
On Tue, Jun 16, 2020 at 03:57:50PM +0800, kernel test robot wrote: > Greeting, > > FYI, we noticed a -11.5% regression of vm-scalability.throughput due to > commit: > > > commit: 1431d4d11abb265e79cd44bed2f5ea93f1bcc57b ("mm: base LRU balancing on > an explicit cost model") > https://git.kerne

[PATCH] mm: memcontrol: handle div0 crash race condition in memory.low

2020-06-15 Thread Johannes Weiner
ed to handle the div0 case. Check the parent state explicitly to make sure we have a reasonable positive value for the divisor. Fixes: 8a931f801340 ("mm: memcontrol: recursive memory.low protection") Reported-by: Tejun Heo Cc: Signed-off-by: Johannes Weiner --- mm/memcontrol.c | 9 ++

Re: [PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-06-15 Thread Johannes Weiner
On Fri, Jun 12, 2020 at 12:19:58PM +0900, Joonsoo Kim wrote: > 2020년 6월 5일 (금) 오전 12:06, Johannes Weiner 님이 작성: > > > > On Thu, Jun 04, 2020 at 03:35:27PM +0200, Vlastimil Babka wrote: > > > On 6/1/20 10:44 PM, Johannes Weiner wrote: > > > > From a8faceabc1454df

Re: [patch 113/131] mm: balance LRU lists based on relative thrashing

2020-06-09 Thread Johannes Weiner
On Tue, Jun 09, 2020 at 05:15:33PM +0800, Alex Shi wrote: > > > 在 2020/6/4 上午7:03, Andrew Morton 写道: > > > > + /* XXX: Move to lru_cache_add() when it supports new vs putback */ > > Hi Hannes, > > Sorry for a bit lost, would you like to explain a bit more of your idea here? > > > + spin_

Re: [PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-06-04 Thread Johannes Weiner
On Thu, Jun 04, 2020 at 03:35:27PM +0200, Vlastimil Babka wrote: > On 6/1/20 10:44 PM, Johannes Weiner wrote: > > From a8faceabc1454dfd878caee2a8422493d937a394 Mon Sep 17 00:00:00 2001 > > From: Johannes Weiner > > Date: Mon, 1 Jun 2020 14:04:09 -0400 > > Subject:

Re: [PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-06-02 Thread Johannes Weiner
On Tue, Jun 02, 2020 at 11:34:17AM +0900, Joonsoo Kim wrote: > 2020년 6월 2일 (화) 오전 12:56, Johannes Weiner 님이 작성: > > On Mon, Jun 01, 2020 at 03:14:24PM +0900, Joonsoo Kim wrote: > > > But, I still think that modified refault activation equation isn't > > > safe. T

Re: [PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-06-01 Thread Johannes Weiner
On Mon, Jun 01, 2020 at 11:56:17AM -0400, Johannes Weiner wrote: > On Mon, Jun 01, 2020 at 03:14:24PM +0900, Joonsoo Kim wrote: > > 2020년 5월 30일 (토) 오전 12:12, Johannes Weiner 님이 작성: > > > However, your example cannot have a completely silent stable state. As > > > we

Re: [PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-06-01 Thread Johannes Weiner
On Mon, Jun 01, 2020 at 03:14:24PM +0900, Joonsoo Kim wrote: > 2020년 5월 30일 (토) 오전 12:12, Johannes Weiner 님이 작성: > > > > On Fri, May 29, 2020 at 03:48:00PM +0900, Joonsoo Kim wrote: > > > 2020년 5월 29일 (금) 오전 2:02, Johannes Weiner 님이 작성: > > > > On Thu, May 28, 2

Re: [PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-05-29 Thread Johannes Weiner
On Fri, May 29, 2020 at 03:48:00PM +0900, Joonsoo Kim wrote: > 2020년 5월 29일 (금) 오전 2:02, Johannes Weiner 님이 작성: > > On Thu, May 28, 2020 at 04:16:50PM +0900, Joonsoo Kim wrote: > > > 2020년 5월 27일 (수) 오후 10:43, Johannes Weiner 님이 작성: > > > > On Wed, May 27, 2020 at

Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling

2020-05-28 Thread Johannes Weiner
On Thu, May 28, 2020 at 08:48:31PM +0100, Chris Down wrote: > Shakeel Butt writes: > > What was the initial reason to have different behavior in the first place? > > This differing behaviour is simply a mistake, it was never intended to be > this deviate from what happens elsewhere. To that extent

Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling

2020-05-28 Thread Johannes Weiner
On Thu, May 28, 2020 at 06:31:01PM +0200, Michal Hocko wrote: > On Thu 21-05-20 14:45:05, Johannes Weiner wrote: > > After analyzing this problem, it's clear that we had an oversight > > here: all other reclaimers are already familiar with the fact that > > reclaim may n

Re: [PATCH] mm: memcontrol: fix an unused-function warning

2020-05-28 Thread Johannes Weiner
; > Hide this function in a matching #ifdef. > > Fixes: 5bd144bf764c ("mm: memcontrol: drop unused try/commit/cancel charge > API") > Signed-off-by: Arnd Bergmann Acked-by: Johannes Weiner Thanks Arnd!

Re: [PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-05-28 Thread Johannes Weiner
On Thu, May 28, 2020 at 04:16:50PM +0900, Joonsoo Kim wrote: > 2020년 5월 27일 (수) 오후 10:43, Johannes Weiner 님이 작성: > > > > On Wed, May 27, 2020 at 11:06:47AM +0900, Joonsoo Kim wrote: > > > 2020년 5월 21일 (목) 오전 8:26, Johannes Weiner 님이 작성: > > > > > >

Re: [PATCH v4 06/19] mm: memcg/slab: obj_cgroup API

2020-05-27 Thread Johannes Weiner
On Tue, May 26, 2020 at 02:42:14PM -0700, Roman Gushchin wrote: > @@ -257,6 +257,98 @@ struct cgroup_subsys_state *vmpressure_to_css(struct > vmpressure *vmpr) > } > > #ifdef CONFIG_MEMCG_KMEM > +extern spinlock_t css_set_lock; > + > +static void obj_cgroup_release(struct percpu_ref *ref) > +{

Re: [PATCH v4 04/19] mm: slub: implement SLUB version of obj_to_index()

2020-05-27 Thread Johannes Weiner
kes a page address. obj_to_index() > will be a simple wrapper taking a page pointer and passing > page_address(page) into __obj_to_index(). > > Signed-off-by: Roman Gushchin > Reviewed-by: Vlastimil Babka Acked-by: Johannes Weiner

Re: [PATCH resend 3/3] mm: fix LRU balancing effect of new transparent huge pages

2020-05-27 Thread Johannes Weiner
On Wed, May 27, 2020 at 11:29:58AM -0700, Shakeel Butt wrote: > From: Johannes Weiner > > Currently, THP are counted as single pages until they are split right > before being swapped out. However, at that point the VM is already in > the middle of reclaim, and adjusting the LRU

Re: [PATCH cgroup/for-5.8] cgroup: add cpu.stat file to root cgroup

2020-05-27 Thread Johannes Weiner
On Tue, May 26, 2020 at 01:08:00PM -0700, Boris Burkov wrote: > Currently, the root cgroup does not have a cpu.stat file. Add one which > is consistent with /proc/stat to capture global cpu statistics that > might not fall under cgroup accounting. > > We haven't done this in the past because the d

Re: [PATCH 04/12] mm: add support for async page locking

2020-05-27 Thread Johannes Weiner
On Tue, May 26, 2020 at 04:01:07PM -0600, Jens Axboe wrote: > On 5/26/20 3:59 PM, Johannes Weiner wrote: > > On Tue, May 26, 2020 at 01:51:15PM -0600, Jens Axboe wrote: > >> Normally waiting for a page to become unlocked, or locking the page, > >> requires waiting for

Re: [PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-05-27 Thread Johannes Weiner
On Wed, May 27, 2020 at 11:06:47AM +0900, Joonsoo Kim wrote: > 2020년 5월 21일 (목) 오전 8:26, Johannes Weiner 님이 작성: > > > > We activate cache refaults with reuse distances in pages smaller than > > the size of the total cache. This allows new pages with competitive > > acce

Re: [PATCH 11/12] mm: add kiocb_wait_page_queue_init() helper

2020-05-26 Thread Johannes Weiner
On Tue, May 26, 2020 at 01:51:22PM -0600, Jens Axboe wrote: > Checks if the file supports it, and initializes the values that we need. > Caller passes in 'data' pointer, if any, and the callback function to > be used. > > Signed-off-by: Jens Axboe Acked-by: Johannes Weiner

Re: [PATCH 05/12] mm: support async buffered reads in generic_file_buffered_read()

2020-05-26 Thread Johannes Weiner
RECT signals the same operation. Once the callback is received by > the caller for IO completion, the caller must retry the operation. > > Signed-off-by: Jens Axboe Acked-by: Johannes Weiner

Re: [PATCH 04/12] mm: add support for async page locking

2020-05-26 Thread Johannes Weiner
s made public, > and we define struct wait_page_async as the interface between the caller > and the core. > > Signed-off-by: Jens Axboe Acked-by: Johannes Weiner

Re: [PATCH 03/12] mm: abstract out wake_page_match() from wake_page_function()

2020-05-26 Thread Johannes Weiner
On Tue, May 26, 2020 at 01:51:14PM -0600, Jens Axboe wrote: > No functional changes in this patch, just in preparation for allowing > more callers. > > Signed-off-by: Jens Axboe Acked-by: Johannes Weiner

Re: [PATCH 02/12] mm: allow read-ahead with IOCB_NOWAIT set

2020-05-26 Thread Johannes Weiner
On Tue, May 26, 2020 at 01:51:13PM -0600, Jens Axboe wrote: > The read-ahead shouldn't block, so allow it to be done even if > IOCB_NOWAIT is set in the kiocb. > > Signed-off-by: Jens Axboe Acked-by: Johannes Weiner Looks reasonable. Especially after patch 1 - although i

Re: [PATCH] mm,thp: stop leaking unreleased file pages

2020-05-26 Thread Johannes Weiner
n-shmem) FS") > Cc: sta...@vger.kernel.org # v5.4+ Acked-by: Johannes Weiner

Re: [PATCH 09/14] mm: deactivations shouldn't bias the LRU balance

2020-05-26 Thread Johannes Weiner
On Fri, May 22, 2020 at 09:33:35AM -0400, Qian Cai wrote: > On Wed, May 20, 2020 at 07:25:20PM -0400, Johannes Weiner wrote: > > Operations like MADV_FREE, FADV_DONTNEED etc. currently move any > > affected active pages to the inactive list to accelerate their reclaim > >

Re: [PATCH mmotm] mm/swap: fix livelock in __read_swap_cache_async()

2020-05-26 Thread Johannes Weiner
cache allocation (e.g. highmem) to radix node allocation (lowmem), but > we don't need or usually apply that mask when charging mem_cgroup. > > Signed-off-by: Hugh Dickins > --- Acked-by: Johannes Weiner > Mostly fixing mm-memcontrol-charge-swapin-pages-on-instantiation.pa

Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page

2020-05-21 Thread Johannes Weiner
On Thu, May 21, 2020 at 01:06:28PM -0700, Hugh Dickins wrote: > On Thu, 21 May 2020, Johannes Weiner wrote: > > do_memsw_account() used to be automatically false when the cgroup > > controller was disabled. Now that it's replaced by > > cgroup_memory_noswap, for which

Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page

2020-05-21 Thread Johannes Weiner
8304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, > > > > 4096000, 7962624, 11239424, 2048, 23887872, 71663616, 78675968, > > > > 10240, 214990848 > > > > Allocating group tables:0/7453 done > > > > W

Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling

2020-05-21 Thread Johannes Weiner
On Thu, May 21, 2020 at 07:37:01PM +0200, Michal Hocko wrote: > On Thu 21-05-20 12:38:33, Johannes Weiner wrote: > > On Thu, May 21, 2020 at 04:35:15PM +0200, Michal Hocko wrote: > > > On Thu 21-05-20 09:51:52, Johannes Weiner wrote: > > > > On Thu, May 21, 2020 at

Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling

2020-05-21 Thread Johannes Weiner
On Thu, May 21, 2020 at 04:35:15PM +0200, Michal Hocko wrote: > On Thu 21-05-20 09:51:52, Johannes Weiner wrote: > > On Thu, May 21, 2020 at 09:32:45AM +0200, Michal Hocko wrote: > [...] > > > I am not saying the looping over try_to_free_pages is wrong. I do care > >

Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling

2020-05-21 Thread Johannes Weiner
On Thu, May 21, 2020 at 09:51:55AM -0400, Johannes Weiner wrote: > On Thu, May 21, 2020 at 09:32:45AM +0200, Michal Hocko wrote: > > I wouldn't mind to loop over try_to_free_pages to meet the requested > > memcg_nr_pages_over_high target. > > Should we do the same for gl

Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling

2020-05-21 Thread Johannes Weiner
On Thu, May 21, 2020 at 09:32:45AM +0200, Michal Hocko wrote: > On Wed 20-05-20 13:51:35, Johannes Weiner wrote: > > On Wed, May 20, 2020 at 07:04:30PM +0200, Michal Hocko wrote: > > > On Wed 20-05-20 12:51:31, Johannes Weiner wrote: > > > > On Wed, May 20, 2020 at

[PATCH 04/14] mm: fold and remove lru_cache_add_anon() and lru_cache_add_file()

2020-05-20 Thread Johannes Weiner
They're the same function, and for the purpose of all callers they are equivalent to lru_cache_add(). Signed-off-by: Johannes Weiner Reviewed-by: Rik van Riel Acked-by: Michal Hocko Acked-by: Minchan Kim --- fs/cifs/file.c | 10 +- fs/fuse/dev.c| 2 +- include/

[PATCH 01/14] mm: fix LRU balancing effect of new transparent huge pages

2020-05-20 Thread Johannes Weiner
path. Signed-off-by: Johannes Weiner Reviewed-by: Rik van Riel Acked-by: Michal Hocko Acked-by: Minchan Kim --- mm/swap.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index bf9a79fed62d..68eae1e2787a 100644 --- a/mm

[PATCH 14/14] mm: vmscan: limit the range of LRU type balancing

2020-05-20 Thread Johannes Weiner
27;s being pressured, while still allowing a generous rate of convergence when the relative sizes of the lists need to adjust. Signed-off-by: Johannes Weiner --- mm/vmscan.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/mm/vmscan.c b/mm/vmsc

[PATCH 08/14] mm: base LRU balancing on an explicit cost model

2020-05-20 Thread Johannes Weiner
faulting of recently evicted pages. Replace struct zone_reclaim_stat with two cost counters in the lruvec, and make everything that affects cost go through a new lru_note_cost() function. v2: remove superfluous cost denominator (Minchan Kim) improve cost variable naming (Michal Hocko) Sig

[PATCH 10/14] mm: only count actual rotations as LRU reclaim cost

2020-05-20 Thread Johannes Weiner
chal Hocko) Signed-off-by: Johannes Weiner Acked-by: Minchan Kim Acked-by: Michal Hocko --- mm/vmscan.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 6ff63906a288..2c3fb8dd1159 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2054

[PATCH 12/14] mm: vmscan: determine anon/file pressure balance at the reclaim root

2020-05-20 Thread Johannes Weiner
en thrashing on the cache, it will tip the pressure balance inside its ancestors, and the next hierarchical reclaim iteration will go more after the anon pages in the tree. Signed-off-by: Johannes Weiner --- include/linux/memcontrol.h | 13 mm/swap.c

[PATCH 11/14] mm: balance LRU lists based on relative thrashing

2020-05-20 Thread Johannes Weiner
the least amount of IO on aggregate. Signed-off-by: Johannes Weiner --- include/linux/swap.h | 3 +-- mm/swap.c| 11 +++ mm/swap_state.c | 5 + mm/vmscan.c | 39 ++- mm/workingset.c | 4 5 files changed, 27

[PATCH 03/14] mm: allow swappiness that prefers reclaiming anon over the file workingset

2020-05-20 Thread Johannes Weiner
st of cache misses between page cache and swap-backed pages - to reflect such situations by making the swap-preferred range configurable. v2: clarify how to calculate swappiness (Minchan Kim) Signed-off-by: Johannes Weiner --- Documentation/admin-guide/sysctl/vm.rst | 23 ++- k

[PATCH 09/14] mm: deactivations shouldn't bias the LRU balance

2020-05-20 Thread Johannes Weiner
that spirit, leave explicitely deactivated pages to the LRU algorithm to pick up, and let rotations decide which list is the easiest to reclaim. Signed-off-by: Johannes Weiner Acked-by: Minchan Kim Acked-by: Michal Hocko --- mm/swap.c | 4 1 file changed, 4 deletions(-) diff --git a/mm/swa

[PATCH 07/14] mm: vmscan: drop unnecessary div0 avoidance rounding in get_scan_count()

2020-05-20 Thread Johannes Weiner
't be. ap + fp is always at least 1. Drop the + 1. Signed-off-by: Johannes Weiner --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 43f88b1a4f14..6cd1029ea9d4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2348,7 +2348,7

[PATCH 13/14] mm: vmscan: reclaim writepage is IO cost

2020-05-20 Thread Johannes Weiner
ies in swap unless the page changes. If there is swap-backed data that's mostly read (tmpfs file) and has been swapped out before, we can reclaim it without incurring additional IO. Signed-off-by: Johannes Weiner --- include/linux/swap.h | 4 +++- include/linux/vmstat.h | 1 + mm/swap.c

[PATCH 06/14] mm: remove use-once cache bias from LRU balancing

2020-05-20 Thread Johannes Weiner
ly as long as there is used-once cache present, and will apply the LRU balancing when only repeatedly accessed cache pages are left - at which point the previous use-once bias will have been neutralized. This makes the use-once cache balancing bias unnecessary. Signed-off-by: Johannes Weiner

[PATCH 02/14] mm: keep separate anon and file statistics on page reclaim activity

2020-05-20 Thread Johannes Weiner
), followed by vmstats, reclaim_stats, and then vm events. Signed-off-by: Johannes Weiner --- include/linux/vm_event_item.h | 4 mm/vmscan.c | 17 + mm/vmstat.c | 4 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/linux

[PATCH 05/14] mm: workingset: let cache workingset challenge anon

2020-05-20 Thread Johannes Weiner
iding random IO from swap and go harder after cache. But fundamentally, hot cache should be able to compete with anon pages for a place in RAM. Signed-off-by: Johannes Weiner --- mm/workingset.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/mm/workingset.c

[PATCH 00/14] mm: balance LRU lists based on relative thrashing v2

2020-05-20 Thread Johannes Weiner
The reclaim code that balances between swapping and cache reclaim tries to predict likely reuse based on in-memory reference patterns alone. This works in many cases, but when it fails it cannot detect when the cache is thrashing pathologically, or when we're in the middle of a swap storm. The hig

Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling

2020-05-20 Thread Johannes Weiner
On Wed, May 20, 2020 at 07:04:30PM +0200, Michal Hocko wrote: > On Wed 20-05-20 12:51:31, Johannes Weiner wrote: > > On Wed, May 20, 2020 at 06:07:56PM +0200, Michal Hocko wrote: > > > On Wed 20-05-20 15:37:12, Chris Down wrote: > > > > In Facebook production, we&#x

Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling

2020-05-20 Thread Johannes Weiner
On Wed, May 20, 2020 at 06:07:56PM +0200, Michal Hocko wrote: > On Wed 20-05-20 15:37:12, Chris Down wrote: > > In Facebook production, we've seen cases where cgroups have been put > > into allocator throttling even when they appear to have a lot of slack > > file caches which should be trivially r

Re: [PATCH] memcg: expose root cgroup's memory.stat

2020-05-15 Thread Johannes Weiner
On Fri, May 15, 2020 at 10:49:22AM -0700, Shakeel Butt wrote: > On Fri, May 15, 2020 at 8:00 AM Roman Gushchin wrote: > > On Fri, May 15, 2020 at 06:44:44AM -0700, Shakeel Butt wrote: > > > On Fri, May 15, 2020 at 6:24 AM Johannes Weiner > > > wrote: > > > &

Re: [PATCH] memcg: expose root cgroup's memory.stat

2020-05-15 Thread Johannes Weiner
On Fri, May 15, 2020 at 10:29:55AM +0200, Michal Hocko wrote: > On Sat 09-05-20 07:06:38, Shakeel Butt wrote: > > On Fri, May 8, 2020 at 2:44 PM Johannes Weiner wrote: > > > > > > On Fri, May 08, 2020 at 10:06:30AM -0700, Shakeel Butt wrote: > > > > One

Re: [PATCH] vfs: keep inodes with page cache off the inode shrinker LRU

2020-05-14 Thread Johannes Weiner
On Wed, May 13, 2020 at 02:15:19PM -0700, Andrew Morton wrote: > On Tue, 12 May 2020 17:29:36 -0400 Johannes Weiner wrote: > > > > > ... > > > > Solution > > > > This patch fixes the aging inversion described above on > > !CONFIG_HIGHMEM system

Re: [PATCH] vfs: keep inodes with page cache off the inode shrinker LRU

2020-05-14 Thread Johannes Weiner
On Wed, May 13, 2020 at 07:24:10PM -0700, Andrew Morton wrote: > On Tue, 12 May 2020 17:29:36 -0400 Johannes Weiner wrote: > > > + inode_pages_clear(mapping->inode); > > + else if (populated == 1) > > + inode_pages_set(mapping->inode); >

Re: [PATCH] vfs: keep inodes with page cache off the inode shrinker LRU

2020-05-13 Thread Johannes Weiner
On Wed, May 13, 2020 at 09:32:58AM +0800, Yafang Shao wrote: > On Wed, May 13, 2020 at 5:29 AM Johannes Weiner wrote: > > > > On Tue, Feb 11, 2020 at 12:55:07PM -0500, Johannes Weiner wrote: > > > The VFS inode shrinker is currently allowed to reclaim inodes with > >

Re: [PATCH 00/19 V2] mm: memcontrol: charge swapin pages on instantiation

2020-05-13 Thread Johannes Weiner
Hello Balbir! On Wed, May 13, 2020 at 11:30:32AM +, Balbir Singh wrote: > On Fri, May 08, 2020 at 02:30:47PM -0400, Johannes Weiner wrote: > > To eliminate the page->mapping dependency, memcg needs to ditch its > > private page type counters (MEMCG_CACHE, MEMCG_RSS, NR_SHME

Re: [PATCH v3 06/19] mm: memcg/slab: obj_cgroup API

2020-05-12 Thread Johannes Weiner
On Thu, May 07, 2020 at 03:26:31PM -0700, Roman Gushchin wrote: > On Thu, May 07, 2020 at 05:03:14PM -0400, Johannes Weiner wrote: > > On Wed, Apr 22, 2020 at 01:46:55PM -0700, Roman Gushchin wrote: > > > --- a/mm/memcontrol.c > > > +++ b/mm/memcontrol.c > &

Re: [PATCH 12/19] mm: memcontrol: convert anon and file-thp to new mem_cgroup_charge() API

2020-05-12 Thread Johannes Weiner
On Tue, May 12, 2020 at 10:38:54AM -0400, Qian Cai wrote: > > On May 8, 2020, at 2:30 PM, Johannes Weiner wrote: > > > > With the page->mapping requirement gone from memcg, we can charge anon > > and file-thp pages in one single step, right after they're allocate

Re: [PATCH] vfs: keep inodes with page cache off the inode shrinker LRU

2020-05-12 Thread Johannes Weiner
On Tue, Feb 11, 2020 at 12:55:07PM -0500, Johannes Weiner wrote: > The VFS inode shrinker is currently allowed to reclaim inodes with > populated page cache. As a result it can drop gigabytes of hot and > active page cache on the floor without consulting the VM (recorded as > "i

Re: mmotm 2020-05-11-15-43 uploaded (mm/memcontrol.c, huge pages)

2020-05-12 Thread Johannes Weiner
unters, memcg doesn't see the pages, it only gets a count of THPs. To translate that to bytes, it has to know how big the THPs are - and that's only available for CONFIG_THP. Add the necessary ifdefs. /proc/meminfo, smaps etc. also don't show the THP counters when the feature is compiled

Re: [PATCH 05/18] mm: memcontrol: convert page cache to a new mem_cgroup_charge() API

2020-05-11 Thread Johannes Weiner
On Mon, May 11, 2020 at 02:10:58PM -0400, Johannes Weiner wrote: > From fc9dcaf68c8b54baf365cd670fb5780c7f0d243f Mon Sep 17 00:00:00 2001 > From: Johannes Weiner > Date: Mon, 11 May 2020 12:59:08 -0400 > Subject: [PATCH] mm: shmem: remove rare optimization when swapin races with >

Re: [PATCH 05/18] mm: memcontrol: convert page cache to a new mem_cgroup_charge() API

2020-05-11 Thread Johannes Weiner
On Mon, May 11, 2020 at 09:32:16AM -0700, Hugh Dickins wrote: > On Mon, 11 May 2020, Johannes Weiner wrote: > > On Mon, May 11, 2020 at 12:38:04AM -0700, Hugh Dickins wrote: > > > On Fri, 8 May 2020, Johannes Weiner wrote: > > > > > > > > I looked at thi

Re: [PATCH] memcg: effective memory.high reclaim for remote charging

2020-05-11 Thread Johannes Weiner
On Thu, May 07, 2020 at 10:00:07AM -0700, Shakeel Butt wrote: > On Thu, May 7, 2020 at 9:47 AM Michal Hocko wrote: > > > > On Thu 07-05-20 09:33:01, Shakeel Butt wrote: > > [...] > > > @@ -2600,8 +2596,23 @@ static int try_charge(struct mem_cgroup *memcg, > > > gfp_t gfp_mask, > > >

Re: [PATCH 05/18] mm: memcontrol: convert page cache to a new mem_cgroup_charge() API

2020-05-11 Thread Johannes Weiner
On Mon, May 11, 2020 at 12:38:04AM -0700, Hugh Dickins wrote: > On Fri, 8 May 2020, Johannes Weiner wrote: > > > > I looked at this some more, as well as compared it to non-shmem > > swapping. My conclusion is - and Hugh may correct me on this - that > > the dele

Re: [PATCH 2/3] mm: swap: memcg: fix memcg stats for huge pages

2020-05-08 Thread Johannes Weiner
. > Also for PGLAZYFREE use the irq-unsafe function to update as the irq is > already disabled. > > Fixes: 2262185c5b28 ("mm: per-cgroup memory reclaim stats") > Signed-off-by: Shakeel Butt Acked-by: Johannes Weiner

Re: [PATCH 1/3] mm: swap: fix vmstats for huge pages

2020-05-08 Thread Johannes Weiner
ady disabled. > > Signed-off-by: Shakeel Butt Acked-by: Johannes Weiner

Re: [PATCH 3/3] mm: swap: fix update_page_reclaim_stat for huge pages

2020-05-08 Thread Johannes Weiner
On Fri, May 08, 2020 at 02:22:15PM -0700, Shakeel Butt wrote: > Currently update_page_reclaim_stat() updates the lruvec.reclaim_stats > just once for a page irrespective if a page is huge or not. Fix that by > passing the hpage_nr_pages(page) to it. > > Signed-off-by: Shakeel Butt https://lore.k

Re: [PATCH] memcg: expose root cgroup's memory.stat

2020-05-08 Thread Johannes Weiner
ent. The > cgroup's pgsteal contains number of reclaimed pages for global as well > as cgroup reclaim. So, one way to get the system level stats is to get > these stats from root's memory.stat, so, expose memory.stat for the root > cgroup. > > from Johannes Weiner: &g

[PATCH 06/19] mm: memcontrol: prepare uncharging for removal of private page type counters

2020-05-08 Thread Johannes Weiner
The uncharge batching code adds up the anon, file, kmem counts to determine the total number of pages to uncharge and references to drop. But the next patches will remove the anon and file counters. Maintain an aggregate nr_pages in the uncharge_gather struct. Signed-off-by: Johannes Weiner

[PATCH 05/19] mm: memcontrol: convert page cache to a new mem_cgroup_charge() API

2020-05-08 Thread Johannes Weiner
nters, thus removing the page->mapping dependency, then complete the transition to the new single-point charge API and delete the old transactional scheme. v2: leave shmem swapcache when charging fails to avoid double IO (Joonsoo) Signed-off-by: Johannes Weiner Reviewed-by: Alex Shi --- include/l

[PATCH 01/19] mm: fix NUMA node file count error in replace_page_cache()

2020-05-08 Thread Johannes Weiner
e: Add and replace pages using the XArray") Signed-off-by: Johannes Weiner Reviewed-by: Alex Shi Reviewed-by: Shakeel Butt Reviewed-by: Joonsoo Kim --- mm/filemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index af1c6adad5bd..2b05

[PATCH 12/19] mm: memcontrol: convert anon and file-thp to new mem_cgroup_charge() API

2020-05-08 Thread Johannes Weiner
"set up" and when it's "published" - somewhat vague and fluid concepts that varied by page type. All we need is a freshly allocated page and a memcg context to charge. v2: prevent double charges on pre-allocated hugepages in khugepaged Signed-off-by: Johannes Weiner Revie

[PATCH 09/19] mm: memcontrol: switch to native NR_FILE_PAGES and NR_SHMEM counters

2020-05-08 Thread Johannes Weiner
hen replace MEMCG_CACHE with NR_FILE_PAGES and delete the private NR_SHMEM accounting sites. Signed-off-by: Johannes Weiner Reviewed-by: Joonsoo Kim --- include/linux/memcontrol.h | 3 +-- mm/filemap.c | 17 + mm/khugepaged.c| 16 +++- mm/m

[PATCH 10/19] mm: memcontrol: switch to native NR_ANON_MAPPED counter

2020-05-08 Thread Johannes Weiner
onsoo) Signed-off-by: Johannes Weiner --- include/linux/memcontrol.h | 3 +-- kernel/events/uprobes.c| 2 +- mm/huge_memory.c | 2 +- mm/khugepaged.c| 2 +- mm/memcontrol.c| 27 -- mm/memory.c| 10 mm/migrate.c

[PATCH 15/19] mm: memcontrol: make swap tracking an integral part of memory control

2020-05-08 Thread Johannes Weiner
ways have the cgroup records at swapin time; the next patch will fix the actual bug by charging readahead swap pages at swapin time rather than at fault time. v2: fix double swap charge bug in cgroup1/cgroup2 code gating Signed-off-by: Johannes Weiner Reviewed-by: Joonsoo Kim --- i

[PATCH 19/19] mm: memcontrol: update page->mem_cgroup stability rules

2020-05-08 Thread Johannes Weiner
ilize the page->mem_cgroup association: - the page lock - LRU isolation - lock_page_memcg() - exclusive access to the page Signed-off-by: Johannes Weiner Reviewed-by: Alex Shi Reviewed-by: Joonsoo Kim --- mm/memcontrol.c | 21 +++-- 1 file changed, 7 insertions(+), 14

[PATCH 16/19] mm: memcontrol: charge swapin pages on instantiation

2020-05-08 Thread Johannes Weiner
bove problems. v2: simplify swapin error checking (Joonsoo) Signed-off-by: Johannes Weiner Reviewed-by: Alex Shi --- mm/memory.c | 15 ++--- mm/shmem.c | 14 mm/swap_state.c | 89 ++--- mm/swapfile.c | 6 4 files changed, 67

[PATCH 18/19] mm: memcontrol: delete unused lrucare handling

2020-05-08 Thread Johannes Weiner
Swapin faults were the last event to charge pages after they had already been put on the LRU list. Now that we charge directly on swapin, the lrucare portion of the charge code is unused. Signed-off-by: Johannes Weiner Reviewed-by: Joonsoo Kim --- include/linux/memcontrol.h | 5 ++-- kernel

[PATCH 13/19] mm: memcontrol: drop unused try/commit/cancel charge API

2020-05-08 Thread Johannes Weiner
There are no more users. RIP in peace. Signed-off-by: Johannes Weiner Reviewed-by: Joonsoo Kim --- include/linux/memcontrol.h | 36 --- mm/memcontrol.c| 126 + 2 files changed, 15 insertions(+), 147 deletions(-) diff --git a/include

<    1   2   3   4   5   6   7   8   9   10   >