Skip to content

Commit

Permalink
proc: fix the display error of the processes field in /proc/stat
Browse files Browse the repository at this point in the history
Signed-off-by: zhiguang peng <zgpeng@tencent.com>
  • Loading branch information
zgpeng committed Nov 12, 2020
1 parent 94dd9dd commit 8cbbd36
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fs/proc/bt_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int show_bt_stat(struct seq_file *p, void *v)
seq_printf(p,
"\nctxt %llu\n"
"btime %lu\n"
"processes %d\n"
"processes %lu\n"
"procs_running %lu\n"
"procs_blocked %lu\n",
nr_context_switches(),
Expand Down
2 changes: 1 addition & 1 deletion fs/proc/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static int show_stat(struct seq_file *p, void *v)
seq_printf(p,
"\nctxt %llu\n"
"btime %llu\n"
"processes %d\n"
"processes %lu\n"
"procs_running %lu\n"
"procs_blocked %lu\n",
nr_context_switches(),
Expand Down
2 changes: 1 addition & 1 deletion include/linux/sched/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
DECLARE_PER_CPU(unsigned long, total_forks);
extern int nr_threads;
DECLARE_PER_CPU(unsigned long, process_counts);
extern int nr_forks(void);
extern unsigned long nr_forks(void);
extern int nr_processes(void);
extern unsigned long nr_running(void);
extern unsigned long nr_running_cpu(int cpu);
Expand Down
4 changes: 2 additions & 2 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ int lockdep_tasklist_lock_is_held(void)
EXPORT_SYMBOL_GPL(lockdep_tasklist_lock_is_held);
#endif /* #ifdef CONFIG_PROVE_RCU */

int nr_forks(void)
unsigned long nr_forks(void)
{
int cpu;
int total = 0;
unsigned long total = 0;

for_each_possible_cpu(cpu)
total += per_cpu(total_forks, cpu);
Expand Down

0 comments on commit 8cbbd36

Please sign in to comment.