Skip to content

Conversation

@mogoreanu
Copy link

I think it has been an omission, as opposed to an optimization, in the original change that introduced this. The python version of the funclatency has the delete after the lookup.

Before the change:
./funclatency nvme_setup_cmd
Tracing nvme_setup_cmd. Hit Ctrl-C to exit
^C
nsec : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 243 |********************|
1024 -> 2047 : 43 |
|
2048 -> 4095 : 59 |
|
4096 -> 8191 : 26 |
|

After the change:
./funclatency nvme_setup_cmd
Tracing nvme_setup_cmd. Hit Ctrl-C to exit
^C
nsec : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 4 | |
512 -> 1023 : 624 |******************************|
1024 -> 2047 : 39 |** |
2048 -> 4095 : 98 | |
4096 -> 8191 : 71 |
|
8192 -> 16383 : 1 | |

I think it has been an omission, as opposed to an optimization, in the
original change that introduced this. The python version of the
`funclatency` has the delete after the lookup.

Before the change:
./funclatency nvme_setup_cmd
Tracing nvme_setup_cmd.  Hit Ctrl-C to exit
^C
     nsec                : count    distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 0        |                                        |
         8 -> 15         : 0        |                                        |
        16 -> 31         : 0        |                                        |
        32 -> 63         : 0        |                                        |
        64 -> 127        : 0        |                                        |
       128 -> 255        : 0        |                                        |
       256 -> 511        : 0        |                                        |
       512 -> 1023       : 243      |****************************************|
      1024 -> 2047       : 43       |*******                                 |
      2048 -> 4095       : 59       |*********                               |
      4096 -> 8191       : 26       |****                                    |

After the change:
./funclatency nvme_setup_cmd
Tracing nvme_setup_cmd.  Hit Ctrl-C to exit
^C
     nsec                : count    distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 0        |                                        |
         8 -> 15         : 0        |                                        |
        16 -> 31         : 0        |                                        |
        32 -> 63         : 0        |                                        |
        64 -> 127        : 0        |                                        |
       128 -> 255        : 0        |                                        |
       256 -> 511        : 4        |                                        |
       512 -> 1023       : 624      |****************************************|
      1024 -> 2047       : 39       |**                                      |
      2048 -> 4095       : 98       |******                                  |
      4096 -> 8191       : 71       |****                                    |
      8192 -> 16383      : 1        |                                        |
start = bpf_map_lookup_elem(&starts, &pid);
if (!start)
return;
bpf_map_delete_elem(&starts, &pid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cleanup should be done at the end of this function.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done? PTAL

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please.

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