All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v4 00/15] Slab Movable Objects (SMO)
@ 2019-04-30  3:07 Tobin C. Harding
  2019-04-30  3:07 ` [RFC PATCH v4 01/15] slub: Add isolate() and migrate() methods Tobin C. Harding
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Tobin C. Harding @ 2019-04-30  3:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Tobin C. Harding, Roman Gushchin, Alexander Viro,
	Christoph Hellwig, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Christopher Lameter, Matthew Wilcox, Miklos Szeredi,
	Andreas Dilger, Waiman Long, Tycho Andersen, Theodore Ts'o,
	Andi Kleen, David Chinner, Nick Piggin, Rik van Riel,
	Hugh Dickins, Jonathan Corbet, linux-mm, linux-fsdevel,
	linux-kernel

Hi,

Another iteration of the SMO patch set, updates to this version are
restricted to the dcache patch #14.

Applies on top of Linus' tree (tag: v5.1-rc6).

This is a patch set implementing movable objects within the SLUB
allocator.  This is work based on Christopher Lameter's patch set:

 https://lore.kernel.org/patchwork/project/lkml/list/?series=377335

The original code logic is from that set and implemented by Christopher.
Clean up, refactoring, documentation, and additional features by myself.
Responsibility for any bugs remaining falls solely with myself.

Changes to this version:

Re-write the dcache Slab Movable Objects isolate/migrate functions.
Based on review/suggestions by Alexander on the last version.

In this version the isolate function loops over the object vector and
builds a shrink list for all objects that have refcount==0 AND are NOT
on anyone else's shrink list.  A pointer to this list is returned from
the isolate function and passed to the migrate function (by the SMO
infrastructure).  The dentry migration function d_partial_shrink()
simply calls shrink_dentry_list() on the received shrink list pointer
and frees the memory associated with the list_head.

Hopefully if this is all ok I can move on to violating the inode
slab cache :)

FWIW testing on a VM in Qemu brings this mild benefit to the dentry slab
cache with no _apparent_ negatives.

CONFIG_SLUB_DEBUG=y
CONFIG_SLUB=y
CONFIG_SLUB_CPU_PARTIAL=y
CONFIG_SLUB_DEBUG_ON=y
CONFIG_SLUB_STATS=y
CONFIG_SMO_NODE=y
CONFIG_DCACHE_SMO=y

[root@vm ~]# slabinfo  dentry -r | head -n 13

Slabcache: dentry           Aliases:  0 Order :  1 Objects: 38585
** Reclaim accounting active
** Defragmentation at 30%

Sizes (bytes)     Slabs              Debug                Memory
------------------------------------------------------------------------
Object :     192  Total  :    2582   Sanity Checks : On   Total: 21151744
SlabObj:     528  Full   :    2547   Redzoning     : On   Used : 7408320
SlabSiz:    8192  Partial:      35   Poisoning     : On   Loss : 13743424
Loss   :     336  CpuSlab:       0   Tracking      : On   Lalig: 12964560
Align  :       8  Objects:      15   Tracing       : Off  Lpadd:  702304

[root@vm ~]# slabinfo  dentry --shrink
[root@vm ~]# slabinfo  dentry -r | head -n 13

Slabcache: dentry           Aliases:  0 Order :  1 Objects: 38426
** Reclaim accounting active
** Defragmentation at 30%

Sizes (bytes)     Slabs              Debug                Memory
------------------------------------------------------------------------
Object :     192  Total  :    2578   Sanity Checks : On   Total: 21118976
SlabObj:     528  Full   :    2547   Redzoning     : On   Used : 7377792
SlabSiz:    8192  Partial:      31   Poisoning     : On   Loss : 13741184
Loss   :     336  CpuSlab:       0   Tracking      : On   Lalig: 12911136
Align  :       8  Objects:      15   Tracing       : Off  Lpadd:  701216


Please note, this dentry shrink implementation is 'best effort', results
vary.  This is as is expected.  We are trying to unobtrusively shrink
the dentry cache.

thanks,
Tobin.


Tobin C. Harding (15):
  slub: Add isolate() and migrate() methods
  tools/vm/slabinfo: Add support for -C and -M options
  slub: Sort slab cache list
  slub: Slab defrag core
  tools/vm/slabinfo: Add remote node defrag ratio output
  tools/vm/slabinfo: Add defrag_used_ratio output
  tools/testing/slab: Add object migration test module
  tools/testing/slab: Add object migration test suite
  xarray: Implement migration function for objects
  tools/testing/slab: Add XArray movable objects tests
  slub: Enable moving objects to/from specific nodes
  slub: Enable balancing slabs across nodes
  dcache: Provide a dentry constructor
  dcache: Implement partial shrink via Slab Movable Objects
  dcache: Add CONFIG_DCACHE_SMO

 Documentation/ABI/testing/sysfs-kernel-slab |  14 +
 fs/dcache.c                                 | 110 ++-
 include/linux/slab.h                        |  71 ++
 include/linux/slub_def.h                    |  10 +
 lib/radix-tree.c                            |  13 +
 lib/xarray.c                                |  49 ++
 mm/Kconfig                                  |  14 +
 mm/slab_common.c                            |   2 +-
 mm/slub.c                                   | 819 ++++++++++++++++++--
 tools/testing/slab/Makefile                 |  10 +
 tools/testing/slab/slub_defrag.c            | 567 ++++++++++++++
 tools/testing/slab/slub_defrag.py           | 451 +++++++++++
 tools/testing/slab/slub_defrag_xarray.c     | 211 +++++
 tools/vm/slabinfo.c                         |  51 +-
 14 files changed, 2299 insertions(+), 93 deletions(-)
 create mode 100644 tools/testing/slab/Makefile
 create mode 100644 tools/testing/slab/slub_defrag.c
 create mode 100755 tools/testing/slab/slub_defrag.py
 create mode 100644 tools/testing/slab/slub_defrag_xarray.c

-- 
2.21.0


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

end of thread, other threads:[~2019-04-30  3:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-30  3:07 [RFC PATCH v4 00/15] Slab Movable Objects (SMO) Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 01/15] slub: Add isolate() and migrate() methods Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 02/15] tools/vm/slabinfo: Add support for -C and -M options Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 03/15] slub: Sort slab cache list Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 04/15] slub: Slab defrag core Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 05/15] tools/vm/slabinfo: Add remote node defrag ratio output Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 06/15] tools/vm/slabinfo: Add defrag_used_ratio output Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 07/15] tools/testing/slab: Add object migration test module Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 08/15] tools/testing/slab: Add object migration test suite Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 09/15] xarray: Implement migration function for objects Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 10/15] tools/testing/slab: Add XArray movable objects tests Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 11/15] slub: Enable moving objects to/from specific nodes Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 12/15] slub: Enable balancing slabs across nodes Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 13/15] dcache: Provide a dentry constructor Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 14/15] dcache: Implement partial shrink via Slab Movable Objects Tobin C. Harding
2019-04-30  3:07 ` [RFC PATCH v4 15/15] dcache: Add CONFIG_DCACHE_SMO Tobin C. Harding

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.