Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11201089ybi; Thu, 25 Jul 2019 11:46:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqq9Fkfm4utp5khCnPQYJto1LSNhaLERbc4IyP9tnESoEVHxbcvkT3C48p67CY1lm/sTLg X-Received: by 2002:a65:690e:: with SMTP id s14mr74451688pgq.47.1564080411439; Thu, 25 Jul 2019 11:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564080411; cv=none; d=google.com; s=arc-20160816; b=zF/KT3VLGaZ0JypQN2ZyRzwGdFiOCiXS/ruAVVhCrwk2hak+vhtzxtZKTbj+8iUpvE ErFQUxaGhS3SqZtWe8C/DRGP310QdPHyM6PER8dtOc5Xu8VBxaaSm/8R5RbdBXycpke7 IVoMpvZ1ioVneOtzcvyvvMoTZyW8zt3X5El2N9hhn4CsOTPlEdBaQl+s/F27nPQSuX7m Twowr1naRKrK2UZd7jFK4EVIO10lbr0toPtulSzjpJGUaxucwyc8vG5ZrhqWOsaiES/i vfYGard6jarbYa4jSTJT6Jj66oIkS+MXsk0Vsua9MSkMxGKDwnAXB3iBcexKGnbI6xpJ BBzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=abO8zis5qyQ9jMy/dQEIxCIeoB176hkWi+GQror9w/4=; b=BYznYJE1VF2hKkmQVG0Aw9SmQVhJGHeYN+jc/3Ybw0h9qDpXkEX4Fqy7Wc+BEw1jHT xprQ/iPukWvzgLM+4O0ZtYghYf6lPkcdJlVbsIlpDGymPbffo58871UIaCrGpAtYlpKK cOPnvOGyAxczIWh4c0tRih1G3BT/YuL4G7Lt6ysVUPGrdQGRx0vplel2uZ5hkMQhtTlL o4sP4YuMVKU3UOGmPZaz20PW2W3xxO8kxk9APWsK0c5MnwOFNGRhFI/GidW9esslUn3D GYkjqI0P5fLCvTvIMzDJbICbp9T0sM6PmfKUwTUbfLU86UaL+xQJRPM8Jkql/ezw+Fpu DhQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vUtykOa0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h26si14490551pgl.398.2019.07.25.11.46.36; Thu, 25 Jul 2019 11:46:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vUtykOa0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726440AbfGYSoW (ORCPT + 99 others); Thu, 25 Jul 2019 14:44:22 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:45187 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbfGYSoV (ORCPT ); Thu, 25 Jul 2019 14:44:21 -0400 Received: by mail-pg1-f195.google.com with SMTP id o13so23453561pgp.12 for ; Thu, 25 Jul 2019 11:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=abO8zis5qyQ9jMy/dQEIxCIeoB176hkWi+GQror9w/4=; b=vUtykOa02Pa10uCbtLnoIvcUdFu3JThtZDgo7uW93gVBQuQ6Dc6mKJH4uPVqsVU8sm i3zJWEzbfjRWgBmpct25rX/J1WFFmQve2ve4ubTiw18sLQ4FYkdeyrDOw+4/zgtp8BH5 9jCeL2BIcDFv+r5lDJ3aWMEFu1UqN2LoN7OvZ9e+t0kt5VAG7L4hRS2R22GRIai/hOwX pezFLT9P8x3g0sId1DVpAF21XwTxPKS15UmJxeL38Jn92SA8bD7OsQy0F/vXKuA4OIQ3 IZ/5y9xvKWRRRKi9FOiV7vi5XrTFGoMZHdYAwycNVE6aGnoWCpR2Et1Uy8LS72Xkrzup tjEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=abO8zis5qyQ9jMy/dQEIxCIeoB176hkWi+GQror9w/4=; b=HZsIfLl3eHuV3fS9p4UvwnUjEOBO/k2JIni0bGG9Cj8JqDv73ZvtyWYJ/6xQ+cnFaO DzZOLrEq2kyscjXTljBL0FvEkkcjnJaFhqRUVGu2Ca5uSHK0JhltjGDp4LTxwkGFBH4c mCp9gcih07DtR94GahuGI5HbZJh27A+MEeFsPWG1VZ3NtOECN+f94FNwD+cifVxQF9ha PuHyzFASE/2wVhjcZLYWctd2kHydOaF1JTCzsi9AHhNbrO2OB1/Tq7aeSbOeQq/MZQrU JxApGe0ChX+uaDhDTmX6CgK9mv/xLqJMsPH7jafQhJ2TnvU9drYqMypsKFvNML9wGaal T8Ww== X-Gm-Message-State: APjAAAVSIXHLDQbbHAr14wXGVPjWMqc17zZubjl/PG9RCDkN1VRGQMHL E4xhilvnHm53fnzzivlYSOI= X-Received: by 2002:a63:f13:: with SMTP id e19mr87244311pgl.132.1564080260681; Thu, 25 Jul 2019 11:44:20 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:624:b8c3:8577:bf2f:3]) by smtp.gmail.com with ESMTPSA id w3sm43818257pgl.31.2019.07.25.11.44.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 11:44:20 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org Cc: mgorman@techsingularity.net, mhocko@suse.com, vbabka@suse.cz, cai@lca.pw, aryabinin@virtuozzo.com, osalvador@suse.de, rostedt@goodmis.org, mingo@redhat.com, pavel.tatashin@microsoft.com, rppt@linux.ibm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pengfei Li Subject: [PATCH 06/10] mm/compaction: make "order" unsigned int in compaction.c Date: Fri, 26 Jul 2019 02:42:49 +0800 Message-Id: <20190725184253.21160-7-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190725184253.21160-1-lpf.vector@gmail.com> References: <20190725184253.21160-1-lpf.vector@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since compact_control->order and compact_control->search_order have been modified to unsigned int in the previous commit, then some of the functions in compaction.c are modified accordingly. Signed-off-by: Pengfei Li --- include/linux/compaction.h | 12 ++++++------ mm/compaction.c | 21 ++++++++++----------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 9569e7c786d3..0201dfa57d44 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h @@ -96,8 +96,8 @@ extern enum compact_result try_to_compact_pages(gfp_t gfp_mask, const struct alloc_context *ac, enum compact_priority prio, struct page **page); extern void reset_isolation_suitable(pg_data_t *pgdat); -extern enum compact_result compaction_suitable(struct zone *zone, int order, - unsigned int alloc_flags, int classzone_idx); +extern enum compact_result compaction_suitable(struct zone *zone, + unsigned int order, unsigned int alloc_flags, int classzone_idx); extern void defer_compaction(struct zone *zone, int order); extern bool compaction_deferred(struct zone *zone, int order); @@ -170,8 +170,8 @@ static inline bool compaction_withdrawn(enum compact_result result) } -bool compaction_zonelist_suitable(struct alloc_context *ac, int order, - int alloc_flags); +bool compaction_zonelist_suitable(struct alloc_context *ac, + unsigned int order, int alloc_flags); extern int kcompactd_run(int nid); extern void kcompactd_stop(int nid); @@ -182,8 +182,8 @@ static inline void reset_isolation_suitable(pg_data_t *pgdat) { } -static inline enum compact_result compaction_suitable(struct zone *zone, int order, - int alloc_flags, int classzone_idx) +static inline enum compact_result compaction_suitable(struct zone *zone, + unsigned int order, int alloc_flags, int classzone_idx) { return COMPACT_SKIPPED; } diff --git a/mm/compaction.c b/mm/compaction.c index e47d8fa943a6..ac5df82d46e0 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1639,7 +1639,7 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) unsigned long distance; unsigned long pfn = cc->migrate_pfn; unsigned long high_pfn; - int order; + unsigned int order; /* Skip hints are relied on to avoid repeats on the fast search */ if (cc->ignore_skip_hint) @@ -1958,10 +1958,9 @@ static enum compact_result compact_finished(struct compact_control *cc) * COMPACT_SUCCESS - If the allocation would succeed without compaction * COMPACT_CONTINUE - If compaction should run now */ -static enum compact_result __compaction_suitable(struct zone *zone, int order, - unsigned int alloc_flags, - int classzone_idx, - unsigned long wmark_target) +static enum compact_result __compaction_suitable(struct zone *zone, + unsigned int order, unsigned int alloc_flags, + int classzone_idx, unsigned long wmark_target) { unsigned long watermark; @@ -1998,7 +1997,7 @@ static enum compact_result __compaction_suitable(struct zone *zone, int order, return COMPACT_CONTINUE; } -enum compact_result compaction_suitable(struct zone *zone, int order, +enum compact_result compaction_suitable(struct zone *zone, unsigned int order, unsigned int alloc_flags, int classzone_idx) { @@ -2036,7 +2035,7 @@ enum compact_result compaction_suitable(struct zone *zone, int order, return ret; } -bool compaction_zonelist_suitable(struct alloc_context *ac, int order, +bool compaction_zonelist_suitable(struct alloc_context *ac, unsigned int order, int alloc_flags) { struct zone *zone; @@ -2278,10 +2277,10 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) return ret; } -static enum compact_result compact_zone_order(struct zone *zone, int order, - gfp_t gfp_mask, enum compact_priority prio, - unsigned int alloc_flags, int classzone_idx, - struct page **capture) +static enum compact_result compact_zone_order(struct zone *zone, + unsigned int order, gfp_t gfp_mask, + enum compact_priority prio, unsigned int alloc_flags, + int classzone_idx, struct page **capture) { enum compact_result ret; struct compact_control cc = { -- 2.21.0