diff options
author | Glauber Costa <[email protected]> | 2013-02-22 16:34:49 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2013-02-23 17:50:18 -0800 |
commit | 45cf7ebd5a03317eb825c9dcb8599750d8b16145 (patch) | |
tree | 3331759c81f08f2df0e5524b473bea282329dd6e /drivers/scsi/mpt3sas/mpi/mpi2_raid.h | |
parent | a4e1b4c6c6db7b7d1ca7f399b4e08aa381f23899 (diff) |
memcg: reduce the size of struct memcg 244-fold.
In order to maintain all the memcg bookkeeping, we need per-node
descriptors, which will in turn contain a per-zone descriptor.
Because we want to statically allocate those, this array ends up being
very big. Part of the reason is that we allocate something large enough
to hold MAX_NUMNODES, the compile time constant that holds the maximum
number of nodes we would ever consider.
However, we can do better in some cases if the firmware help us. This
is true for modern x86 machines; coincidentally one of the architectures
in which MAX_NUMNODES tends to be very big.
By using the firmware-provided maximum number of nodes instead of
MAX_NUMNODES, we can reduce the memory footprint of struct memcg
considerably. In the extreme case in which we have only one node, this
reduces the size of the structure from ~ 64k to ~2k. This is
particularly important because it means that we will no longer resort to
the vmalloc area for the struct memcg on defconfigs. We also have
enough room for an extra node and still be outside vmalloc.
One also has to keep in mind that with the industry's ability to fit
more processors in a die as fast as the FED prints money, a nodes = 2
configuration is already respectably big.
[[email protected]: add check for invalid nid, remove inline]
Signed-off-by: Glauber Costa <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Kamezawa Hiroyuki <[email protected]>
Cc: Johannes Weiner <[email protected]>
Reviewed-by: Greg Thelen <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Ying Han <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Rik van Riel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/scsi/mpt3sas/mpi/mpi2_raid.h')
0 files changed, 0 insertions, 0 deletions