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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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
#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
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
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
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
).
- 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
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
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
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
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
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
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
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
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
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
> > @
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
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
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
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
>
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. '
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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()
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
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 ++
-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
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
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
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
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
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
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
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
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
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
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
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
:
- 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"
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
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
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
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
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
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
>
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:
> &
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.
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
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
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
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:
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
: 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
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
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
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
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
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
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
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.
: 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
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
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
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: >
&
(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
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()
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
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
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
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()
301 - 400 of 971 matches
Mail list logo