Re: linux-next: removal of the leaks tree

2020-06-16 Thread Tobin C. Harding
On Tue, Jun 16, 2020 at 02:53:33PM +1000, Stephen Rothwell wrote: > Hi, > > I have removed the leaks tree > (https://git.kernel.org/pub/scm/linux/kernel/git/tobin/leaks.git#leaks-next) > from linux-next because it has not been updated in more than a year. > If you would like it reinstated, please

Re: shrink_dentry_list() logics change (was Re: [RFC PATCH v3 14/15] dcache: Implement partial shrink via Slab Movable Objects)

2019-07-01 Thread Tobin C. Harding
On Sat, Jun 29, 2019 at 08:06:24PM +0100, Al Viro wrote: > On Sat, Jun 29, 2019 at 05:38:03AM +0100, Al Viro wrote: > > > PS: the problem is not gone in the next iteration of the patchset in > > question. The patch I'm proposing (including dput_to_list() and _ONLY_ > > compile-tested) follows.

[PATCH 12/15] dcache: Provide a dentry constructor

2019-06-02 Thread Tobin C. Harding
In order to support object migration on the dentry cache we need to have a determined object state at all times. Without a constructor the object would have a random state after allocation. Provide a dentry constructor. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 30

[PATCH 14/15] slub: Enable moving objects to/from specific nodes

2019-06-02 Thread Tobin C. Harding
ho "N1 N1" > move Signed-off-by: Tobin C. Harding --- mm/Kconfig | 7 ++ mm/slub.c | 247 + 2 files changed, 254 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index f0c76ba47695..c1438b9e578b 100644 --- a/mm/Kconfig ++

[PATCH 15/15] slub: Enable balancing slabs across nodes

2019-06-02 Thread Tobin C. Harding
, no other value accepted. This feature relies on SMO being enable for the cache, this is done with a call to, after the isolate/migrate functions have been defined. kmem_cache_setup_mobility(s, isolate, migrate) Signed-off-by: Tobin C. Harding --- mm/slub.c | 130

[PATCH 10/15] xarray: Implement migration function for xa_node objects

2019-06-02 Thread Tobin C. Harding
by Matthew Wilcox and was modified to work with slab object migration. Cc: Matthew Wilcox Signed-off-by: Tobin C. Harding --- lib/xarray.c | 61 1 file changed, 61 insertions(+) diff --git a/lib/xarray.c b/lib/xarray.c index 861c042daa1d

[PATCH 07/15] tools/testing/slab: Add object migration test module

2019-06-02 Thread Tobin C. Harding
ber of objects): # cd /sys/kernel/debug/smo # echo 'test' > callfn [3.576617] smo: test using nr_objs: 1000 keep: 10 [3.580169] smo: Module tests completed successfully Signed-off-by: Tobin C. Harding --- tools/testing/slab/Makefile | 10 + tools/testing/slab/slub_defrag.

[PATCH 09/15] lib: Separate radix_tree_node and xa_node slab cache

2019-06-02 Thread Tobin C. Harding
Wilcox Signed-off-by: Tobin C. Harding --- include/linux/xarray.h | 3 +++ init/main.c| 2 ++ lib/radix-tree.c | 2 +- lib/xarray.c | 48 ++ 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/include/linux/xarray.h

[PATCH 13/15] dcache: Implement partial shrink via Slab Movable Objects

2019-06-02 Thread Tobin C. Harding
to enable SMO a call to kmem_cache_setup_mobility() must be made, we do this during initialization of the dcache. Implement isolate and 'migrate' functions for the dentry slab cache. Enable SMO for the dcache during initialization. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 75

[PATCH 11/15] tools/testing/slab: Add XArray movable objects tests

2019-06-02 Thread Tobin C. Harding
partial slab. Signed-off-by: Tobin C. Harding --- tools/testing/slab/Makefile | 2 +- tools/testing/slab/slub_defrag_xarray.c | 211 2 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 tools/testing/slab/slub_defrag_xarray.c diff --git

[PATCH 08/15] tools/testing/slab: Add object migration test suite

2019-06-02 Thread Tobin C. Harding
... verified movable slabs are shrinkable Removing module slub_defrag ... Signed-off-by: Tobin C. Harding --- tools/testing/slab/slub_defrag.c | 1 + tools/testing/slab/slub_defrag.py | 451 ++ 2 files changed, 452 insertions(+) create mode 100755 tools/testing/slab

[PATCH 06/15] tools/vm/slabinfo: Add defrag_used_ratio output

2019-06-02 Thread Tobin C. Harding
Add output for the newly added defrag_used_ratio sysfs knob. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index d2c22f9ee2d8..ef4ff93df4cc 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm

[PATCH 05/15] tools/vm/slabinfo: Add remote node defrag ratio output

2019-06-02 Thread Tobin C. Harding
Add output line for NUMA remote node defrag ratio. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index cbfc56c44c2f..d2c22f9ee2d8 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm

[PATCH 01/15] slub: Add isolate() and migrate() methods

2019-06-02 Thread Tobin C. Harding
' callbacks. Signed-off-by: Tobin C. Harding --- include/linux/slab.h | 70 include/linux/slub_def.h | 3 ++ mm/slub.c| 59 + 3 files changed, 126 insertions(+), 6 deletions(-) diff --git a/include

[PATCH 02/15] tools/vm/slabinfo: Add support for -C and -M options

2019-06-02 Thread Tobin C. Harding
-C lists caches that use a ctor. -M lists caches that support object migration. Add command line options to show caches with a constructor and caches that are movable (i.e. have migrate function). Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 40

[PATCH 03/15] slub: Sort slab cache list

2019-06-02 Thread Tobin C. Harding
It is advantageous to have all defragmentable slabs together at the beginning of the list of slabs so that there is no need to scan the complete list. Put defragmentable caches first when adding a slab cache and others last. Signed-off-by: Tobin C. Harding --- mm/slab_common.c | 2 +- mm/slub.c

[PATCH 04/15] slub: Slab defrag core

2019-06-02 Thread Tobin C. Harding
all to the recently added function: void kmem_cache_setup_mobility(struct kmem_cache *, kmem_cache_isolate_func, kmem_cache_migrate_func); Signed-off-by: Tobin C. Harding --- Documentation/ABI/testing/sysfs-kernel-s

[PATCH 00/15] Slab Movable Objects (SMO)

2019-06-02 Thread Tobin C. Harding
that the migration works and does not appear to break anything. Patch #14 and #15 depend on CONFIG_SLBU_DEBUG_ON or boot with 'slub_debug' Thanks for taking the time to look at this. Tobin Tobin C. Harding (15): slub: Add isolate() and migrate() methods tools/vm/slabinfo

Re: [RFC PATCH v5 16/16] dcache: Add CONFIG_DCACHE_SMO

2019-06-02 Thread Tobin C. Harding
On Wed, May 29, 2019 at 04:16:51PM +, Roman Gushchin wrote: > On Wed, May 29, 2019 at 01:54:06PM +1000, Tobin C. Harding wrote: > > On Tue, May 21, 2019 at 02:05:38AM +, Roman Gushchin wrote: > > > On Tue, May 21, 2019 at 11:31:18AM +1000, Tobin C. Harding wrote: >

Re: [RFC PATCH v5 16/16] dcache: Add CONFIG_DCACHE_SMO

2019-05-28 Thread Tobin C. Harding
On Tue, May 21, 2019 at 02:05:38AM +, Roman Gushchin wrote: > On Tue, May 21, 2019 at 11:31:18AM +1000, Tobin C. Harding wrote: > > On Tue, May 21, 2019 at 12:57:47AM +, Roman Gushchin wrote: > > > On Mon, May 20, 2019 at 03:40:17PM +1000, Tobin C. Harding wrote: >

Re: [RFC PATCH v5 16/16] dcache: Add CONFIG_DCACHE_SMO

2019-05-20 Thread Tobin C. Harding
On Tue, May 21, 2019 at 02:05:38AM +, Roman Gushchin wrote: > On Tue, May 21, 2019 at 11:31:18AM +1000, Tobin C. Harding wrote: > > On Tue, May 21, 2019 at 12:57:47AM +, Roman Gushchin wrote: > > > On Mon, May 20, 2019 at 03:40:17PM +1000, Tobin C. Harding wrote: >

Re: [RFC PATCH v5 13/16] slub: Enable balancing slabs across nodes

2019-05-20 Thread Tobin C. Harding
On Tue, May 21, 2019 at 01:04:10AM +, Roman Gushchin wrote: > On Mon, May 20, 2019 at 03:40:14PM +1000, Tobin C. Harding wrote: > > We have just implemented Slab Movable Objects (SMO). On NUMA systems > > slabs can become unbalanced i.e. many slabs on one node while other >

Re: [RFC PATCH v5 16/16] dcache: Add CONFIG_DCACHE_SMO

2019-05-20 Thread Tobin C. Harding
On Tue, May 21, 2019 at 12:57:47AM +, Roman Gushchin wrote: > On Mon, May 20, 2019 at 03:40:17PM +1000, Tobin C. Harding wrote: > > In an attempt to make the SMO patchset as non-invasive as possible add a > > config option CONFIG_DCACHE_SMO (under "Memory Management option

Re: [RFC PATCH v5 04/16] slub: Slab defrag core

2019-05-20 Thread Tobin C. Harding
On Tue, May 21, 2019 at 12:51:57AM +, Roman Gushchin wrote: > On Mon, May 20, 2019 at 03:40:05PM +1000, Tobin C. Harding wrote: > > Internal fragmentation can occur within pages used by the slub > > allocator. Under some workloads large numbers of pages can be used by > &g

[RFC PATCH v5 12/16] slub: Enable moving objects to/from specific nodes

2019-05-19 Thread Tobin C. Harding
: - Move all objects to specified node. echo "N1" > move - Move all objects from specified node to other specified node (from N1 -> to N2): echo "N1 N2" > move This also enables shrinking slabs on a specific node: echo "N1 N1"

[RFC PATCH v5 15/16] dcache: Implement partial shrink via Slab Movable Objects

2019-05-19 Thread Tobin C. Harding
. Implement isolate and 'migrate' functions for the dentry slab cache. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 76 + 1 file changed, 76 insertions(+) diff --git a/fs/dcache.c b/fs/dcache.c index b7318615979d..0dfe580c2d42 100644 --- a/fs

[RFC PATCH v5 13/16] slub: Enable balancing slabs across nodes

2019-05-19 Thread Tobin C. Harding
, no other value accepted. This feature relies on SMO being enable for the cache, this is done with a call to, after the isolate/migrate functions have been defined. kmem_cache_setup_mobility(s, isolate, migrate) Signed-off-by: Tobin C. Harding --- mm/slub.c | 120

[RFC PATCH v5 16/16] dcache: Add CONFIG_DCACHE_SMO

2019-05-19 Thread Tobin C. Harding
b mobility is enabled and the isolate/migrate functions are built in. Add CONFIG_DCACHE_SMO to guard the partial shrinking of the dcache via Slab Movable Objects infrastructure. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 4 mm/Kconfig | 7 +++ 2 files changed, 11 insertions(+) diff

[RFC PATCH v5 11/16] tools/testing/slab: Add XArray movable objects tests

2019-05-19 Thread Tobin C. Harding
partial slab. Signed-off-by: Tobin C. Harding --- tools/testing/slab/Makefile | 2 +- tools/testing/slab/slub_defrag_xarray.c | 211 2 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 tools/testing/slab/slub_defrag_xarray.c diff --git

[RFC PATCH v5 14/16] dcache: Provide a dentry constructor

2019-05-19 Thread Tobin C. Harding
In order to support object migration on the dentry cache we need to have a determined object state at all times. Without a constructor the object would have a random state after allocation. Provide a dentry constructor. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 30

[RFC PATCH v5 05/16] tools/vm/slabinfo: Add remote node defrag ratio output

2019-05-19 Thread Tobin C. Harding
Add output line for NUMA remote node defrag ratio. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index cbfc56c44c2f..d2c22f9ee2d8 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm

[RFC PATCH v5 08/16] tools/testing/slab: Add object migration test suite

2019-05-19 Thread Tobin C. Harding
... verified movable slabs are shrinkable Removing module slub_defrag ... Signed-off-by: Tobin C. Harding --- tools/testing/slab/slub_defrag.c | 1 + tools/testing/slab/slub_defrag.py | 451 ++ 2 files changed, 452 insertions(+) create mode 100755 tools/testing/slab

[RFC PATCH v5 07/16] tools/testing/slab: Add object migration test module

2019-05-19 Thread Tobin C. Harding
ber of objects): # cd /sys/kernel/debug/smo # echo 'test' > callfn [3.576617] smo: test using nr_objs: 1000 keep: 10 [3.580169] smo: Module tests completed successfully Signed-off-by: Tobin C. Harding --- tools/testing/slab/Makefile | 10 + tools/testing/slab/slub_defrag.

[RFC PATCH v5 06/16] tools/vm/slabinfo: Add defrag_used_ratio output

2019-05-19 Thread Tobin C. Harding
Add output for the newly added defrag_used_ratio sysfs knob. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index d2c22f9ee2d8..ef4ff93df4cc 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm

[RFC PATCH v5 09/16] lib: Separate radix_tree_node and xa_node slab cache

2019-05-19 Thread Tobin C. Harding
Wilcox Signed-off-by: Tobin C. Harding --- include/linux/xarray.h | 3 +++ init/main.c| 2 ++ lib/radix-tree.c | 2 +- lib/xarray.c | 48 ++ 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/include/linux/xarray.h

[RFC PATCH v5 10/16] xarray: Implement migration function for xa_node objects

2019-05-19 Thread Tobin C. Harding
by Matthew Wilcox and was modified to work with slab object migration. Cc: Matthew Wilcox Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- lib/xarray.c | 61 1 file changed, 61 insertions(+) diff --git a/lib/xarray.c b/lib

[RFC PATCH v5 03/16] slub: Sort slab cache list

2019-05-19 Thread Tobin C. Harding
It is advantageous to have all defragmentable slabs together at the beginning of the list of slabs so that there is no need to scan the complete list. Put defragmentable caches first when adding a slab cache and others last. Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Harding

[RFC PATCH v5 04/16] slub: Slab defrag core

2019-05-19 Thread Tobin C. Harding
all to the recently added function: void kmem_cache_setup_mobility(struct kmem_cache *, kmem_cache_isolate_func, kmem_cache_migrate_func); Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Hard

[RFC PATCH v5 02/16] tools/vm/slabinfo: Add support for -C and -M options

2019-05-19 Thread Tobin C. Harding
-C lists caches that use a ctor. -M lists caches that support object migration. Add command line options to show caches with a constructor and caches that are movable (i.e. have migrate function). Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 40

[RFC PATCH v5 00/16] Slab Movable Objects (SMO)

2019-05-19 Thread Tobin C. Harding
mercilessly correct me :) Thanks for looking at this, Tobin. Tobin C. Harding (16): 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

[RFC PATCH v5 01/16] slub: Add isolate() and migrate() methods

2019-05-19 Thread Tobin C. Harding
' callbacks. Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- include/linux/slab.h | 70 include/linux/slub_def.h | 3 ++ mm/slub.c| 59 + 3 files changed, 126 insertions(+), 6

Re: [RFC PATCH] kobject: Clean up allocated memory on failure

2019-05-16 Thread Tobin C. Harding
On Thu, May 16, 2019 at 08:40:29AM +0200, Greg Kroah-Hartman wrote: > On Thu, May 16, 2019 at 10:07:16AM +1000, Tobin C. Harding wrote: > > Currently kobject_add_varg() calls kobject_set_name_vargs() then returns > > the return value of kobject_add_internal(). kobject

[RFC PATCH] kobject: Clean up allocated memory on failure

2019-05-15 Thread Tobin C. Harding
the principle of least surprise. Check return value of kobject_add_internal() and free previously allocated memory on failure. Signed-off-by: Tobin C. Harding --- Hi Greg, Pretty excited by this one, if this is correct it means that kobject initialisation code, in the error path, can now use either

Re: [PATCH 3.18 78/86] bridge: Fix error path for kobject_init_and_add()

2019-05-15 Thread Tobin C. Harding
On Wed, May 15, 2019 at 12:55:55PM +0200, Greg Kroah-Hartman wrote: > From: "Tobin C. Harding" > > [ Upstream commit bdfad5aec1392b93495b77b864d58d7f101dc1c1 ] Greg you are not going to back port all of these kobject fixes are you? There is going to be a _lot_ of t

[PATCH] powerpc: Remove double free

2019-05-15 Thread Tobin C. Harding
kfree() after kobject_put(). Who ever wrote this was on crack. Fixes: 7e8039795a80 ("powerpc/cacheinfo: Fix kobject memleak") Signed-off-by: Tobin C. Harding --- FTR git log --pretty=format:"%h%x09%an%x09%ad%x09%s" | grep 7e8039795a80 7e8039795a80Tobin C. Harding

Re: [PATCH] gfs2: Fix error path kobject memory leak

2019-05-13 Thread Tobin C. Harding
On Mon, May 13, 2019 at 09:14:05AM +0200, Greg Kroah-Hartman wrote: > On Mon, May 13, 2019 at 01:32:13PM +1000, Tobin C. Harding wrote: > > If a call to kobject_init_and_add() fails we must call kobject_put() > > otherwise we leak memory. > > > > Function always calls k

[PATCH] ocfs2: Fix error path kobject memory leak

2019-05-12 Thread Tobin C. Harding
-by: Tobin C. Harding --- Is it ok to send patches during the merge window? Applies on top of Linus' mainline tag: v5.1 Happy to rebase if there are conflicts. thanks, Tobin. fs/ocfs2/filecheck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ocfs2/filecheck.c b/fs/ocfs2/filecheck.c index

Re: kobject_init_and_add() confusion

2019-05-11 Thread Tobin C. Harding
On Fri, May 10, 2019, at 19:40, Petr Mladek wrote: > On Fri 2019-05-10 12:35:38, Tobin C. Harding wrote: > > On Wed, May 01, 2019 at 09:54:16AM +0200, Rafael J. Wysocki wrote: > > > On Wed, May 1, 2019 at 1:38 AM Tobin C. Harding wrote: > > > > TODO > >

Re: kobject_init_and_add() confusion

2019-05-09 Thread Tobin C. Harding
On Wed, May 01, 2019 at 09:54:16AM +0200, Rafael J. Wysocki wrote: > On Wed, May 1, 2019 at 1:38 AM Tobin C. Harding wrote: > > > > Hi, > > > > Looks like I've created a bit of confusion trying to fix memleaks in > > calls to kobject_init_and_add().

Re: [RFC PATCH 3/5] kobject: Fix kernel-doc comment first line

2019-05-06 Thread Tobin C. Harding
On Fri, May 03, 2019 at 09:56:07AM +0200, Johan Hovold wrote: > On Fri, May 03, 2019 at 11:40:15AM +1000, Tobin C. Harding wrote: > > On Thu, May 02, 2019 at 10:39:22AM +0200, Johan Hovold wrote: > > > On Thu, May 02, 2019 at 06:25:39PM +1000, Tobin C. Harding wrote: > &

Re: [RFC PATCH 3/5] kobject: Fix kernel-doc comment first line

2019-05-02 Thread Tobin C. Harding
On Thu, May 02, 2019 at 10:39:22AM +0200, Johan Hovold wrote: > On Thu, May 02, 2019 at 06:25:39PM +1000, Tobin C. Harding wrote: > Adding > Jon to CC > > > > On Thu, May 02, 2019 at 09:38:23AM +0200, Johan Hovold wrote: > > > On Thu, May 02, 2019 at 12:31:40PM

Re: [PATCH] kobject: clean up the kobject add documentation a bit more

2019-05-02 Thread Tobin C. Harding
ly be more explicit > as to exactly what needs to happen here once you register a kobject with the > kobject core. > > Cc: Tobin C. Harding > Fixes: 1fd7c3b438a2 ("kobject: Improve doc clarity kobject_init_and_add()") > Signed-off-by: Greg Kroah-Hartman > &g

Re: kobject_init_and_add() confusion

2019-05-02 Thread Tobin C. Harding
On Thu, May 02, 2019 at 10:34:12AM +0200, Petr Mladek wrote: > On Wed 2019-05-01 09:38:03, Tobin C. Harding wrote: > > Hi, > > > > Looks like I've created a bit of confusion trying to fix memleaks in > > calls to kobject_init_and_add(). Its spread over various patch

Re: [RFC PATCH 5/5] livepatch: Do not manually track kobject initialization

2019-05-02 Thread Tobin C. Harding
On Thu, May 02, 2019 at 09:30:44AM +0200, Petr Mladek wrote: > On Thu 2019-05-02 09:12:32, Greg Kroah-Hartman wrote: > > On Thu, May 02, 2019 at 12:31:42PM +1000, Tobin C. Harding wrote: > > > Currently we use custom logic to track kobject initialization. Recently > >

Re: [RFC PATCH 3/5] kobject: Fix kernel-doc comment first line

2019-05-02 Thread Tobin C. Harding
Adding Jon to CC On Thu, May 02, 2019 at 09:38:23AM +0200, Johan Hovold wrote: > On Thu, May 02, 2019 at 12:31:40PM +1000, Tobin C. Harding wrote: > > kernel-doc comments have a prescribed format. This includes parenthesis > > on the function name. To be _particularly_ correct

Re: memleak around kobject_init_and_add()

2019-05-02 Thread Tobin C. Harding
On Thu, May 02, 2019 at 09:28:08AM +0200, Greg Kroah-Hartman wrote: > On Thu, May 02, 2019 at 09:17:42AM +0200, Greg Kroah-Hartman wrote: > > On Thu, May 02, 2019 at 07:56:16AM +1000, Tobin C. Harding wrote: > > > On Sat, Apr 27, 2019 at 09:28:09PM +0200, Greg Kroah-Hartman wro

[RFC PATCH 0/5] kobject: Add and use init predicate

2019-05-01 Thread Tobin C. Harding
ash during this. Was hoping to run the livepatch tests but not sure how to at this moment. Is dynamic Ftrace and livepatch testing something that can even be done in a VM or do I need to do this or baremetal? Thanks for taking the time to look at this. Tobin Tobin C. Harding (5): livepa

[RFC PATCH 1/5] livepatch: Fix kobject memleak

2019-05-01 Thread Tobin C. Harding
Currently error return from kobject_init_and_add() is not followed by a call to kobject_put(). This means there is a memory leak. Add call to kobject_put() in error path of kobject_init_and_add(). Signed-off-by: Tobin C. Harding --- kernel/livepatch/core.c | 12 +--- 1 file changed, 9

[RFC PATCH 5/5] livepatch: Do not manually track kobject initialization

2019-05-01 Thread Tobin C. Harding
Currently we use custom logic to track kobject initialization. Recently a predicate function was added to the kobject API so we now no longer need to do this. Use kobject API to check for initialized state of kobjects instead of using custom logic to track state. Signed-off-by: Tobin C. Harding

[RFC PATCH 2/5] kobject: Remove docstring reference to kset

2019-05-01 Thread Tobin C. Harding
Currently the docstring for kobject_get_path() mentions 'kset'. The kset is not used in the function callchain starting from this function. Remove docstring reference to kset from the function kobject_get_path(). Signed-off-by: Tobin C. Harding --- lib/kobject.c | 5 ++--- 1 file changed, 2

[RFC PATCH 4/5] kobject: Add kobject initialized predicate

2019-05-01 Thread Tobin C. Harding
->state_initialized. Signed-off-by: Tobin C. Harding --- include/linux/kobject.h | 2 ++ lib/kobject.c | 12 2 files changed, 14 insertions(+) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 1ab0d624fb36..65a317b65d9c 100644 --- a/include/linux/kobject.h ++

[RFC PATCH 3/5] kobject: Fix kernel-doc comment first line

2019-05-01 Thread Tobin C. Harding
present. Signed-off-by: Tobin C. Harding --- lib/kobject.c | 43 ++- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/kobject.c b/lib/kobject.c index 3eacd5b4643f..0181f102cd1c 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -18,7 +18,7

Re: kobject_init_and_add() confusion

2019-05-01 Thread Tobin C. Harding
On Wed, May 01, 2019 at 01:10:22PM +0200, Greg Kroah-Hartman wrote: > On Wed, May 01, 2019 at 09:38:03AM +1000, Tobin C. Harding wrote: > > Hi, > > > > Looks like I've created a bit of confusion trying to fix memleaks in > > calls to kobject_init_and_add(). Its

Re: memleak around kobject_init_and_add()

2019-05-01 Thread Tobin C. Harding
On Sat, Apr 27, 2019 at 09:28:09PM +0200, Greg Kroah-Hartman wrote: > On Sat, Apr 27, 2019 at 06:13:30PM +1000, Tobin C. Harding wrote: > > (Note at bottom on reasons for 'To' list 'Cc' list) > > > > Hi, > > > > kobject_init_and_add() seems to be

Re: kobject_init_and_add() confusion

2019-05-01 Thread Tobin C. Harding
On Wed, May 01, 2019 at 09:54:16AM +0200, Rafael J. Wysocki wrote: > On Wed, May 1, 2019 at 1:38 AM Tobin C. Harding wrote: > > > > Hi, > > > > Looks like I've created a bit of confusion trying to fix memleaks in > > calls to kobject_init_and_add().

kobject_init_and_add() confusion

2019-04-30 Thread Tobin C. Harding
Hi, Looks like I've created a bit of confusion trying to fix memleaks in calls to kobject_init_and_add(). Its spread over various patches and mailing lists so I'm starting a new thread and CC'ing anyone that commented on one of those patches. If there is a better way to go about this discussion

Re: [PATCH] mm: Fix kobject memleak in SLUB

2019-04-30 Thread Tobin C. Harding
On Sun, Apr 28, 2019 at 09:40:00AM +1000, Tobin C. Harding wrote: > Currently error return from kobject_init_and_add() is not followed by a > call to kobject_put(). This means there is a memory leak. > > Add call to kobject_put() in error path of kobject_init_and_add(). > > Si

Re: [PATCH 1/2] livepatch: Fix kobject memleak

2019-04-30 Thread Tobin C. Harding
On Tue, Apr 30, 2019 at 12:44:55PM +0200, Miroslav Benes wrote: > On Tue, 30 Apr 2019, Greg Kroah-Hartman wrote: > > > On Tue, Apr 30, 2019 at 10:15:33AM +1000, Tobin C. Harding wrote: > > > Currently error return from kobject_init_and_add() is not followed by a >

Re: [PATCH 1/3] bridge: Fix error path for kobject_init_and_add()

2019-04-30 Thread Tobin C. Harding
On Tue, Apr 30, 2019 at 10:28:15AM +1000, Tobin C. Harding wrote: [snip] Please do not consider this series for merge. There is a bit of confusion here. There are a few of theses patches live on various LKML lists. Have to consolidate all the knowledge. When I _actually_ know how to use

Re: [PATCH 2/2] livepatch: Use correct kobject cleanup function

2019-04-30 Thread Tobin C. Harding
On Tue, Apr 30, 2019 at 01:00:05PM +0200, Miroslav Benes wrote: > On Tue, 30 Apr 2019, Tobin C. Harding wrote: > > > The correct cleanup function after a call to kobject_init_and_add() has > > succeeded is kobject_del() _not_ kobject_put(). kobject_del() calls > > kob

Re: [PATCH 2/2] livepatch: Use correct kobject cleanup function

2019-04-30 Thread Tobin C. Harding
On Tue, Apr 30, 2019 at 05:08:11PM +0200, Petr Mladek wrote: > On Tue 2019-04-30 10:15:34, Tobin C. Harding wrote: > > The correct cleanup function after a call to kobject_init_and_add() has > > succeeded is kobject_del() _not_ kobject_put(). kobject_del() calls > > kobject_

Re: [PATCH] cpufreq: Fix kobject memleak

2019-04-30 Thread Tobin C. Harding
the error path of > kobject_init_and_add(). > > Signed-off-by: Viresh Kumar > --- > Tobin fixed this for schedutil already. For what its worth: Reviewed-by: Tobin C. Harding Thanks Viresh, one less for me to do! Tobin

Re: [tip:sched/urgent] sched/cpufreq: Fix kobject memleak

2019-04-30 Thread Tobin C. Harding
On Tue, Apr 30, 2019 at 11:26:27AM +0530, Viresh Kumar wrote: > On 29-04-19, 22:52, tip-bot for Tobin C. Harding wrote: > > Commit-ID: 8bf7ab9c79f3d1a5f02ebac369f656de9ec0aca8 > > Gitweb: > > https://git.kernel.org/tip/8bf7ab9c79f3d1a5f02ebac369f656de9ec0aca8 > > A

[tip:sched/urgent] sched/cpufreq: Fix kobject memleak

2019-04-30 Thread tip-bot for Tobin C. Harding
Commit-ID: 9a4f26cc98d81b67ecc23b890c28e2df324e29f3 Gitweb: https://git.kernel.org/tip/9a4f26cc98d81b67ecc23b890c28e2df324e29f3 Author: Tobin C. Harding AuthorDate: Tue, 30 Apr 2019 10:11:44 +1000 Committer: Ingo Molnar CommitDate: Tue, 30 Apr 2019 07:57:23 +0200 sched/cpufreq: Fix

[tip:sched/urgent] sched/cpufreq: Fix kobject memleak

2019-04-29 Thread tip-bot for Tobin C. Harding
Commit-ID: 8bf7ab9c79f3d1a5f02ebac369f656de9ec0aca8 Gitweb: https://git.kernel.org/tip/8bf7ab9c79f3d1a5f02ebac369f656de9ec0aca8 Author: Tobin C. Harding AuthorDate: Tue, 30 Apr 2019 10:11:44 +1000 Committer: Ingo Molnar CommitDate: Tue, 30 Apr 2019 06:24:09 +0200 sched/cpufreq: Fix

Re: [PATCH RESEND] sched/cpufreq: Fix kobject memleak

2019-04-29 Thread Tobin C. Harding
On Tue, Apr 30, 2019 at 06:24:43AM +0200, Ingo Molnar wrote: > > * Tobin C. Harding wrote: > > > Currently error return from kobject_init_and_add() is not followed by a > > call to kobject_put(). This means there is a memory leak. > > > > Add ca

[RFC PATCH v4 15/15] dcache: Add CONFIG_DCACHE_SMO

2019-04-29 Thread Tobin C. Harding
b mobility is enabled and the isolate/migrate functions are built in. Add CONFIG_DCACHE_SMO to guard the partial shrinking of the dcache via Slab Movable Objects infrastructure. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 4 mm/Kconfig | 7 +++ 2 files changed, 11 insertions(+) diff

[RFC PATCH v4 13/15] dcache: Provide a dentry constructor

2019-04-29 Thread Tobin C. Harding
In order to support object migration on the dentry cache we need to have a determined object state at all times. Without a constructor the object would have a random state after allocation. Provide a dentry constructor. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 30

[RFC PATCH v4 11/15] slub: Enable moving objects to/from specific nodes

2019-04-29 Thread Tobin C. Harding
node (from N1 -> to N2): echo "N1 N2" > move This also enables shrinking slabs on a specific node: echo "N1 N1" > move Signed-off-by: Tobin C. Harding --- mm/Kconfig | 7 ++ mm/slub.c | 249 + 2 fi

[RFC PATCH v4 12/15] slub: Enable balancing slabs across nodes

2019-04-29 Thread Tobin C. Harding
, no other value accepted. This feature relies on SMO being enable for the cache, this is done with a call to, after the isolate/migrate functions have been defined. kmem_cache_setup_mobility(s, isolate, migrate) Signed-off-by: Tobin C. Harding --- mm/slub.c | 120

[RFC PATCH v4 14/15] dcache: Implement partial shrink via Slab Movable Objects

2019-04-29 Thread Tobin C. Harding
. Implement isolate and 'migrate' functions for the dentry slab cache. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 76 + 1 file changed, 76 insertions(+) diff --git a/fs/dcache.c b/fs/dcache.c index 3d6cc06eca56..3f9daba1cc78 100644 --- a/fs

[RFC PATCH v4 10/15] tools/testing/slab: Add XArray movable objects tests

2019-04-29 Thread Tobin C. Harding
partial slab. Signed-off-by: Tobin C. Harding --- tools/testing/slab/Makefile | 2 +- tools/testing/slab/slub_defrag_xarray.c | 211 2 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 tools/testing/slab/slub_defrag_xarray.c diff --git

[RFC PATCH v4 09/15] xarray: Implement migration function for objects

2019-04-29 Thread Tobin C. Harding
ache (thanks Matthew). Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- lib/radix-tree.c | 13 + lib/xarray.c | 49 2 files changed, 62 insertions(+) diff --git a/lib/radix-tree.c b/lib/radix-tree.c i

[RFC PATCH v4 08/15] tools/testing/slab: Add object migration test suite

2019-04-29 Thread Tobin C. Harding
... verified movable slabs are shrinkable Removing module slub_defrag ... Signed-off-by: Tobin C. Harding --- tools/testing/slab/slub_defrag.c | 1 + tools/testing/slab/slub_defrag.py | 451 ++ 2 files changed, 452 insertions(+) create mode 100755 tools/testing/slab

[RFC PATCH v4 07/15] tools/testing/slab: Add object migration test module

2019-04-29 Thread Tobin C. Harding
ber of objects): # cd /sys/kernel/debug/smo # echo 'test' > callfn [3.576617] smo: test using nr_objs: 1000 keep: 10 [3.580169] smo: Module tests completed successfully Signed-off-by: Tobin C. Harding --- tools/testing/slab/Makefile | 10 + tools/testing/slab/slub_defrag.

[RFC PATCH v4 06/15] tools/vm/slabinfo: Add defrag_used_ratio output

2019-04-29 Thread Tobin C. Harding
Add output for the newly added defrag_used_ratio sysfs knob. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index d2c22f9ee2d8..ef4ff93df4cc 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm

[RFC PATCH v4 05/15] tools/vm/slabinfo: Add remote node defrag ratio output

2019-04-29 Thread Tobin C. Harding
Add output line for NUMA remote node defrag ratio. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index cbfc56c44c2f..d2c22f9ee2d8 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm

[RFC PATCH v4 04/15] slub: Slab defrag core

2019-04-29 Thread Tobin C. Harding
all to the recently added function: void kmem_cache_setup_mobility(struct kmem_cache *, kmem_cache_isolate_func, kmem_cache_migrate_func); Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Hard

[RFC PATCH v4 02/15] tools/vm/slabinfo: Add support for -C and -M options

2019-04-29 Thread Tobin C. Harding
-C lists caches that use a ctor. -M lists caches that support object migration. Add command line options to show caches with a constructor and caches that are movable (i.e. have migrate function). Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 40

[RFC PATCH v4 03/15] slub: Sort slab cache list

2019-04-29 Thread Tobin C. Harding
It is advantageous to have all defragmentable slabs together at the beginning of the list of slabs so that there is no need to scan the complete list. Put defragmentable caches first when adding a slab cache and others last. Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Harding

[RFC PATCH v4 01/15] slub: Add isolate() and migrate() methods

2019-04-29 Thread Tobin C. Harding
' callbacks. Co-developed-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- include/linux/slab.h | 70 include/linux/slub_def.h | 3 ++ mm/slub.c| 59 + 3 files changed, 126 insertions(+), 6

[RFC PATCH v4 00/15] Slab Movable Objects (SMO)

2019-04-29 Thread Tobin C. Harding
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

[PATCH RESEND] sched/cpufreq: Fix kobject memleak

2019-04-29 Thread Tobin C. Harding
Currently error return from kobject_init_and_add() is not followed by a call to kobject_put(). This means there is a memory leak. Add call to kobject_put() in error path of kobject_init_and_add(). Signed-off-by: Tobin C. Harding --- Resend with SOB tag. kernel/sched/cpufreq_schedutil.c | 1

[PATCH 2/2] livepatch: Use correct kobject cleanup function

2019-04-29 Thread Tobin C. Harding
The correct cleanup function after a call to kobject_init_and_add() has succeeded is kobject_del() _not_ kobject_put(). kobject_del() calls kobject_put(). Use correct cleanup function when removing a kobject. Signed-off-by: Tobin C. Harding --- kernel/livepatch/core.c | 8 +++- 1 file

[PATCH 0/2] livepatch: Fix usage of kobject_init_and_add()

2019-04-29 Thread Tobin C. Harding
of an effort to check/fix all callsites of kobject_init_and_add(). This set fixes all callsites under kernel/livepatch/ thanks, Tobin. Tobin C. Harding (2): livepatch: Fix kobject memleak livepatch: Use correct kobject cleanup function kernel/livepatch/core.c | 20 1

[PATCH 1/2] livepatch: Fix kobject memleak

2019-04-29 Thread Tobin C. Harding
Currently error return from kobject_init_and_add() is not followed by a call to kobject_put(). This means there is a memory leak. Add call to kobject_put() in error path of kobject_init_and_add(). Signed-off-by: Tobin C. Harding --- kernel/livepatch/core.c | 12 +--- 1 file changed, 9

[PATCH] sched/cpufreq: Fix kobject memleak

2019-04-29 Thread Tobin C. Harding
Currently error return from kobject_init_and_add() is not followed by a call to kobject_put(). This means there is a memory leak. Add call to kobject_put() in error path of kobject_init_and_add(). --- kernel/sched/cpufreq_schedutil.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: memleak around kobject_init_and_add()

2019-04-28 Thread Tobin C. Harding
On Mon, Apr 29, 2019, at 02:15, Greg Kroah-Hartman wrote: > On Sun, Apr 28, 2019 at 11:19:57AM +1000, Tobin C. Harding wrote: > > On Sat, Apr 27, 2019 at 09:28:09PM +0200, Greg Kroah-Hartman wrote: > > > On Sat, Apr 27, 2019 at 06:13:30PM +1000, Tobin C. Harding wrote: >

Re: memleak around kobject_init_and_add()

2019-04-27 Thread Tobin C. Harding
On Sat, Apr 27, 2019 at 09:28:09PM +0200, Greg Kroah-Hartman wrote: > On Sat, Apr 27, 2019 at 06:13:30PM +1000, Tobin C. Harding wrote: > > (Note at bottom on reasons for 'To' list 'Cc' list) > > > > Hi, > > > > kobject_init_and_add() seems to be

[PATCH] kobject: Improve docs for kobject_add/del

2019-04-27 Thread Tobin C. Harding
There is currently some confusion on how to wind back kobject_init_and_add() during the error paths in code that uses this function. Add documentation to kobject_add() and kobject_del() to help clarify the usage. Signed-off-by: Tobin C. Harding --- The assumption is that this is the correct

  1   2   3   4   5   6   7   8   9   10   >