mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
ipvs: Fix estimator kthreads preferred affinity
[ Upstream commitc0a23bbc98] The estimator kthreads' affinity are defined by sysctl overwritten preferences and applied through a plain call to the scheduler's affinity API. However since the introduction of managed kthreads preferred affinity, such a practice shortcuts the kthreads core code which eventually overwrites the target to the default unbound affinity. Fix this with using the appropriate kthread's API. Fixes:d1a8919758("kthread: Default affine kthread to its preferred NUMA node") Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
db3658a12d
commit
280beb08ba
@@ -1163,6 +1163,14 @@ static inline const struct cpumask *sysctl_est_cpulist(struct netns_ipvs *ipvs)
|
|||||||
return housekeeping_cpumask(HK_TYPE_KTHREAD);
|
return housekeeping_cpumask(HK_TYPE_KTHREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline const struct cpumask *sysctl_est_preferred_cpulist(struct netns_ipvs *ipvs)
|
||||||
|
{
|
||||||
|
if (ipvs->est_cpulist_valid)
|
||||||
|
return ipvs->sysctl_est_cpulist;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int sysctl_est_nice(struct netns_ipvs *ipvs)
|
static inline int sysctl_est_nice(struct netns_ipvs *ipvs)
|
||||||
{
|
{
|
||||||
return ipvs->sysctl_est_nice;
|
return ipvs->sysctl_est_nice;
|
||||||
@@ -1270,6 +1278,11 @@ static inline const struct cpumask *sysctl_est_cpulist(struct netns_ipvs *ipvs)
|
|||||||
return housekeeping_cpumask(HK_TYPE_KTHREAD);
|
return housekeeping_cpumask(HK_TYPE_KTHREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline const struct cpumask *sysctl_est_preferred_cpulist(struct netns_ipvs *ipvs)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int sysctl_est_nice(struct netns_ipvs *ipvs)
|
static inline int sysctl_est_nice(struct netns_ipvs *ipvs)
|
||||||
{
|
{
|
||||||
return IPVS_EST_NICE;
|
return IPVS_EST_NICE;
|
||||||
|
|||||||
@@ -894,6 +894,7 @@ out:
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(kthread_affine_preferred);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Re-affine kthreads according to their preferences
|
* Re-affine kthreads according to their preferences
|
||||||
|
|||||||
@@ -265,7 +265,8 @@ int ip_vs_est_kthread_start(struct netns_ipvs *ipvs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_user_nice(kd->task, sysctl_est_nice(ipvs));
|
set_user_nice(kd->task, sysctl_est_nice(ipvs));
|
||||||
set_cpus_allowed_ptr(kd->task, sysctl_est_cpulist(ipvs));
|
if (sysctl_est_preferred_cpulist(ipvs))
|
||||||
|
kthread_affine_preferred(kd->task, sysctl_est_preferred_cpulist(ipvs));
|
||||||
|
|
||||||
pr_info("starting estimator thread %d...\n", kd->id);
|
pr_info("starting estimator thread %d...\n", kd->id);
|
||||||
wake_up_process(kd->task);
|
wake_up_process(kd->task);
|
||||||
|
|||||||
Reference in New Issue
Block a user