Skip to content

Commit

Permalink
mm: struct shrink_control: keep int fields together
Browse files Browse the repository at this point in the history
Patch series "Reorderings in struct shrinker and struct shrink_control".

These structures are intensively used during reclaim and, displace other
data in cache, so there is no a reason they have int fields not grouped
together.

This patch (of 2):

gfp_t is of unsigned type, so let's move nid to keep them together.

Link: http://lkml.kernel.org/r/153199747930.21131.861043607301997810.stgit@localhost.localdomain
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Kirill Tkhai authored and Linus Torvalds committed Aug 22, 2018
1 parent 8df4a44 commit 92be775
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/shrinker.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
struct shrink_control {
gfp_t gfp_mask;

/* current node being shrunk (for NUMA aware shrinkers) */
int nid;

/*
* How many objects scan_objects should scan and try to reclaim.
* This is reset before every call, so it is safe for callees
Expand All @@ -26,9 +29,6 @@ struct shrink_control {
*/
unsigned long nr_scanned;

/* current node being shrunk (for NUMA aware shrinkers) */
int nid;

/* current memcg being shrunk (for memcg aware shrinkers) */
struct mem_cgroup *memcg;
};
Expand Down

0 comments on commit 92be775

Please sign in to comment.