Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96cb4df5 authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds
Browse files

page-allocator: add inactive ratio calculation function of each zone



Factor the per-zone arithemetic inside setup_per_zone_inactive_ratio()'s
loop into a a separate function, calculate_zone_inactive_ratio().  This
function will be used in a later patch

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: default avatarMinchan Kim <minchan.kim@gmail.com>
Reviewed-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bc75d33f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1053,6 +1053,7 @@ extern void set_dma_reserve(unsigned long new_dma_reserve);
extern void memmap_init_zone(unsigned long, int, unsigned long,
				unsigned long, enum memmap_context);
extern void setup_per_zone_wmarks(void);
extern void calculate_zone_inactive_ratio(struct zone *zone);
extern void mem_init(void);
extern void __init mmap_init(void);
extern void show_mem(void);
+16 −12
Original line number Diff line number Diff line
@@ -4478,11 +4478,8 @@ void setup_per_zone_wmarks(void)
 *    1TB     101        10GB
 *   10TB     320        32GB
 */
static void __init setup_per_zone_inactive_ratio(void)
void calculate_zone_inactive_ratio(struct zone *zone)
{
	struct zone *zone;

	for_each_zone(zone) {
	unsigned int gb, ratio;

	/* Zone size in gigabytes */
@@ -4494,6 +4491,13 @@ static void __init setup_per_zone_inactive_ratio(void)

	zone->inactive_ratio = ratio;
}

static void __init setup_per_zone_inactive_ratio(void)
{
	struct zone *zone;

	for_each_zone(zone)
		calculate_zone_inactive_ratio(zone);
}

/*