Skip to main content

DAMON user-space tool

Project description

DAMO: Data Access Monitoring Operator

damo is a user space tool for DAMON. Using this, you can monitor the data access patterns of your system or workloads and make data access-aware memory management optimizations.

Demo Video

Please click the below thumbnail to show the short demo video.

DAMON: a demo for the Kernel Summit 2020

Getting Started

Packaging status

Follow below instructions and commands to monitor and visualize the access pattern of your workload.

$ # ensure your kernel is built with CONFIG_DAMON_*=y
$ # install from PyPI, or use your distribution's package manager
$ sudo pip3 install damo
$ sudo damo record $(pidof <your workload>)
$ damo report heats --heatmap stdout --stdout_heatmap_color emotion

The last command will show the access pattern of your workload, like below:

masim zigzag heatmap in ascii masim stairs heatmap in ascii

FAQs

How can I install a kernel that is built with CONFIG_DAMON_*=y?

Please refer to 'Install' section of the project webpage.

Where can I get more detailed usage?

The below sections provide quick introductions for damo's major features. For more detailed usage, please refer to USAGE.md file.

What does the version number mean?

Nothing at all but indicate which version is more fresh. A higher version number means it is more recently released.

Will pip3 install damo install the latest version of damo?

It will install the latest stable version of damo. If you want, you can also install less stable but more fresh damo from source code. For that, fetch the next branch of the source tree and use damo executable file in the tree.

$ git clone https://github.com/awslabs/damo -b next

How can I participate in the development of damo?

Please refer to CONTRIBUTING file.

Why some subcommands are not documented on USAGE.md file?

Only sufficiently stabilized features are documented there. In other words, any feature that not documented on USAGE.md are in experimental stage. Such experimental features could be deprecated and removed without any notice and grace periods. The documented features could also be deprecated, but those will provide some notification and grace periods.

Snapshot Data Access Pattern

Below commands repeatedly get a snapshot of the access pattern of a program for every second.

$ git clone https://github.com/sjp38/masim
$ cd masim; make; ./masim ./configs/zigzag.cfg --silent &
$ sudo damo start --target_pid $(pidof masim)
$ while :; do sudo damo show; sleep 1; done

The first two lines of the commands get an artificial memory access generator program and run it in the background. It will repeatedly access two 100 MiB-sized memory regions one by one. You can substitute this with your real workload.

The third line asks damo to start monitoring the access pattern of the process. Finally, the last line retries a snapshot of the monitoring results every second and show on terminal.

Recording Data Access Patterns

Below commands record memory access patterns of a program and save the monitoring results in damon.data file.

$ git clone https://github.com/sjp38/masim
$ cd masim; make; ./masim ./configs/zigzag.cfg --silent &
$ sudo damo record -o damon.data $(pidof masim)

The first two lines of the commands get an artificial memory access generator program and run it in the background. It will repeatedly access two 100 MiB-sized memory regions one by one. You can substitute this with your real workload. The last line asks damo to record the access pattern in damon.data file.

Visualizing Recorded Patterns

Below three commands visualize the recorded access patterns into three image files.

$ damo report heats --heatmap stdout
$ damo report wss --range 0 101 1
$ damo report wss --range 0 101 1 --sortby time --plot
  • access_pattern_heatmap.png will show the data access pattern in a heatmap, which shows when (x-axis) what memory region (y-axis) is how frequently accessed (color).
  • wss_dist.png will show the distribution of the working set size.
  • wss_chron_change.png will show how the working set size has chronologically changed.

You can show the images on a web page [1]. Those made with other realistic workloads are also available [2,3,4].

[1] https://damonitor.github.io/doc/html/latest/admin-guide/mm/damon/start.html#visualizing-recorded-patterns
[2] https://damonitor.github.io/test/result/visual/latest/rec.heatmap.1.png.html
[3] https://damonitor.github.io/test/result/visual/latest/rec.wss_sz.png.html
[4] https://damonitor.github.io/test/result/visual/latest/rec.wss_time.png.html

Data Access Pattern Aware Memory Management

Below command makes every memory region of size >=4K that hasn't accessed for

=60 seconds in your workload to be swapped out. By doing this, you can make your workload more memory efficient with only modest performance overhead.

$ sudo damo start --damos_access_rate 0 0 --damos_sz_region 4K max \
                    --damos_age 60s max --damos_action pageout \
                    <pid of your workload>

Deprecated, or Will be Deprecated Features

Below are features that recently deprecated, or will be deprecated. If you depend on any of those, please report your usecase to the community via github issue, sj@kernel.org, damon@lists.linux.dev, and/or linux-mm@kvack.org.

DAMON record binary format

Will be deprecated by 2023 Q3.

At the beginning, DAMO used its special binary format, namely record. It is designed for lightweight saving of the monitoring results. It is difficult to read, and not that efficient compared to fancy compression techniques. json based monitoring results can be easier to read, and more efficient when compression technique is used. Hence, the format will be deprecated. You may use damo convert_record_format to convert your old record binary format monitoring results files to the new format.

Python2 support

Deprecated. Use Python3.

For some old distros, DAMO initially supported Python2. Because Python2 is really old now, the support has deprecated. Please use Python3 or newer.

DAMOS single line format

Deprecated. Use --damos_* command line options or json format input.

A simple DAMOS scheme specification format called one-line scheme specification was initially supported. Because it is not flexible for extension of features, it has deprecated now. You may use --damos_* command line options or json format instead. You may use damo translate_damos to convert your old single line DAMOS schemes specification to the new json format.

--rbuf option of damo record

Deprecated.

Early versions of DAMON supported in-kernel direct monitoring results record file generation. To control the overhead of it, DAMO allowed user to specify the size of buffer for the work. The feature has not merged into the mainline, and discarded. Hence the option was available for only few kernels that ported the feature. For most of kernels, tracepoint based record file generation is being used, and the overhead of the approach is subtle. Hence, the option has deprecated.

Project details


Release history Release notifications | RSS feed

This version

2.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

damo-2.0.1.tar.gz (61.5 kB view details)

Uploaded Source

Built Distribution

damo-2.0.1-py3-none-any.whl (73.7 kB view details)

Uploaded Python 3

File details

Details for the file damo-2.0.1.tar.gz.

File metadata

  • Download URL: damo-2.0.1.tar.gz
  • Upload date:
  • Size: 61.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for damo-2.0.1.tar.gz
Algorithm Hash digest
SHA256 366f03c43d3febc0eb86296d702dd6d396fb8063749605fdce739da9f7ae0383
MD5 f5a0a72220d4dd274766177c69fd3a8b
BLAKE2b-256 bee6aea8251c65be020b8d5e72df9aef6f103d90ebc571e383dc09e6344ab53e

See more details on using hashes here.

File details

Details for the file damo-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: damo-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 73.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for damo-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b00b500a5e24a978704a3411bf80e2ad7a6c1a11be6cf5e5fd905f352e0639d
MD5 a5fdbf5e97dd8d08de4a2eea8d67af61
BLAKE2b-256 122b9b4e9be229f2a4328893e4a39b831afa17bbf57fb82971d29b677f0ee8a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page