Skip to content

Commit 2271b01

Browse files
liulangrenaaatorvalds
authored andcommitted
mm/compaction: make defer_compaction and compaction_deferred static
defer_compaction() and compaction_deferred() and compaction_restarting() in mm/compaction.c won't be used in other files, so make them static, and remove the declaration in the header file. Take the chance to fix a typo. Link: https://lkml.kernel.org/r/20201123170801.GA9625@rlk Signed-off-by: Hui Su <sh_def@163.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Nitin Gupta <nigupta@nvidia.com> Cc: Baoquan He <bhe@redhat.com> Cc: Mateusz Nosek <mateusznosek0@gmail.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2b1a20c commit 2271b01

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

include/linux/compaction.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,8 @@ extern void reset_isolation_suitable(pg_data_t *pgdat);
9898
extern enum compact_result compaction_suitable(struct zone *zone, int order,
9999
unsigned int alloc_flags, int highest_zoneidx);
100100

101-
extern void defer_compaction(struct zone *zone, int order);
102-
extern bool compaction_deferred(struct zone *zone, int order);
103101
extern void compaction_defer_reset(struct zone *zone, int order,
104102
bool alloc_success);
105-
extern bool compaction_restarting(struct zone *zone, int order);
106103

107104
/* Compaction has made some progress and retrying makes sense */
108105
static inline bool compaction_made_progress(enum compact_result result)
@@ -194,15 +191,6 @@ static inline enum compact_result compaction_suitable(struct zone *zone, int ord
194191
return COMPACT_SKIPPED;
195192
}
196193

197-
static inline void defer_compaction(struct zone *zone, int order)
198-
{
199-
}
200-
201-
static inline bool compaction_deferred(struct zone *zone, int order)
202-
{
203-
return true;
204-
}
205-
206194
static inline bool compaction_made_progress(enum compact_result result)
207195
{
208196
return false;

mm/compaction.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ EXPORT_SYMBOL(__ClearPageMovable);
157157
* allocation success. 1 << compact_defer_shift, compactions are skipped up
158158
* to a limit of 1 << COMPACT_MAX_DEFER_SHIFT
159159
*/
160-
void defer_compaction(struct zone *zone, int order)
160+
static void defer_compaction(struct zone *zone, int order)
161161
{
162162
zone->compact_considered = 0;
163163
zone->compact_defer_shift++;
@@ -172,7 +172,7 @@ void defer_compaction(struct zone *zone, int order)
172172
}
173173

174174
/* Returns true if compaction should be skipped this time */
175-
bool compaction_deferred(struct zone *zone, int order)
175+
static bool compaction_deferred(struct zone *zone, int order)
176176
{
177177
unsigned long defer_limit = 1UL << zone->compact_defer_shift;
178178

@@ -209,7 +209,7 @@ void compaction_defer_reset(struct zone *zone, int order,
209209
}
210210

211211
/* Returns true if restarting compaction after many failures */
212-
bool compaction_restarting(struct zone *zone, int order)
212+
static bool compaction_restarting(struct zone *zone, int order)
213213
{
214214
if (order < zone->compact_order_failed)
215215
return false;
@@ -237,7 +237,7 @@ static void reset_cached_positions(struct zone *zone)
237237
}
238238

239239
/*
240-
* Compound pages of >= pageblock_order should consistenly be skipped until
240+
* Compound pages of >= pageblock_order should consistently be skipped until
241241
* released. It is always pointless to compact pages of such order (if they are
242242
* migratable), and the pageblocks they occupy cannot contain any free pages.
243243
*/

0 commit comments

Comments
 (0)