linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/14] Slab Movable Objects (SMO)
@ 2019-04-03  4:21 Tobin C. Harding
  2019-04-03  4:21 ` [RFC PATCH v2 01/14] slub: Add isolate() and migrate() methods Tobin C. Harding
                   ` (13 more replies)
  0 siblings, 14 replies; 28+ messages in thread
From: Tobin C. Harding @ 2019-04-03  4:21 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, linux-mm, linux-fsdevel, linux-kernel

Hi,

Version 2 re-structured to better follow the structure of Chirstoph's
original patchset (linked below).  Functions renamed and other suggestions
on v1 from Roman implemented.

This version also adds an attempt at implementing object migration for
the dcache, appropriate filesystem folk CC'd.  Please see comments
below in 'dcache' section.

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

This is a patch set implementing movable objects within the SLUB
allocator.  This is work based on Christopher'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.
Blame for any bugs remaining falls solely with myself.  Patches using
Christopher's code use the Co-developed-by tag but do not currently have
his SOB tag.

The core of the implementation is now contained within the first 4
patches (primarily patch #4).

Patches 7,8,10 add test code including a test modules to play around
with this.  With the series applied one can see functionality in
action by using the slabinfo command on the xarray slab cache

	slabinfo radix_tree_node -r

The NUMA stuff works as claimed with the radix_tree_node slab cache.

dcache
------

The dcache patches are my best effort on top of Christoph's original
work.  The dcache has changed a lot since then (2009).  FTR one month
ago was the first time I have ever opened fs/dcache.c.

I have been playing with this for at least two weeks without any
functional changes to the dcache patches - I do not think me playing
with it more is going to improve my understanding of the dcache so I am
asking for help here.  I've been testing in Qemu (both using ramdisk
filesystem and a disk image filesystem) as well as on bare metal.

Shrinking the dcache with:

	slabinfo dentry -s

produces _more_ partial slabs than before and repeated calls continue to
increase the number of partial slabs.  Although the initial calls do
decrease the total number of cached objects.  I cannot explain this.

During development I added a bunch of printks and the majority of dentry
slab objects are skipped during the isolation function due to the
following check from d_isolate():
	
	if (dentry->d_inode &&
	    !mapping_cap_writeback_dirty(dentry->d_inode->i_mapping))
	    ...
	    /* skip object*/
		     
I cannot explain the large number of dentry objects skipped by this
clause.

Any suggestions no matter how wild very much appreciated.  Tips on files
I should study or anything else I could do to better understand what is
needed to understand to work with this.  So far I have been primarily
trying to grok the VFS and the dcache in particular via:

fs/dcache.c
include/linux/fs.h
include/linux/dcache.h
Documentation/filesystems/vfs.txt

I also tried using the cache shrinkers

	echo 2 > /proc/sys/vm/drop_caches

Then shrinking the dentry slab cache.  This resulted in a bunch of
things disappearing e.g. sysfs gets unmounted, /home directory contents
disappear.  Again, I cannot explain this.  Should this be doable if this
series was implemented correctly?

Thanks for taking the time to look at this.

	Tobin.


Tobin C. Harding (14):
  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 object migration

 Documentation/ABI/testing/sysfs-kernel-slab |  14 +
 fs/dcache.c                                 | 124 ++-
 include/linux/slab.h                        |  71 ++
 include/linux/slub_def.h                    |  10 +
 lib/radix-tree.c                            |  13 +
 lib/xarray.c                                |  46 ++
 mm/Kconfig                                  |   7 +
 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, 2303 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] 28+ messages in thread

end of thread, other threads:[~2019-04-04 21:58 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03  4:21 [RFC PATCH v2 00/14] Slab Movable Objects (SMO) Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 01/14] slub: Add isolate() and migrate() methods Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 02/14] tools/vm/slabinfo: Add support for -C and -M options Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 03/14] slub: Sort slab cache list Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 04/14] slub: Slab defrag core Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 05/14] tools/vm/slabinfo: Add remote node defrag ratio output Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 06/14] tools/vm/slabinfo: Add defrag_used_ratio output Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 07/14] tools/testing/slab: Add object migration test module Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 08/14] tools/testing/slab: Add object migration test suite Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 09/14] xarray: Implement migration function for objects Tobin C. Harding
2019-04-03 17:23   ` Matthew Wilcox
2019-04-03 21:19     ` Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 10/14] tools/testing/slab: Add XArray movable objects tests Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 11/14] slub: Enable moving objects to/from specific nodes Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 12/14] slub: Enable balancing slabs across nodes Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 13/14] dcache: Provide a dentry constructor Tobin C. Harding
2019-04-03  4:21 ` [RFC PATCH v2 14/14] dcache: Implement object migration Tobin C. Harding
2019-04-03 17:08   ` Al Viro
2019-04-03 17:19     ` Al Viro
2019-04-03 17:48       ` Al Viro
2019-04-04 20:29         ` Tobin C. Harding
2019-04-04 21:58           ` Al Viro
2019-04-04 21:18       ` Tobin C. Harding
2019-04-03 17:56     ` Christopher Lameter
2019-04-03 18:24       ` Al Viro
2019-04-03 19:05         ` Al Viro
2019-04-04  8:01           ` Miklos Szeredi
2019-04-04 15:46         ` Christopher Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).