Skip to content

Commit

Permalink
mm: compaction: remove unneeded return value of kcompactd_run
Browse files Browse the repository at this point in the history
Patch series "A few cleanup and fixup patches for compaction".

This series contains a few patches to clean up some obsolete comment,
remove unneeded return value and so on.  Also we fix the possible NULL
pointer dereference.  More details can be found in the respective
changelogs.


This patch (of 12):

The return value of kcompactd_run() is unused now.  Clean it up.

Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Miaohe Lin <[email protected]>
Cc; Mel Gorman <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Pintu Kumar <[email protected]>
Cc: Charan Teja Kalla <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
MiaoheLin authored and akpm00 committed Apr 29, 2022
1 parent 94bfe85 commit 024c61e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions include/linux/compaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static inline bool compaction_withdrawn(enum compact_result result)
bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
int alloc_flags);

extern int kcompactd_run(int nid);
extern void kcompactd_run(int nid);
extern void kcompactd_stop(int nid);
extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx);

Expand Down Expand Up @@ -212,9 +212,8 @@ static inline bool compaction_withdrawn(enum compact_result result)
return true;
}

static inline int kcompactd_run(int nid)
static inline void kcompactd_run(int nid)
{
return 0;
}
static inline void kcompactd_stop(int nid)
{
Expand Down
7 changes: 2 additions & 5 deletions mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -3016,21 +3016,18 @@ static int kcompactd(void *p)
* This kcompactd start function will be called by init and node-hot-add.
* On node-hot-add, kcompactd will moved to proper cpus if cpus are hot-added.
*/
int kcompactd_run(int nid)
void kcompactd_run(int nid)
{
pg_data_t *pgdat = NODE_DATA(nid);
int ret = 0;

if (pgdat->kcompactd)
return 0;
return;

pgdat->kcompactd = kthread_run(kcompactd, pgdat, "kcompactd%d", nid);
if (IS_ERR(pgdat->kcompactd)) {
pr_err("Failed to start kcompactd on node %d\n", nid);
ret = PTR_ERR(pgdat->kcompactd);
pgdat->kcompactd = NULL;
}
return ret;
}

/*
Expand Down

0 comments on commit 024c61e

Please sign in to comment.