Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: add numasched: trace task switch between NUMA #4396

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

Rtoax
Copy link
Contributor

@Rtoax Rtoax commented Dec 15, 2022

Tasks frequently switch between NUMA, often resulting in poor performance.

programs running on the same NUMA will have better performance (usually at the memory level). If processes are migrating between different CPUs and these CPUs belong to different NUMAs, this tool provides an effective means of tracing to optimize the program or configuration.

For example:

Terminal 1:

  $ numactl --hardware
  available: 4 nodes (0-3)
  node 0 cpus: 0 - 23
  node 1 cpus: 24 - 47
  node 2 cpus: 48 - 71
  node 3 cpus: 72 - 95

Terminal 2:

  $ sudo ./numasched.py
  Tracing task NUMA switch...
  TIME     PID      SRC_NID     DST_NID  COMM

Terminal 3:

  $ taskset -c 1 yes >/dev/null &
  $ taskset -p 0x1000000 $(pidof yes)
  $ taskset -p 0x1000000000000 $(pidof yes)

Then, Terminal 2:

  $ sudo ./numasched.py
  Tracing task NUMA switch...
  TIME     PID      SRC_NID     DST_NID  COMM
  20:55:35 355842   0        -> 1        b'yes'
  20:55:50 355842   1        -> 2        b'yes'

tools/numasched.py Outdated Show resolved Hide resolved
tools/numasched.py Show resolved Hide resolved
@Rtoax Rtoax force-pushed the patch-38-tools-numasched branch 2 times, most recently from b0846eb to 8adbbff Compare January 1, 2023 08:21
@Rtoax Rtoax requested review from yonghong-song and removed request for brendangregg, davemarchevsky and goldshtn January 17, 2023 07:50
@Rtoax Rtoax force-pushed the patch-38-tools-numasched branch from 8adbbff to 35843f5 Compare February 10, 2023 14:29
@Rtoax
Copy link
Contributor Author

Rtoax commented Feb 10, 2023

Rebase to master!

@Rtoax Rtoax force-pushed the patch-38-tools-numasched branch from 35843f5 to c564ca7 Compare August 22, 2023 00:48
@Rtoax
Copy link
Contributor Author

Rtoax commented Aug 22, 2023

Rebase to master.

@Rtoax Rtoax force-pushed the patch-38-tools-numasched branch from c564ca7 to d2ce0c8 Compare October 3, 2023 08:04
@Rtoax Rtoax force-pushed the patch-38-tools-numasched branch 3 times, most recently from fd8a130 to 1976374 Compare November 6, 2023 00:56
Tasks frequently switch between NUMA, often resulting in poor performance.

programs running on the same NUMA will have better performance (usually at
the memory level). If processes are migrating between different CPUs and
these CPUs belong to different NUMAs, this tool provides an effective means
of tracing to optimize the program or configuration.

For example:

 Terminal 1:

  $ numactl --hardware
  available: 4 nodes (0-3)
  node 0 cpus: 0 - 23
  node 1 cpus: 24 - 47
  node 2 cpus: 48 - 71
  node 3 cpus: 72 - 95

 Terminal 2:

  $ sudo ./numasched.py
  Tracing task NUMA switch...
  TIME     PID      SRC_NID     DST_NID  COMM

 Terminal 3:

  $ taskset -c 1 yes >/dev/null &
  $ taskset -p 0x1000000 $(pidof yes)
  $ taskset -p 0x1000000000000 $(pidof yes)

 Then, Terminal 2:

  $ sudo ./numasched.py
  Tracing task NUMA switch...
  TIME     PID      TID      SRC_NID     DST_NID  COMM
  20:55:35 355842   355842   0        -> 1        b'yes'
  20:55:50 355842   355842   1        -> 2        b'yes'

Signed-off-by: Rong Tao <[email protected]>
@Rtoax Rtoax force-pushed the patch-38-tools-numasched branch from 1976374 to ebc6e01 Compare January 8, 2025 06:05
@Rtoax
Copy link
Contributor Author

Rtoax commented Jan 8, 2025

Rebase to master.

@yonghong-song
Copy link
Collaborator

LGTM. As a followup, could you add a link for the new tool to the README.md?

@yonghong-song yonghong-song merged commit d188e07 into iovisor:master Jan 9, 2025
7 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants