mm: use unsigned types for fragmentation score

Proactive compaction uses per-node/zone "fragmentation score" which is
always in range [0, 100], so use unsigned type of these scores as well as
for related constants.

Signed-off-by: Nitin Gupta <nigupta@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Baoquan He <bhe@redhat.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Link: http://lkml.kernel.org/r/20200618010319.13159-1-nigupta@nvidia.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Nitin Gupta
2020-08-11 18:31:07 -07:00
committed by Linus Torvalds
parent 25788738eb
commit d34c0a7599
4 changed files with 13 additions and 13 deletions

View File

@@ -1101,7 +1101,7 @@ static int __fragmentation_index(unsigned int order, struct contig_page_info *in
* It is defined as the percentage of pages found in blocks of size
* less than 1 << order. It returns values in range [0, 100].
*/
int extfrag_for_order(struct zone *zone, unsigned int order)
unsigned int extfrag_for_order(struct zone *zone, unsigned int order)
{
struct contig_page_info info;