Skip to content

Commit

Permalink
mm: vmscan: do not clear SHRINKER_NUMA_AWARE if nr_node_ids == 1
Browse files Browse the repository at this point in the history
Currently, on shrinker registration we clear SHRINKER_NUMA_AWARE if
there's the only NUMA node present.  The comment states that this will
allow us to save some small loop time later.  It used to be true when
this code was added (see commit 1d3d443 ("vmscan: per-node
deferred work")), but since commit 6b4f779 ("mm: vmscan: invoke
slab shrinkers from shrink_zone()") it doesn't make any difference.
Anyway, running on non-NUMA machine shouldn't make a shrinker NUMA
unaware, so zap this hunk.

Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Vladimir Davydov authored and Linus Torvalds committed Mar 15, 2016
1 parent 703fc13 commit cecf257
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,6 @@ int register_shrinker(struct shrinker *shrinker)
{
size_t size = sizeof(*shrinker->nr_deferred);

/*
* If we only have one possible node in the system anyway, save
* ourselves the trouble and disable NUMA aware behavior. This way we
* will save memory and some small loop time later.
*/
if (nr_node_ids == 1)
shrinker->flags &= ~SHRINKER_NUMA_AWARE;

if (shrinker->flags & SHRINKER_NUMA_AWARE)
size *= nr_node_ids;

Expand Down

0 comments on commit cecf257

Please sign in to comment.