linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/7] mm: Use slab_list list_head instead of lru
@ 2019-03-18  0:02 Tobin C. Harding
  2019-03-18  0:02 ` [PATCH v4 1/7] list: Add function list_rotate_to_front() Tobin C. Harding
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Tobin C. Harding @ 2019-03-18  0:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Tobin C. Harding, Roman Gushchin, Christoph Lameter,
	Pekka Enberg, David Rientjes, Joonsoo Kim, Matthew Wilcox,
	linux-mm, linux-kernel

Hi,

v4 fixes patch 3 (change _all_ instances of ->lru to ->slab_list) as
noticed by Roman.  Built, booted, and tested with the test modules
mentioned below.

Roman,

I kept your reviewed-by tag on patch 3 since functionally its the same
patch (and the additional changes were pointed out by you :).  Thanks.


From v3 ...

Currently the slab allocators (ab)use the struct page 'lru' list_head.
We have a list head for slab allocators to use, 'slab_list'.

During v2 it was noted by Christoph that the SLOB allocator was reaching
into a list_head, this version adds 2 patches to the front of the set to
fix that.

Clean up all three allocators by using the 'slab_list' list_head instead
of overloading the 'lru' list_head.

Patch 1 - Adds a function to rotate a list to a specified entry.

Patch 2 - Removes the code that reaches into list_head and instead uses
	  the list_head API including the newly defined function.

Patches 3-7 are unchanged from v3

Patch 3 (v2: patch 4) - Changes the SLOB allocator to use slab_list
      	     	      	instead of lru.

Patch 4 (v2: patch 1) - Makes no code changes, adds comments to #endif
      	     	      	statements.

Patch 5 (v2: patch 2) - Use slab_list instead of lru for SLUB allocator.

Patch 6 (v2: patch 3) - Use slab_list instead of lru for SLAB allocator.

Patch 7 (v2: patch 5) - Removes the now stale comment in the page struct
      	     	      	definition.

During v2 development patches were checked to see if the object file
before and after was identical.  Clearly this will no longer be possible
for mm/slob.o, however this work is still of use to validate the
change from lru -> slab_list.

Patch 1 was tested with a module (creates and populates a list then
calls list_rotate_to_front() and verifies new order):

      https://github.com/tcharding/ktest/tree/master/list_head

Patch 2 was tested with another module that does some basic slab
allocation and freeing to a newly created slab cache:

	https://github.com/tcharding/ktest/tree/master/slab

Tested on a kernel with this in the config:

	CONFIG_SLOB=y
	CONFIG_SLAB_MERGE_DEFAULT=y

Changes since v3:

 - Change all ->lru to ->slab_list in slob (thanks Roman).

Changes since v2:

 - Add list_rotate_to_front().
 - Fix slob to use list_head API.
 - Re-order patches to put the list.h changes up front.
 - Add acks from Christoph.

Changes since v1:

 - Verify object files are the same before and after the patch set is
   applied (suggested by Matthew).
 - Add extra explanation to the commit logs explaining why these changes
   are safe to make (suggested by Roman).
 - Remove stale comment (thanks Willy).


thanks,
Tobin.


Tobin C. Harding (7):
  list: Add function list_rotate_to_front()
  slob: Respect list_head abstraction layer
  slob: Use slab_list instead of lru
  slub: Add comments to endif pre-processor macros
  slub: Use slab_list instead of lru
  slab: Use slab_list instead of lru
  mm: Remove stale comment from page struct

 include/linux/list.h     | 18 ++++++++++++
 include/linux/mm_types.h |  2 +-
 mm/slab.c                | 49 ++++++++++++++++----------------
 mm/slob.c                | 32 +++++++++++++--------
 mm/slub.c                | 60 ++++++++++++++++++++--------------------
 5 files changed, 94 insertions(+), 67 deletions(-)

-- 
2.21.0


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

end of thread, other threads:[~2019-03-18  0:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-18  0:02 [PATCH v4 0/7] mm: Use slab_list list_head instead of lru Tobin C. Harding
2019-03-18  0:02 ` [PATCH v4 1/7] list: Add function list_rotate_to_front() Tobin C. Harding
2019-03-18  0:02 ` [PATCH v4 2/7] slob: Respect list_head abstraction layer Tobin C. Harding
2019-03-18  0:02 ` [PATCH v4 3/7] slob: Use slab_list instead of lru Tobin C. Harding
2019-03-18  0:02 ` [PATCH v4 5/7] slub: " Tobin C. Harding
2019-03-18  0:02 ` [PATCH v4 6/7] slab: " Tobin C. Harding
2019-03-18  0:02 ` [PATCH v4 7/7] mm: Remove stale comment from page struct Tobin C. Harding

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).