Skip to content

Commit

Permalink
tools/vm/slabinfo: fix sanity checks enabling
Browse files Browse the repository at this point in the history
The sysfs file name for enabling sanity checking is called
'sanity_checks' and not 'sanity'.

The name of the file has never changed since the introduction of the
slub allocator.  Obviously, most people turn the checks on via the
command line option and not during runtime using slabinfo.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Daniel Wagner <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: "Tobin C. Harding" <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
igaw authored and torvalds committed Jan 31, 2020
1 parent 648b5cf commit e25974a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/vm/slabinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,11 @@ static void slab_debug(struct slabinfo *s)
return;

if (sanity && !s->sanity_checks) {
set_obj(s, "sanity", 1);
set_obj(s, "sanity_checks", 1);
}
if (!sanity && s->sanity_checks) {
if (slab_empty(s))
set_obj(s, "sanity", 0);
set_obj(s, "sanity_checks", 0);
else
fprintf(stderr, "%s not empty cannot disable sanity checks\n", s->name);
}
Expand Down

0 comments on commit e25974a

Please sign in to comment.