@@ -358,95 +358,6 @@ static inline struct task_group *cgroup_tg(struct cgroup *cgrp)
358358 struct task_group , css );
359359}
360360
361- static inline unsigned long nr_uninterruptible (void )
362- {
363- unsigned long i , sum = 0 ;
364-
365- for_each_possible_cpu (i )
366- sum += cpu_rq (i )-> nr_uninterruptible ;
367-
368- /*
369- * Since we read the counters lockless, it might be slightly
370- * inaccurate. Do not allow it to go below zero though:
371- */
372- if (unlikely ((long )sum < 0 ))
373- sum = 0 ;
374-
375- return sum ;
376- }
377-
378- #ifdef CONFIG_CFS_BANDWIDTH
379- static inline bool tg_cfs_throttled (struct task_group * tg , int cpu )
380- {
381- return tg -> cfs_rq [cpu ]-> throttle_count ;
382- }
383- #else
384- static inline bool tg_cfs_throttled (struct task_group * tg , int cpu )
385- {
386- return false;
387- }
388- #endif
389-
390- #ifdef CONFIG_RT_GROUP_SCHED
391- static inline bool tg_rt_throttled (struct task_group * tg , int cpu )
392- {
393- return tg -> rt_rq [cpu ]-> rt_throttled && !tg -> rt_rq [cpu ]-> rt_nr_boosted ;
394- }
395- #endif
396-
397- static unsigned long ca_running (struct cpuacct * ca , int cpu )
398- {
399- unsigned long nr_running = 0 ;
400- struct cgroup * cgrp = ca -> css .cgroup ;
401- struct task_group * tg ;
402-
403- /* Make sure it is only called for non-root cpuacct */
404- if (ca == & root_cpuacct )
405- return 0 ;
406-
407- rcu_read_lock ();
408- tg = cgroup_tg (cgrp );
409- if (unlikely (!tg ))
410- goto out ;
411-
412- if (!tg_cfs_throttled (tg , cpu ))
413- nr_running += tg -> cfs_rq [cpu ]-> h_nr_running ;
414- #ifdef CONFIG_RT_GROUP_SCHED
415- if (!tg_rt_throttled (tg , cpu ))
416- nr_running += tg -> rt_rq [cpu ]-> rt_nr_running ;
417- #endif
418- /* SCHED_DEADLINE doesn't support cgroup yet */
419-
420- out :
421- rcu_read_unlock ();
422- return nr_running ;
423- }
424-
425- static unsigned long ca_uninterruptible (struct cpuacct * ca , int cpu )
426- {
427- unsigned long nr = 0 ;
428- struct cgroup * cgrp = ca -> css .cgroup ;
429- struct task_group * tg ;
430-
431- /* Make sure it is only called for non-root cpuacct */
432- if (ca == & root_cpuacct )
433- return nr ;
434-
435- rcu_read_lock ();
436- tg = cgroup_tg (cgrp );
437- if (unlikely (!tg ))
438- goto out_rcu_unlock ;
439-
440- nr = tg -> cfs_rq [cpu ]-> nr_uninterruptible ;
441- #ifdef CONFIG_RT_GROUP_SCHED
442- nr += tg -> rt_rq [cpu ]-> nr_uninterruptible ;
443- #endif
444-
445- out_rcu_unlock :
446- rcu_read_unlock ();
447- return nr ;
448- }
449-
450361void cgroup_idle_start (struct sched_entity * se )
451362{
452363 unsigned long flags ;
@@ -625,7 +536,6 @@ static int cpuacct_proc_stats_show(struct seq_file *sf, void *v)
625536 u64 user , nice , system , idle , iowait , irq , softirq , steal , guest ;
626537 u64 nr_migrations = 0 ;
627538 struct cpuacct_alistats * alistats ;
628- unsigned long nr_run = 0 , nr_uninter = 0 ;
629539 int cpu ;
630540
631541 user = nice = system = idle = iowait =
@@ -656,8 +566,6 @@ static int cpuacct_proc_stats_show(struct seq_file *sf, void *v)
656566
657567 alistats = per_cpu_ptr (ca -> alistats , cpu );
658568 nr_migrations += alistats -> nr_migrations ;
659- nr_run += ca_running (ca , cpu );
660- nr_uninter += ca_uninterruptible (ca , cpu );
661569 }
662570 } else {
663571 struct kernel_cpustat * kcpustat ;
@@ -677,9 +585,6 @@ static int cpuacct_proc_stats_show(struct seq_file *sf, void *v)
677585 alistats = per_cpu_ptr (ca -> alistats , cpu );
678586 nr_migrations += alistats -> nr_migrations ;
679587 }
680-
681- nr_run = nr_running ();
682- nr_uninter = nr_uninterruptible ();
683588 }
684589
685590 seq_printf (sf , "user %lld\n" , nsec_to_clock_t (user ));
@@ -692,10 +597,6 @@ static int cpuacct_proc_stats_show(struct seq_file *sf, void *v)
692597 seq_printf (sf , "steal %lld\n" , nsec_to_clock_t (steal ));
693598 seq_printf (sf , "guest %lld\n" , nsec_to_clock_t (guest ));
694599
695- seq_printf (sf , "nr_running %lld\n" , (u64 )nr_run );
696- if ((long ) nr_uninter < 0 )
697- nr_uninter = 0 ;
698- seq_printf (sf , "nr_uninterruptible %lld\n" , (u64 )nr_uninter );
699600 seq_printf (sf , "nr_migrations %lld\n" , (u64 )nr_migrations );
700601
701602 return 0 ;
0 commit comments