It was reported to me that the thread created by the hwlat tracer does
not migrate after the first instance. I found that there was as small bug in the logic, and fixed it. It's minor, but should be fixed regardless. There's not much impact outside the hwlat tracer. -----BEGIN PGP SIGNATURE----- iQExBAABCAAbBQJYkP7tFBxyb3N0ZWR0QGdvb2RtaXMub3JnAAoJEMm5BfJq2Y3L srEH/iqi0mC4rJF57yLmwGXVAuwSRsxHlkGfyG3RBRnXOhiPLaM9Y6QZDWj8f99D DEnVJ7IMpW7tjJB0pDQBCMBi+NX6GvR9Zu4ub8k69UzDlw81CPdMiJ/HfEFsP5XA EOiDH/xGsYmbgGyqbU2VTb4lS8CijStht0jhydriLT1ga/W3bOl0/w6TeQW+AwqJ 0tcksaKwAcH6iN11FUQfWPlirQ/aCTvj8FelgbT7MjYnwxDdbJSfKG+GwJjytLNQ Rj/STWD56OZpl91OuEYA50BZVxp3eF870xJXsLjg3mGIYBseW/T6ZTP8TOM+6WoH u2J08p8Owdtdo+9gkw+IwEuoFP4= =VCLk -----END PGP SIGNATURE----- Merge tag 'trace-4.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fix from Steven Rostedt: "It was reported to me that the thread created by the hwlat tracer does not migrate after the first instance. I found that there was as small bug in the logic, and fixed it. It's minor, but should be fixed regardless. There's not much impact outside the hwlat tracer" * tag 'trace-4.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix hwlat kthread migration
This commit is contained in:
commit
a2ca3d6179
|
@ -266,7 +266,7 @@ static int get_sample(void)
|
||||||
static struct cpumask save_cpumask;
|
static struct cpumask save_cpumask;
|
||||||
static bool disable_migrate;
|
static bool disable_migrate;
|
||||||
|
|
||||||
static void move_to_next_cpu(void)
|
static void move_to_next_cpu(bool initmask)
|
||||||
{
|
{
|
||||||
static struct cpumask *current_mask;
|
static struct cpumask *current_mask;
|
||||||
int next_cpu;
|
int next_cpu;
|
||||||
|
@ -275,7 +275,7 @@ static void move_to_next_cpu(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Just pick the first CPU on first iteration */
|
/* Just pick the first CPU on first iteration */
|
||||||
if (!current_mask) {
|
if (initmask) {
|
||||||
current_mask = &save_cpumask;
|
current_mask = &save_cpumask;
|
||||||
get_online_cpus();
|
get_online_cpus();
|
||||||
cpumask_and(current_mask, cpu_online_mask, tracing_buffer_mask);
|
cpumask_and(current_mask, cpu_online_mask, tracing_buffer_mask);
|
||||||
|
@ -330,10 +330,12 @@ static void move_to_next_cpu(void)
|
||||||
static int kthread_fn(void *data)
|
static int kthread_fn(void *data)
|
||||||
{
|
{
|
||||||
u64 interval;
|
u64 interval;
|
||||||
|
bool initmask = true;
|
||||||
|
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
|
|
||||||
move_to_next_cpu();
|
move_to_next_cpu(initmask);
|
||||||
|
initmask = false;
|
||||||
|
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
get_sample();
|
get_sample();
|
||||||
|
|
Loading…
Reference in New Issue