net: enable timestamp static key if CPU
For systems that use CPU isolation (via nohz_full), creating or destroying a socket with SO_TIMESTAMP, SO_TIMESTAMPNS or SO_TIMESTAMPING with flag SOF_TIMESTAMPING_RX_SOFTWARE will cause a static key to be enabled/disabled. This in turn causes undesired IPIs to isolated CPUs. So enable the static key unconditionally, if CPU isolation is enabled, thus avoiding the IPIs. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/ZgrUiLLtbEUf9SFn@tpad Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
34c58c89fe
commit
2f3c7195a7
@@ -77,6 +77,7 @@
|
||||
#include <linux/hash.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sched/isolation.h>
|
||||
#include <linux/sched/mm.h>
|
||||
#include <linux/smpboot.h>
|
||||
#include <linux/mutex.h>
|
||||
@@ -11911,6 +11912,10 @@ static int __init net_dev_init(void)
|
||||
NULL, dev_cpu_dead);
|
||||
WARN_ON(rc < 0);
|
||||
rc = 0;
|
||||
|
||||
/* avoid static key IPIs to isolated CPUs */
|
||||
if (housekeeping_enabled(HK_TYPE_MISC))
|
||||
net_enable_timestamp();
|
||||
out:
|
||||
if (rc < 0) {
|
||||
for_each_possible_cpu(i) {
|
||||
|
||||
Reference in New Issue
Block a user