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

Commit d0a3e94c authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: change initial readahead window size calculation" into msm-4.9

parents 14dd1b8f 9a5f4020
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -233,6 +233,8 @@ int force_page_cache_readahead(struct address_space *mapping, struct file *filp,

/*
 * Set the initial window size, round to next power of 2 and square
 * Small size is not dependent on max value - only a one-page read is regarded
 * as small.
 * for small size, x 4 for medium, and x 2 for large
 * for 128k (32 page) max ra
 * 1-8 page = 32k initial, > 8 page = 128k initial
@@ -241,7 +243,7 @@ static unsigned long get_init_ra_size(unsigned long size, unsigned long max)
{
	unsigned long newsize = roundup_pow_of_two(size);

	if (newsize <= max / 32)
	if (newsize <= 1)
		newsize = newsize * 4;
	else if (newsize <= max / 4)
		newsize = newsize * 2;