All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v10 00/16] kmemcg shrinkers
@ 2013-07-07 15:56 Glauber Costa
  2013-07-07 15:56 ` [PATCH v10 01/16] memcg: make cache index determination more robust Glauber Costa
                   ` (11 more replies)
  0 siblings, 12 replies; 28+ messages in thread
From: Glauber Costa @ 2013-07-07 15:56 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-fsdevel, mgorman, david, cgroups, kamezawa.hiroyu, mhocko,
	hannes, hughd, gthelen, akpm, Glauber Costa

Now that the list_lru seems to have stabilized, I am sending this out for review
again. This now contains only the memcg part of the patchset, rebased on top of
today's linux-next. Comments appreciated.

This patchset implements targeted shrinking for memcg when kmem limits are
present. So far, we've been accounting kernel objects but failing allocations
when short of memory. This is because our only option would be to call the
global shrinker, depleting objects from all caches and breaking isolation.

The main idea is to associate per-memcg lists with each of the LRUs. The main
LRU still provides a single entry point and when adding or removing an element
from the LRU, we use the page information to figure out which memcg it belongs
to and relay it to the right list.

Main changes from *v9
* Fixed iteration over all memcgs from list_lru side.

Main changes from *v8
* fixed xfs umount bug
* rebase to current linux-next

Main changes from *v7:
* Fixed races for memcg
* Enhanced memcg hierarchy walks during global pressure (we were walking only
  the global list, not all memcgs)

Main changes from *v6:
* Change nr_unused_dentry to long, Dave reported an int not being enough
* Fixed shrink_list leak, by Dave
* LRU API now gets a node id, instead of a node mask.
* per-node deferred work, leading to smoother behavior

Main changes from *v5:
* Rebased to linux-next, and fix the conflicts with the dcache.
* Make sure LRU_RETRY only retry once
* Prevent the bcache shrinker to scan the caches when disabled (by returning
  0 in the count function)
* Fix i915 return code when mutex cannot be acquired.
* Only scan less-than-batch objects in memcg scenarios

Main changes from *v4:
* Fixed a bug in user-generated memcg pressure
* Fixed overly-agressive slab shrinker behavior spotted by Mel Gorman
* Various other fixes and comments by Mel Gorman

Main changes from *v3:
* Merged suggestions from mailing list.
* Removed the memcg-walking code from LRU. vmscan now drives all the hierarchy
  decisions, which makes more sense
* lazily free the old memcg arrays (needs now to be saved in struct lru). Since
  we need to call synchronize_rcu, calling it for every LRU can become expensive
* Moved the dead memcg shrinker to vmpressure. Already independently sent to
  linux-mm for review.
* Changed locking convention for LRU_RETRY. It now needs to return locked, which
  silents warnings about possible lock unbalance (although previous code was
  correct)

Main changes from *v2:
* shrink dead memcgs when global pressure kicks in. Uses the new lru API.
* bugfixes and comments from the mailing list.
* proper hierarchy-aware walk in shrink_slab.

Main changes from *v1:
* merged comments from the mailing list
* reworked lru-memcg API
* effective proportional shrinking
* sanitized locking on the memcg side
* bill user memory first when kmem == umem
* various bugfixes

*** BLURB HERE ***

Glauber Costa (16):
  memcg: make cache index determination more robust
  memcg: consolidate callers of memcg_cache_id
  vmscan: also shrink slab in memcg pressure
  memcg: move stop and resume accounting functions
  memcg,list_lru: duplicate LRUs upon kmemcg creation
  lru: add an element to a memcg list
  list_lru: per-memcg walks
  memcg: move initialization to memcg creation
  memcg: per-memcg kmem shrinking
  memcg: scan cache objects hierarchically
  vmscan: take at least one pass with shrinkers
  super: targeted memcg reclaim
  memcg: allow kmem limit to be resized down
  vmpressure: in-kernel notifications
  memcg: reap dead memcgs upon global memory pressure
  memcg: flush memcg items upon memcg destruction

 fs/dcache.c                |   7 +-
 fs/inode.c                 |   7 +-
 fs/internal.h              |   5 +-
 fs/super.c                 |  35 ++-
 include/linux/list_lru.h   |  94 +++++++-
 include/linux/memcontrol.h |  43 ++++
 include/linux/shrinker.h   |   6 +-
 include/linux/swap.h       |   2 +
 include/linux/vmpressure.h |   6 +
 mm/list_lru.c              | 246 +++++++++++++++++--
 mm/memcontrol.c            | 574 +++++++++++++++++++++++++++++++++++++++------
 mm/slab_common.c           |   1 -
 mm/vmpressure.c            |  52 +++-
 mm/vmscan.c                | 179 ++++++++++++--
 14 files changed, 1116 insertions(+), 141 deletions(-)

-- 
1.8.2.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2013-07-07 15:57 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-07 15:56 [PATCH v10 00/16] kmemcg shrinkers Glauber Costa
2013-07-07 15:56 ` [PATCH v10 01/16] memcg: make cache index determination more robust Glauber Costa
2013-07-07 15:56 ` [PATCH v10 02/16] memcg: consolidate callers of memcg_cache_id Glauber Costa
2013-07-07 15:56 ` [PATCH v10 03/16] vmscan: also shrink slab in memcg pressure Glauber Costa
2013-07-07 15:56 ` [PATCH v10 04/16] memcg: move stop and resume accounting functions Glauber Costa
2013-07-07 15:56 ` [PATCH v10 05/16] memcg,list_lru: duplicate LRUs upon kmemcg creation Glauber Costa
2013-07-07 15:56 ` [PATCH v10 08/16] memcg: move initialization to memcg creation Glauber Costa
2013-07-07 15:56   ` Glauber Costa
2013-07-07 15:56 ` [PATCH v10 10/16] memcg: scan cache objects hierarchically Glauber Costa
2013-07-07 15:56   ` Glauber Costa
2013-07-07 15:56 ` [PATCH v10 12/16] super: targeted memcg reclaim Glauber Costa
2013-07-07 15:56   ` Glauber Costa
2013-07-07 15:56 ` [PATCH v10 13/16] memcg: allow kmem limit to be resized down Glauber Costa
2013-07-07 15:56   ` Glauber Costa
2013-07-07 15:56 ` [PATCH v10 14/16] vmpressure: in-kernel notifications Glauber Costa
2013-07-07 15:56   ` Glauber Costa
     [not found] ` <1373212616-11713-1-git-send-email-glommer-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2013-07-07 15:56   ` [PATCH v10 06/16] lru: add an element to a memcg list Glauber Costa
2013-07-07 15:56     ` Glauber Costa
2013-07-07 15:56   ` [PATCH v10 07/16] list_lru: per-memcg walks Glauber Costa
2013-07-07 15:56     ` Glauber Costa
2013-07-07 15:56   ` [PATCH v10 09/16] memcg: per-memcg kmem shrinking Glauber Costa
2013-07-07 15:56     ` Glauber Costa
2013-07-07 15:56   ` [PATCH v10 11/16] vmscan: take at least one pass with shrinkers Glauber Costa
2013-07-07 15:56     ` Glauber Costa
2013-07-07 15:56   ` [PATCH v10 15/16] memcg: reap dead memcgs upon global memory pressure Glauber Costa
2013-07-07 15:56     ` Glauber Costa
2013-07-07 15:56 ` [PATCH v10 16/16] memcg: flush memcg items upon memcg destruction Glauber Costa
2013-07-07 15:56   ` Glauber Costa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.