From: Pengfei Li <lpf.vector@gmail.com>
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 <lpf.vector@gmail.com>
Subject: [PATCH 08/10] mm/compaction: use unsigned int for "compact_order_failed" in struct zone
Date: Fri, 26 Jul 2019 02:42:51 +0800 [thread overview]
Message-ID: <20190725184253.21160-9-lpf.vector@gmail.com> (raw)
In-Reply-To: <20190725184253.21160-1-lpf.vector@gmail.com>
Because "compact_order_failed" will never be negative, so just
make it unsigned int. And modify three related trace functions
accordingly.
Signed-off-by: Pengfei Li <lpf.vector@gmail.com>
---
include/linux/compaction.h | 12 ++++++------
include/linux/mmzone.h | 2 +-
include/trace/events/compaction.h | 14 +++++++-------
mm/compaction.c | 8 ++++----
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 0201dfa57d44..a8049d582265 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -99,11 +99,11 @@ extern void reset_isolation_suitable(pg_data_t *pgdat);
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);
-extern void compaction_defer_reset(struct zone *zone, int order,
+extern void defer_compaction(struct zone *zone, unsigned int order);
+extern bool compaction_deferred(struct zone *zone, unsigned int order);
+extern void compaction_defer_reset(struct zone *zone, unsigned int order,
bool alloc_success);
-extern bool compaction_restarting(struct zone *zone, int order);
+extern bool compaction_restarting(struct zone *zone, unsigned int order);
/* Compaction has made some progress and retrying makes sense */
static inline bool compaction_made_progress(enum compact_result result)
@@ -188,11 +188,11 @@ static inline enum compact_result compaction_suitable(struct zone *zone,
return COMPACT_SKIPPED;
}
-static inline void defer_compaction(struct zone *zone, int order)
+static inline void defer_compaction(struct zone *zone, unsigned int order)
{
}
-static inline bool compaction_deferred(struct zone *zone, int order)
+static inline bool compaction_deferred(struct zone *zone, unsigned int order)
{
return true;
}
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index d77d717c620c..0947e7cb4214 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -545,7 +545,7 @@ struct zone {
*/
unsigned int compact_considered;
unsigned int compact_defer_shift;
- int compact_order_failed;
+ unsigned int compact_order_failed;
#endif
#if defined CONFIG_COMPACTION || defined CONFIG_CMA
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
index 1e1e74f6d128..f83ba40f9614 100644
--- a/include/trace/events/compaction.h
+++ b/include/trace/events/compaction.h
@@ -243,17 +243,17 @@ DEFINE_EVENT(mm_compaction_suitable_template, mm_compaction_suitable,
DECLARE_EVENT_CLASS(mm_compaction_defer_template,
- TP_PROTO(struct zone *zone, int order),
+ TP_PROTO(struct zone *zone, unsigned int order),
TP_ARGS(zone, order),
TP_STRUCT__entry(
__field(int, nid)
__field(enum zone_type, idx)
- __field(int, order)
+ __field(unsigned int, order)
__field(unsigned int, considered)
__field(unsigned int, defer_shift)
- __field(int, order_failed)
+ __field(unsigned int, order_failed)
),
TP_fast_assign(
@@ -265,7 +265,7 @@ DECLARE_EVENT_CLASS(mm_compaction_defer_template,
__entry->order_failed = zone->compact_order_failed;
),
- TP_printk("node=%d zone=%-8s order=%d order_failed=%d consider=%u limit=%lu",
+ TP_printk("node=%d zone=%-8s order=%u order_failed=%u consider=%u limit=%lu",
__entry->nid,
__print_symbolic(__entry->idx, ZONE_TYPE),
__entry->order,
@@ -276,21 +276,21 @@ DECLARE_EVENT_CLASS(mm_compaction_defer_template,
DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_deferred,
- TP_PROTO(struct zone *zone, int order),
+ TP_PROTO(struct zone *zone, unsigned int order),
TP_ARGS(zone, order)
);
DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_defer_compaction,
- TP_PROTO(struct zone *zone, int order),
+ TP_PROTO(struct zone *zone, unsigned int order),
TP_ARGS(zone, order)
);
DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_defer_reset,
- TP_PROTO(struct zone *zone, int order),
+ TP_PROTO(struct zone *zone, unsigned int order),
TP_ARGS(zone, order)
);
diff --git a/mm/compaction.c b/mm/compaction.c
index ac5df82d46e0..aad638ad2cc6 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -139,7 +139,7 @@ EXPORT_SYMBOL(__ClearPageMovable);
* allocation success. 1 << compact_defer_limit compactions are skipped up
* to a limit of 1 << COMPACT_MAX_DEFER_SHIFT
*/
-void defer_compaction(struct zone *zone, int order)
+void defer_compaction(struct zone *zone, unsigned int order)
{
zone->compact_considered = 0;
zone->compact_defer_shift++;
@@ -154,7 +154,7 @@ void defer_compaction(struct zone *zone, int order)
}
/* Returns true if compaction should be skipped this time */
-bool compaction_deferred(struct zone *zone, int order)
+bool compaction_deferred(struct zone *zone, unsigned int order)
{
unsigned long defer_limit = 1UL << zone->compact_defer_shift;
@@ -178,7 +178,7 @@ bool compaction_deferred(struct zone *zone, int order)
* which means an allocation either succeeded (alloc_success == true) or is
* expected to succeed.
*/
-void compaction_defer_reset(struct zone *zone, int order,
+void compaction_defer_reset(struct zone *zone, unsigned int order,
bool alloc_success)
{
if (alloc_success) {
@@ -192,7 +192,7 @@ void compaction_defer_reset(struct zone *zone, int order,
}
/* Returns true if restarting compaction after many failures */
-bool compaction_restarting(struct zone *zone, int order)
+bool compaction_restarting(struct zone *zone, unsigned int order)
{
if (order < zone->compact_order_failed)
return false;
--
2.21.0
next prev parent reply other threads:[~2019-07-25 18:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 18:42 [PATCH 00/10] make "order" unsigned int Pengfei Li
2019-07-25 18:42 ` [PATCH 01/10] mm/page_alloc: use unsigned int for "order" in should_compact_retry() Pengfei Li
2019-07-25 18:58 ` Matthew Wilcox
2019-07-25 23:21 ` Pengfei Li
2019-07-25 18:42 ` [PATCH 02/10] mm/page_alloc: use unsigned int for "order" in __rmqueue_fallback() Pengfei Li
2019-07-26 9:36 ` Rasmus Villemoes
2019-07-27 2:34 ` Pengfei Li
2019-07-25 18:42 ` [PATCH 03/10] mm/page_alloc: use unsigned int for "order" in should_compact_retry() Pengfei Li
2019-07-25 18:42 ` [PATCH 04/10] mm/page_alloc: remove never used "order" in alloc_contig_range() Pengfei Li
2019-07-25 18:42 ` [PATCH 05/10] mm/compaction: make "order" and "search_order" unsigned int in struct compact_control Pengfei Li
2019-07-25 18:42 ` [PATCH 06/10] mm/compaction: make "order" unsigned int in compaction.c Pengfei Li
2019-07-25 18:42 ` [PATCH 07/10] trace/events/compaction: make "order" unsigned int Pengfei Li
2019-07-25 18:42 ` Pengfei Li [this message]
2019-07-25 18:42 ` [PATCH 09/10] mm/compaction: use unsigned int for "kcompactd_max_order" in struct pglist_data Pengfei Li
2019-07-25 18:42 ` [PATCH 10/10] mm/vmscan: use unsigned int for "kswapd_order" " Pengfei Li
2019-07-25 18:52 ` [PATCH 00/10] make "order" unsigned int Qian Cai
2019-07-25 23:48 ` Pengfei Li
2019-07-26 7:12 ` Michal Hocko
2019-07-27 17:25 ` Pengfei Li
2019-07-26 7:26 ` Mel Gorman
2019-07-27 16:44 ` Pengfei Li
2019-07-29 8:34 ` Mel Gorman
2019-07-30 5:53 ` Pengfei Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190725184253.21160-9-lpf.vector@gmail.com \
--to=lpf.vector@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=cai@lca.pw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=osalvador@suse.de \
--cc=pavel.tatashin@microsoft.com \
--cc=rostedt@goodmis.org \
--cc=rppt@linux.ibm.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.