cpuidle: menu: Eliminate outliers on both ends of the sample set
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 6 Feb 2025 14:26:41 +0000 (15:26 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 25 Feb 2025 11:00:35 +0000 (12:00 +0100)
commit8de7606f0fe2bf5a918fe97d425e16e190a24fe6
treeff35f76f5f696f8b57e74f7409f0e3f821299438
parent60256e458e1c29652b2f9e4f2ba71fc7b09bd30c
cpuidle: menu: Eliminate outliers on both ends of the sample set

Currently, get_typical_interval() attempts to eliminate outliers at the
high end of the sample set only (probably in order to bias the prediction
toward lower values), but this it problematic because if the outliers are
present at the low end of the sample set, discarding the highest values
will not help to reduce the variance.

Since the presence of outliers at the low end of the sample set is
generally as likely as their presence at the high end of the sample
set, modify get_typical_interval() to treat samples at the largest
distances from the average (on both ends of the sample set) as outliers.

This should increase the likelihood of making a meaningful prediction
in some cases.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reported-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
Link: https://patch.msgid.link/2301940.iZASKD2KPV@rjwysocki.net
drivers/cpuidle/governors/menu.c