Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 556f086b authored by Joonwoo Park's avatar Joonwoo Park
Browse files

Revert "sched: warn/panic upon excessive scheduling latency"



This reverts commit ab9e1373 ("sched: warn/panic upon excessive
scheduling latency") as this feature is no longer used.

Change-Id: Ibf7d8340b87f6772a42e6edb22f9f3cd73e05512
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent ef07180f
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -147,15 +147,6 @@ this file correlating for that process to:
     2) time spent waiting on a runqueue
     3) # of timeslices run on this cpu

/proc/sys/kernel/{sched_latency_warn_threshold_us,sched_latency_panic_threshold_us}
----------------
schedstats provides procfs nodes /proc/sys/kernel/sched_latency_warn_threshold_us
and /proc/sys/kernel/sched_latency_panic_threshold_us.  These can be configured
to detect unreasonably high scheduling latency.
Set sched_latency_warn_threshold_us or sched_latency_panic_threshold_us with
non-zero threshold to warn or panic system when scheduling latency higher than
configured threshold is detected.  Default is 0 (disabled) for both.

A program could be easily written to make use of these extra fields to
report on how well a particular process or set of processes is faring
under the scheduler's policies.  A simple version of such a program is
+1 −1
Original line number Diff line number Diff line
@@ -159,9 +159,9 @@ extern unsigned int sysctl_sched_autogroup_enabled;
#endif

#ifdef CONFIG_SCHEDSTATS
#ifdef CONFIG_SCHED_QHMP
extern unsigned int sysctl_sched_latency_panic_threshold;
extern unsigned int sysctl_sched_latency_warn_threshold;
#ifdef CONFIG_SCHED_QHMP
extern int sched_max_latency_sysctl(struct ctl_table *table, int write,
				    void __user *buffer, size_t *lenp,
				    loff_t *ppos);
+2 −38
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#include <linux/mempolicy.h>
#include <linux/migrate.h>
#include <linux/task_work.h>
#include <linux/ratelimit.h>

#include "sched.h"
#include <trace/events/sched.h>
@@ -122,11 +121,6 @@ unsigned int __read_mostly sysctl_sched_shares_window = 10000000UL;
unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL;
#endif

#ifdef CONFIG_SCHEDSTATS
unsigned int sysctl_sched_latency_panic_threshold;
unsigned int sysctl_sched_latency_warn_threshold;
#endif /* CONFIG_SCHEDSTATS */

static inline void update_load_add(struct load_weight *lw, unsigned long inc)
{
	lw->weight += inc;
@@ -772,31 +766,6 @@ static void update_stats_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se,
		update_stats_wait_start(cfs_rq, se, migrating);
}

#ifdef CONFIG_SCHEDSTATS
static inline void check_for_high_latency(struct task_struct *p, u64 latency_us)
{
	int do_warn, do_panic;
	const char *fmt = "excessive latency comm=%s pid=%d latency=%llu(us)\n";
	static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL,
				      DEFAULT_RATELIMIT_BURST);

	do_warn = (sysctl_sched_latency_warn_threshold &&
		   latency_us > sysctl_sched_latency_warn_threshold);
	do_panic = (sysctl_sched_latency_panic_threshold &&
		    latency_us > sysctl_sched_latency_panic_threshold);
	if (unlikely(do_panic || (do_warn && __ratelimit(&rs)))) {
		if (do_panic)
			panic(fmt, p->comm, p->pid, latency_us);
		else
			printk_deferred(fmt, p->comm, p->pid, latency_us);
	}
}
#else
static inline void check_for_high_latency(struct task_struct *p, u64 latency)
{
}
#endif

static void
update_stats_wait_end(struct cfs_rq *cfs_rq, struct sched_entity *se,
		      bool migrating)
@@ -815,13 +784,8 @@ update_stats_wait_end(struct cfs_rq *cfs_rq, struct sched_entity *se,
			rq_clock(rq_of(cfs_rq)) - se->statistics.wait_start);
#ifdef CONFIG_SCHEDSTATS
	if (entity_is_task(se)) {
		u64 delta;

		delta = rq_clock(rq_of(cfs_rq)) - se->statistics.wait_start;
		trace_sched_stat_wait(task_of(se), delta);

		delta = delta >> 10;
		check_for_high_latency(task_of(se), delta);
		trace_sched_stat_wait(task_of(se),
			rq_clock(rq_of(cfs_rq)) - se->statistics.wait_start);
	}
#endif
	schedstat_set(se->statistics.wait_start, 0);
+1 −1
Original line number Diff line number Diff line
@@ -689,6 +689,7 @@ static struct ctl_table kern_table[] = {
	},
#endif
#ifdef CONFIG_SCHEDSTATS
#ifdef CONFIG_SCHED_QHMP
	{
		.procname	= "sched_latency_panic_threshold_us",
		.data		= &sysctl_sched_latency_panic_threshold,
@@ -703,7 +704,6 @@ static struct ctl_table kern_table[] = {
		.mode		= 0644,
		.proc_handler	= proc_dointvec_minmax,
	},
#ifdef CONFIG_SCHED_QHMP
	{
		.procname	= "sched_max_latency_us",
		.mode		= 0644,