rue/mm: fix some sparse warnings due to no previous prototype

No previous prototype for some functions, make them right.
Variable pre_used set but not used, so remove it.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409300256.RAybhLQs-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202409300458.ikC3QeVe-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202410051113.ARgT0WJv-lkp@intel.com/
Signed-off-by: Honglin Li <honglinli@tencent.com>
This commit is contained in:
Honglin Li 2024-10-24 18:07:30 +08:00
parent 111bd69b6c
commit 711f0a3fc0
3 changed files with 13 additions and 14 deletions

View File

@ -37,6 +37,8 @@ extern unsigned int sysctl_clean_dying_memcg_threshold;
extern void kclean_dying_memcg_stop(void);
extern void wakeup_kclean_dying_memcg(void);
extern atomic_long_t dying_memcgs_count;
extern void memory_qos_update(void);
extern int memory_qos_prio_reclaim_ratio_update(void);
/* Cgroup-specific page state, on top of universal node page state */
enum memcg_stat_item {

View File

@ -108,8 +108,6 @@ extern int sysctl_vm_use_priority_oom;
extern int sysctl_vm_qos_highest_reclaim_prio;
extern unsigned int sysctl_vm_qos_prio_reclaim_ratio;
extern unsigned int sysctl_clean_dying_memcg_async;
extern void memory_qos_update(void);
extern int memory_qos_prio_reclaim_ratio_update(void);
static int vm_lowest_prio = CGROUP_PRIORITY_MAX;
static int twenty = 20;
#endif
@ -1973,8 +1971,8 @@ int proc_do_static_key(struct ctl_table *table, int write,
}
#ifdef CONFIG_MEMCG
int memory_qos_sysctl_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
static int memory_qos_sysctl_handler(struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
int error;
@ -2000,8 +1998,8 @@ out:
return error;
}
int memory_qos_sysctl_highest_reclaim_prio_handler(struct ctl_table *table,
int write, void __user *buffer,
static int memory_qos_sysctl_highest_reclaim_prio_handler(struct ctl_table *table,
int write, void *buffer,
size_t *lenp, loff_t *ppos)
{
int error;
@ -2016,8 +2014,8 @@ int memory_qos_sysctl_highest_reclaim_prio_handler(struct ctl_table *table,
return 0;
}
int memory_qos_sysctl_prio_reclaim_ratio_handler(struct ctl_table *table,
int write, void __user *buffer,
static int memory_qos_sysctl_prio_reclaim_ratio_handler(struct ctl_table *table,
int write, void *buffer,
size_t *lenp, loff_t *ppos)
{
int error;

View File

@ -3129,7 +3129,7 @@ static int memcg_notify_prio_change(struct mem_cgroup *memcg,
return 0;
}
int mem_cgroup_notify_prio_change(struct cgroup_subsys_state *css,
static int mem_cgroup_notify_prio_change(struct cgroup_subsys_state *css,
u16 old_prio, u16 new_prio)
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
@ -4222,7 +4222,7 @@ vm_pagecache_limit_retry_times __read_mostly = MEMCG_PAGECACHE_RETRIES;
void mem_cgroup_shrink_pagecache(struct mem_cgroup *memcg, gfp_t gfp_mask)
{
long pages_reclaimed;
unsigned long pages_used, pages_max, goal_pages_used, pre_used;
unsigned long pages_used, pages_max, goal_pages_used;
unsigned int retry_times = 0;
unsigned int limit_retry_times;
u32 max_ratio;
@ -4267,7 +4267,6 @@ void mem_cgroup_shrink_pagecache(struct mem_cgroup *memcg, gfp_t gfp_mask)
if (fatal_signal_pending(current))
break;
pre_used = pages_used;
pages_reclaimed = shrink_page_cache_memcg(gfp_mask, memcg,
pages_used - goal_pages_used);
@ -4379,7 +4378,7 @@ static u64 memory_pagecache_max_read(struct cgroup_subsys_state *css,
return memcg->pagecache_max_ratio;
}
unsigned long mem_cgroup_pagecache_get_reclaim_pages(struct mem_cgroup *memcg)
static unsigned long mem_cgroup_pagecache_get_reclaim_pages(struct mem_cgroup *memcg)
{
unsigned long goal_pages_used, pages_used, pages_max;
@ -7241,7 +7240,7 @@ void wakeup_kclean_dying_memcg(void)
wake_up_interruptible(&kclean_dying_memcg_wq);
}
void charge_dying_memcgs(struct mem_cgroup *memcg)
static void charge_dying_memcgs(struct mem_cgroup *memcg)
{
if (sysctl_vm_memory_qos == 0)
return;
@ -10271,7 +10270,7 @@ extern unsigned long shrink_slab(gfp_t gfp_mask, int nid,
struct mem_cgroup *memcg,
int priority);
void reap_slab(struct mem_cgroup *memcg)
static void reap_slab(struct mem_cgroup *memcg)
{
struct mem_cgroup *parent;