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

2019-04-10 Thread Tobin C. Harding
plicit that no reallocation is done. Implement isolate and 'migrate' functions for the dentry slab cache. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 71 + 1 file changed, 71 insertions(+) diff --git a/fs/dcache.c b/fs/dcache.c ind

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

2019-04-10 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 | 31

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

2019-04-10 Thread Tobin C. Harding
On Thu, Apr 11, 2019 at 03:33:22AM +0100, Al Viro wrote: > On Thu, Apr 11, 2019 at 11:34:40AM +1000, Tobin C. Harding wrote: > > +/* > > + * d_isolate() - Dentry isolation callback function. > > + * @s: The dentry cache. > > + * @v: Vector of pointers to the objects to i

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

2019-04-10 Thread Tobin C. Harding
On Thu, Apr 11, 2019 at 05:47:46AM +0100, Al Viro wrote: > On Thu, Apr 11, 2019 at 12:48:21PM +1000, Tobin C. Harding wrote: > > > Oh, so putting entries on a shrink list is enough to pin them? > > Not exactly pin, but __dentry_kill() has this: > if (dentry->d_fl

Re: [PATCH 4/6] lib/string: Add string copy/zero function

2019-02-25 Thread Tobin C. Harding
On Wed, Feb 20, 2019 at 04:48:18PM -0800, Kees Cook wrote: > On Mon, Feb 18, 2019 at 3:24 PM Tobin C. Harding wrote: > > > > We have a function to copy strings safely and we have a function to copy > > strings _and_ zero the tail of the destination (if source strin

Re: [PATCH v2 1/1] lib/string: Add strscpy_pad() function

2019-02-25 Thread Tobin C. Harding
On Mon, Feb 25, 2019 at 10:19:47AM +0200, Andy Shevchenko wrote: > On Mon, Feb 25, 2019 at 6:17 AM Tobin C. Harding wrote: > > > > We have a function to copy strings safely and we have a function to copy > > strings and zero the tail of the destination (if source strin

Re: [PATCH v2 1/1] lib/string: Add strscpy_pad() function

2019-02-25 Thread Tobin C. Harding
On Tue, Feb 26, 2019 at 08:31:09AM +1100, Tobin C. Harding wrote: > On Mon, Feb 25, 2019 at 10:19:47AM +0200, Andy Shevchenko wrote: > > On Mon, Feb 25, 2019 at 6:17 AM Tobin C. Harding wrote: > > > > > > We have a function to copy strings safely and we have a functio

Re: [PATCH v2 1/1] lib/string: Add strscpy_pad() function

2019-02-26 Thread Tobin C. Harding
On Mon, Feb 25, 2019 at 01:38:44PM -0800, Kees Cook wrote: > On Sun, Feb 24, 2019 at 8:16 PM Tobin C. Harding wrote: > > > > We have a function to copy strings safely and we have a function to copy > > strings and zero the tail of the destination (if source string is > &g

[PATCH v2 0/4] drivers: staging: checkpatch fixes

2016-04-17 Thread Tobin C Harding
drivers/staging/android/ion/ion.c produces 2 warnings and 29 checks. This patch set fixes both warnings and all but 4 of the checks. All except the last patch are trivial. Signed-off-by: Tobin C Harding --- Patch 1/4 is whitespace only. This is my first Linux kernel patch. thanks Tobin C

[PATCH v2 1/4] drivers: staging: fix parameter alignment

2016-04-17 Thread Tobin C Harding
drivers/staging/android/ion/ion.c checkpatch produces alignment checks. This patch is whitespace only and fixes these checks. Signed-off-by: Tobin C Harding --- drivers/staging/android/ion/ion.c | 64 +++ 1 file changed, 32 insertions(+), 32 deletions

[PATCH v2 4/4] drivers: staging: remove BUG_ON

2016-04-17 Thread Tobin C Harding
drivers/staging/android/ion/ion.c calls BUG_ON in places where WARN_ON will suffice. This patch replaces two such occurences. Two other occurences remain. Signed-off-by: Tobin C Harding --- Changing the remaining two BUG_ON's causes changes to the programm logic. This is my first patch s

[PATCH v2 3/4] drivers: staging: remove comparison to NULL

2016-04-17 Thread Tobin C Harding
drivers/staging/android/ion/ion.c checkpatch produces 'Comparison to NULL could be written ...' checks. This patch replaces comparison to NULL with !var as suggested by checkpatch. Signed-off-by: Tobin C Harding --- drivers/staging/android/ion/ion.c | 6 +++--- 1 file changed, 3

[PATCH v2 2/4] drivers: staging: fix line length

2016-04-17 Thread Tobin C Harding
drivers/staging/android/ion/ion.c checkpatch produces line over 80 character warnings. This patch is whitespace only and fixes these warnings. Signed-off-by: Tobin C Harding --- drivers/staging/android/ion/ion.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 4/4] tools/vm/slabinfo: Clean up usage menu debug items

2019-02-11 Thread Tobin C. Harding
Attempt to make the usage comment for debug options a little cleaner. Signed-off-by: Tobin C. Harding Acked-by: Christoph Lameter --- tools/vm/slabinfo.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index

[PATCH 0/4] tools/vm/slabinfo: Clean up slabinfo -h

2019-02-11 Thread Tobin C. Harding
Hi Andrew, Here is a simple patchset cleaning up the help output message for `slabinfo`. All patches include Acked-by tag from Christopher (patches were viewed and acked off list). thanks, Tobin Tobin C. Harding (4): tools/vm/slabinfo: Update options in usage message tools/vm/slabinfo

[PATCH 2/4] tools/vm/slabinfo: Put options in alphabetic order

2019-02-11 Thread Tobin C. Harding
Primarily the usage message lists options in alphabetic order however there are a bunch of the options that are not in alphabetic order. Put options in alphabetic order. Signed-off-by: Tobin C. Harding Acked-by: Christoph Lameter --- tools/vm/slabinfo.c | 11 ++- 1 file changed, 6

[PATCH 3/4] tools/vm/slabinfo: Align usage output columns

2019-02-11 Thread Tobin C. Harding
Usage message uses spaces not tabspaces, a few tabspaces have snuck in making the columns not align correctly when output. Align usage output columns using spaces instead of tabspaces. Signed-off-by: Tobin C. Harding Acked-by: Christoph Lameter --- tools/vm/slabinfo.c | 6 +++--- 1 file

[PATCH 1/4] tools/vm/slabinfo: Update options in usage message

2019-02-11 Thread Tobin C. Harding
Currently usage message list only a subset of the available options. should list them all. Update options in usage massage to include all available options. Signed-off-by: Tobin C. Harding Acked-by: Christoph Lameter --- tools/vm/slabinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] xarray: Document erasing entries during iteration

2019-02-11 Thread Tobin C. Harding
thing *thing; unsigned long index; xa_for_each(&things, index, thing) xa_erase(&things, index); } Document this feature explicitly in the docs and also for the macro definition. Signed-off-by: Tobin C. Harding --- Hi Willy,

[PATCH v4 2/7] slob: Respect list_head abstraction layer

2019-03-17 Thread Tobin C. Harding
cognitive load required to read the code. Use list_head functions to interact with lists thereby maintaining the abstraction provided by the list_head structure. Signed-off-by: Tobin C. Harding --- mm/slob.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a

[PATCH v4 4/7] slub: Add comments to endif pre-processor macros

2019-03-17 Thread Tobin C. Harding
#ifdef CONFIG_FOO ... #endif /* CONFIG_FOO */ Add comments to endif pre-processor macros if ifdef/endif pair is not immediately apparent. Acked-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- mm/slub.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[PATCH v4 5/7] slub: Use slab_list instead of lru

2019-03-17 Thread Tobin C. Harding
of slabs. Acked-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- mm/slub.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index b282e22885cd..d692b5e0163d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -102

[PATCH v4 7/7] mm: Remove stale comment from page struct

2019-03-17 Thread Tobin C. Harding
We now use the slab_list list_head instead of the lru list_head. This comment has become stale. Remove stale comment from page struct slab_list list_head. Acked-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- include/linux/mm_types.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v4 1/7] list: Add function list_rotate_to_front()

2019-03-17 Thread Tobin C. Harding
lob allocatator. Add function list_rotate_to_front() to rotate a list until the specified item is at the front of the list. Signed-off-by: Tobin C. Harding --- include/linux/list.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/include/linux/list.h b/include/linux/list.h ind

[PATCH v4 0/7] mm: Use slab_list list_head instead of lru

2019-03-17 Thread Tobin C. Harding
). - 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 sla

[PATCH v4 3/7] slob: Use slab_list instead of lru

2019-03-17 Thread Tobin C. Harding
ead for maintaining lists of slabs. Reviewed-by: Roman Gushchin Signed-off-by: Tobin C. Harding --- mm/slob.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/slob.c b/mm/slob.c index 39ad9217ffea..21af3fdb457a 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -1

[PATCH v4 6/7] slab: Use slab_list instead of lru

2019-03-17 Thread Tobin C. Harding
of slabs. Signed-off-by: Tobin C. Harding --- mm/slab.c | 49 + 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 28652e4218e0..09cc64ef9613 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1710,8 +1710,8 @@ sta

[PATCH v2 05/13] docs: filesystems: vfs: Use correct initial heading

2019-03-18 Thread Tobin C. Harding
Kernel RST has a preferred heading adornment scheme. Currently all the heading adornments follow this scheme except the document heading. Use correct heading adornment for initial heading. Tested-by: Randy Dunlap Signed-off-by: Tobin C. Harding --- Documentation/filesystems/vfs.txt | 5

[PATCH v2 13/13] docs: filesystems: vfs: Use backticks to guard star

2019-03-18 Thread Tobin C. Harding
Sphinx emits a warning because of the use of a * (C pointer construct) within the document. We can prevent this by guarding the C source code with back ticks. Use backticks to guard star (C pointer). Tested-by: Randy Dunlap Signed-off-by: Tobin C. Harding --- Documentation/filesystems

[PATCH v2 11/13] docs: filesystems: vfs: Clean up lists

2019-03-18 Thread Tobin C. Harding
to list items. Clean up lists by: - Adding missing periods. - Correcting the column width. - Correcting the indentation. Tested-by: Randy Dunlap Signed-off-by: Tobin C. Harding --- Documentation/filesystems/vfs.rst | 1114 ++--- 1 file changed, 557 insertions(+), 557

[PATCH v3] xarray: Document erasing entries during iteration

2019-02-13 Thread Tobin C. Harding
s and also for the macro definition. Signed-off-by: Tobin C. Harding --- v2 -> v3: - Put document comment in a better place, tie together current discussion of xa_for_each(), xa_erase(), and xa_destroy(). - Improve commit message. - Actually build the docs and verify the patched file re

Re: [PATCH 3/3] leaking_addresses: Expand tilde in output file name

2019-02-13 Thread Tobin C. Harding
On Thu, Feb 07, 2019 at 04:35:55PM -0700, Tycho Andersen wrote: > On Fri, Feb 08, 2019 at 09:50:26AM +1100, Tobin C. Harding wrote: > > Currently if user passes an output file to the script via > > --output-raw we do not handle expansion of tilde. > > > > Use perl func

Re: linux-next: Signed-off-by missing for commit in the leaks tree

2019-02-14 Thread Tobin C. Harding
On Thu, Feb 14, 2019 at 06:36:05PM +1100, Stephen Rothwell wrote: > Hi Tobin, > > Commit > > 5d06b3fc8e61 ("leaking_addresses: Completely remove --version flag") > > is missing a Signed-off-by from its author and committer. Thanks, fixed. Tobin signature.asc Description: PGP signa

Re: [PATCH 5/6] lib: Fix function documentation for strncpy_from_user

2019-02-19 Thread Tobin C. Harding
On Tue, Feb 19, 2019 at 01:51:45AM +0100, Jann Horn wrote: > +cc Andy because he's also preparing a patch for this function > > On Tue, Feb 19, 2019 at 12:25 AM Tobin C. Harding wrote: > > Current function documentation for strncpy_from_user() is incorrect. If > > @

Re: [PATCH 6/6] lib: Add function strscpy_from_user()

2019-02-19 Thread Tobin C. Harding
On Tue, Feb 19, 2019 at 03:12:33AM +0100, Jann Horn wrote: > On Tue, Feb 19, 2019 at 12:25 AM Tobin C. Harding wrote: > > Currently we have strncpy_from_userspace(). If the user string is > > longer than the destination kernel buffer we get an error code -EFAULT. > > We

Re: [PATCH 1/6] lib/string: Enable string selftesting

2019-02-19 Thread Tobin C. Harding
On Tue, Feb 19, 2019 at 12:55:09PM +0200, Andy Shevchenko wrote: > On Tue, Feb 19, 2019 at 4:44 AM Tobin C. Harding wrote: > > > > Currently we have a test module but it is not tied into the kselftest > > infrastructure. In preparation for adding string manipulation functio

Re: [PATCH 0/6] lib: Add safe string funtions

2019-02-20 Thread Tobin C. Harding
On Wed, Feb 20, 2019 at 03:31:07PM -0800, Kees Cook wrote: > On Mon, Feb 18, 2019 at 3:24 PM Tobin C. Harding wrote: > > During your talk at LCA you mentioned that we could do with a couple > > more safe string functions. One to zero the tail of the destination > > buffer

Re: [PATCH 1/6] lib/string: Enable string selftesting

2019-02-20 Thread Tobin C. Harding
On Wed, Feb 20, 2019 at 03:57:18PM -0800, Kees Cook wrote: > On Mon, Feb 18, 2019 at 3:24 PM Tobin C. Harding wrote: > > > > Currently we have a test module but it is not tied into the kselftest > > infrastructure. In preparation for adding string manipulation functions >

Re: [PATCH 2/6] lib/string: Fix erroneous 'overflow' documentation

2019-02-20 Thread Tobin C. Harding
On Wed, Feb 20, 2019 at 04:02:37PM -0800, Kees Cook wrote: > On Mon, Feb 18, 2019 at 3:24 PM Tobin C. Harding wrote: > > > > Current documentation uses 'overflow' to describe a situation where less > > data is written to a buffer than buffer size not more. '

Re: [PATCH 4/6] lib/string: Add string copy/zero function

2019-02-20 Thread Tobin C. Harding
On Wed, Feb 20, 2019 at 04:48:18PM -0800, Kees Cook wrote: > On Mon, Feb 18, 2019 at 3:24 PM Tobin C. Harding wrote: > > > > We have a function to copy strings safely and we have a function to copy > > strings _and_ zero the tail of the destination (if source strin

Re: [PATCH 5/6] lib: Fix function documentation for strncpy_from_user

2019-02-20 Thread Tobin C. Harding
On Wed, Feb 20, 2019 at 05:05:10PM -0800, Kees Cook wrote: > On Mon, Feb 18, 2019 at 4:52 PM Jann Horn wrote: > > AFAICS the byte_at_a_time loop exits when max==0 is reached, and then > > if `res >= count` (in other words, if we've copied as many bytes as > > requested, haven't encountered a null

[PATCH 2/3] leaking_addresses: Completely remove --version flag

2019-02-07 Thread Tobin C. Harding
Recently attempt to remove the '--version' flag was made, badly. I failed to remove mention of it from the help output. And also I failed to actually remove the flag from the options list. _Completely_ remove --version flag. Signed-off-by: Tobin C. Harding --- scripts/leaking_ad

[PATCH 3/3] leaking_addresses: Expand tilde in output file name

2019-02-07 Thread Tobin C. Harding
Currently if user passes an output file to the script via --output-raw we do not handle expansion of tilde. Use perl function glob() to expand tilde in output file name. Signed-off-by: Tobin C. Harding --- scripts/leaking_addresses.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 1/3] leaking_addresses: Fix calls to dprint

2019-02-07 Thread Tobin C. Harding
Currently calls to function dprint() are non uniform and at times incorrect. Use uniform _correct_ call to function dprint(). Signed-off-by: Tobin C. Harding --- scripts/leaking_addresses.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/leaking_addresses.pl

[PATCH 0/3] Minor bug fixes to leaking_addresses.pl

2019-02-07 Thread Tobin C. Harding
Hi, Here are a few minor fixes/improvements to scripts/leaking_addresses.pl Patch 1: Fixes places where I don't know how to Perl. Patch 2: Removes `--version` command line option, completely this time. Patch 3: Fix a bug in the command line options parsing. thanks, Tobin. Tobin C. Ha

Re: [PATCH 3/3] leaking_addresses: Expand tilde in output file name

2019-02-08 Thread Tobin C. Harding
On Thu, Feb 07, 2019 at 04:35:55PM -0700, Tycho Andersen wrote: > On Fri, Feb 08, 2019 at 09:50:26AM +1100, Tobin C. Harding wrote: > > Currently if user passes an output file to the script via > > --output-raw we do not handle expansion of tilde. > > > > Use perl func

Re: [PATCH] mm/slab: Increase width of first /proc/slabinfo column

2019-02-03 Thread Tobin C. Harding
On Fri, Feb 01, 2019 at 07:27:24PM -0800, Joe Perches wrote: > On Fri, 2019-02-01 at 11:42 +1100, Tobin C. Harding wrote: > > Increase the width of the first column (cache name) in the output of > > /proc/slabinfo from 17 to 30 characters. > > Do you care if this breaks

[PATCH v2 0/3] slub: Do trivial comments fixes

2019-02-03 Thread Tobin C. Harding
going in through his tree. Tobin C. Harding (3): slub: Capitialize comment string slub: Use C89 comment style slub: Correct grammar/punctuation in comments include/linux/slub_def.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.20.1

[PATCH v2 2/3] slub: Use C89 comment style

2019-02-03 Thread Tobin C. Harding
SLUB include file uses a c99 comment style. In line with the rest of the kernel lets use c89 comment style. Use C89 comment style. Signed-off-by: Tobin C. Harding --- include/linux/slub_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/slub_def.h b

[PATCH v2 3/3] slub: Correct grammar/punctuation in comments

2019-02-03 Thread Tobin C. Harding
Currently there are a few minor grammatical errors in the comments. While we are at it we can fix punctuation to be correct and uniform also. Correct grammar/punctuation in comments. Signed-off-by: Tobin C. Harding --- include/linux/slub_def.h | 8 1 file changed, 4 insertions(+), 4

[PATCH v2 1/3] slub: Capitialize comment string

2019-02-03 Thread Tobin C. Harding
SLUB include file has particularly clean comments, one comment string is holding us back. Capitialize comment string. Signed-off-by: Tobin C. Harding --- include/linux/slub_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/slub_def.h b/include/linux

Re: [PATCH] mm/slab: Increase width of first /proc/slabinfo column

2019-02-03 Thread Tobin C. Harding
On Thu, Jan 31, 2019 at 06:43:10PM -0800, Matthew Wilcox wrote: > On Fri, Feb 01, 2019 at 11:42:42AM +1100, Tobin C. Harding wrote: > > Currently when displaying /proc/slabinfo if any cache names are too long > > then the output columns are not aligned. We could do something fancy

Re: [PATCH] mm/slab: Increase width of first /proc/slabinfo column

2019-02-03 Thread Tobin C. Harding
On Fri, Feb 01, 2019 at 02:03:46PM -0800, Andrew Morton wrote: > On Thu, 31 Jan 2019 18:43:10 -0800 Matthew Wilcox wrote: > > > On Fri, Feb 01, 2019 at 11:42:42AM +1100, Tobin C. Harding wrote: > > > Currently when displaying /proc/slabinfo if any cache names are too long

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: kobject_init_and_add() confusion

2019-05-10 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 > > &g

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

2019-05-19 Thread Tobin C. Harding
ng with 'isolate' and 'migrate' 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 ++

[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
do this please 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 defr

[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
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 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
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 08/16] tools/testing/slab: Add object migration test suite

2019-05-19 Thread Tobin C. Harding
ling movable objects ... 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 10075

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

2019-05-19 Thread Tobin C. Harding
g : Off Lpadd: 352 We can run the stress tests (with the default number 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

[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 11/16] tools/testing/slab: Add XArray movable objects tests

2019-05-19 Thread Tobin C. Harding
remaining 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 di

[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 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
plicit that no reallocation is done. 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 ind

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

2019-05-19 Thread Tobin C. Harding
rs balance, 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/sl

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

2019-05-19 Thread Tobin C. Harding
obility 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

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

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 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 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: 15c8410c67 ("mm/slob.c: respect list_head abstraction layer"): WARNING: CPU: 0 PID: 1 at lib/list_debug.c:28 __list_add_valid

2019-04-03 Thread Tobin C. Harding
On Wed, Apr 03, 2019 at 03:54:17PM +1100, Tobin C. Harding wrote: > On Wed, Apr 03, 2019 at 10:00:38AM +0800, kernel test robot wrote: > > Greetings, > > > > 0day kernel testing robot got the below dmesg and the first bad commit is > > > > https://git.kernel.

Re: [RFC PATCH v2 14/14] dcache: Implement object migration

2019-04-04 Thread Tobin C. Harding
On Wed, Apr 03, 2019 at 06:48:55PM +0100, Al Viro wrote: > On Wed, Apr 03, 2019 at 06:19:21PM +0100, Al Viro wrote: > > On Wed, Apr 03, 2019 at 06:08:11PM +0100, Al Viro wrote: > > > > > Oh, *brilliant* > > > > > > Let's do d_invalidate() on random dentries and hope they go away. > > > With convo

Re: [RFC PATCH v2 14/14] dcache: Implement object migration

2019-04-04 Thread Tobin C. Harding
On Wed, Apr 03, 2019 at 06:19:21PM +0100, Al Viro wrote: > On Wed, Apr 03, 2019 at 06:08:11PM +0100, Al Viro wrote: > > > Oh, *brilliant* > > > > Let's do d_invalidate() on random dentries and hope they go away. > > With convoluted and brittle logics for deciding which ones to > > spare, which is

Re: [PATCH v3 2/7] kselftest: Add test runner creation script

2019-04-04 Thread Tobin C. Harding
On Tue, Apr 02, 2019 at 02:33:12PM -0700, Randy Dunlap wrote: > Hi, > > nits/typos below: Hey thanks for reviewing this Randy, first time I read it I got mixed up and thought the nits were against Kees' additions but I was wrong, thanks again. Tobin

[PATCH v4 0/6] lib/string: Add strscpy_pad() function

2019-04-04 Thread Tobin C. Harding
tor script with patch that uses it. - Fix typos (thanks Randy) - Add Kees' Acked-by tags to all patches thanks, Tobin. Tobin C. Harding (6): lib/test_printf: Add empty module_exit function kselftest: Add test runner creation script kselftest: Add test module framework header lib:

[PATCH v4 2/6] kselftest: Add test runner creation script

2019-04-04 Thread Tobin C. Harding
t;lib" run_tests and also $ cd /path/to/kernel/tree $ cd tools/testing/selftests $ sudo make O=$output_path TARGETS="lib" run_tests and also $ cd /path/to/kernel/tree $ cd tools/testing/selftests $ sudo make TARGETS="lib" run_tests Acked-by: Kees Cook Signed-off-by

[PATCH v4 3/6] kselftest: Add test module framework header

2019-04-04 Thread Tobin C. Harding
: Kees Cook Signed-off-by: Tobin C. Harding --- Documentation/dev-tools/kselftest.rst | 94 +- tools/testing/selftests/kselftest_module.h | 48 +++ 2 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/kselftest_module.h

[PATCH v4 1/6] lib/test_printf: Add empty module_exit function

2019-04-04 Thread Tobin C. Harding
Currently the test_printf module does not have an exit function, this prevents the module from being unloaded. If we cannot unload the module we cannot run the tests a second time. Add an empty exit function. Acked-by: Kees Cook Signed-off-by: Tobin C. Harding --- lib/test_printf.c | 6

[PATCH v4 6/6] lib: Add test module for strscpy_pad

2019-04-04 Thread Tobin C. Harding
Add a test module for the new strscpy_pad() function. Tie it into the kselftest infrastructure for lib/ tests. Acked-by: Kees Cook Signed-off-by: Tobin C. Harding --- lib/Kconfig.debug | 3 + lib/Makefile | 1 + lib/test_strscpy.c

[PATCH v4 5/6] lib/string: Add strscpy_pad() function

2019-04-04 Thread Tobin C. Harding
functionality. This is a chore, and also leaves us open to off by one errors unnecessarily. Add a function that calls strscpy() then memset()s the tail to zero if the source string is shorter than the destination buffer. Acked-by: Kees Cook Signed-off-by: Tobin C. Harding --- include/linux/string.h

[PATCH v4 4/6] lib: Use new kselftest header

2019-04-04 Thread Tobin C. Harding
C. Harding --- lib/test_bitmap.c | 20 lib/test_printf.c | 23 +-- 2 files changed, 9 insertions(+), 34 deletions(-) diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c index 6cd7d0740005..792d90608052 100644 --- a/lib/test_bitmap.c +++ b/lib/test_bitmap.c

Re: [PATCH v4 0/6] lib/string: Add strscpy_pad() function

2019-04-07 Thread Tobin C. Harding
On Fri, Apr 05, 2019 at 12:58:53PM +1100, Tobin C. Harding wrote: > Hi Shua, Apologies for continually leaving off the 'h' from your name Shuah. Tobin

Re: [PATCH] slab: fix a crash by reading /proc/slab_allocators

2019-04-07 Thread Tobin C. Harding
On Sat, Apr 06, 2019 at 06:59:01PM -0400, Qian Cai wrote: > The commit 510ded33e075 ("slab: implement slab_root_caches list") > changes the name of the list node within "struct kmem_cache" from > "list" to "root_caches_node" Are you sure? It looks to me like it adds a member to the memcg_cache_arr

Re: [PATCH] slab: fix a crash by reading /proc/slab_allocators

2019-04-07 Thread Tobin C. Harding
gt; static int leaks_show(struct seq_file *m, void *p) > { > - struct kmem_cache *cachep = list_entry(p, struct kmem_cache, list); > + struct kmem_cache *cachep = list_entry(p, struct kmem_cache, > + root_caches_node); > struct page *page; > struct kmem_cache_node *n; > const char *name; > -- > 2.17.2 (Apple Git-113) > For what its worth Reviewed-by: Tobin C. Harding thanks, Tobin.

[PATCH] ocfs2: Fix error path kobject memory leak

2019-05-12 Thread Tobin C. Harding
: 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

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] 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: [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: > &

memleak around kobject_init_and_add()

2019-04-27 Thread Tobin C. Harding
(Note at bottom on reasons for 'To' list 'Cc' list) Hi, kobject_init_and_add() seems to be routinely misused. A failed call to this function requires a call to kobject_put() otherwise we leak memory. Examples memleaks can be seen in: mm/slub.c fs/btrfs/sysfs.c fs/xfs/xf

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

[PATCH] mm: Fix kobject memleak in SLUB

2019-04-27 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 --- mm/slub.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH] kobject: Improve doc clarity kobject_init_and_add()

2019-04-27 Thread Tobin C. Harding
Function kobject_init_and_add() is currently misused in a number of places in the kernel. On error return kobject_put() must be called but is at times not. Make the function documentation more explicit about calling kobject_put() in the error path. Signed-off-by: Tobin C. Harding --- lib

[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

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

<    1   2   3   4   5   6   7   8   9   10   >