Skip to content

Commit

Permalink
docs: document settings worker affinity in README
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Dec 17, 2023
1 parent 3a65898 commit 7b3b504
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ A fast high compression read-only file system for Linux and Windows.
- [With EROFS](#with-erofs)
- [With fuse-archive](#with-fuse-archive)
- [Performance Monitoring](#performance-monitoring)
- [Other Obscure Features](#other-obscure-features)

## Overview

Expand Down Expand Up @@ -2037,3 +2038,30 @@ system calls.

The FUSE driver also exposes the performance monitor metrics via
an [extended attribute](#extended-attributes).


## Other Obscure Features

### Setting Worker Thread CPU Affinity

This only works on Linux and usually only makes sense if you have CPUs
with different types of cores (e.g. "performance" vs "efficiency" cores)
and are *really* trying to squeeze the last ounce of speed out of DwarFS.

By setting the environment variable `DWARFS_WORKER_GROUP_AFFINITY`, you
can set the CPU affinity of different worker thread groups, e.g.:

```
export DWARFS_WORKER_GROUP_AFFINITY=blockify=3:compress=6,7
```

This will set the affinity of the `blockify` worker group to CPU 3 and
the affinity of the `compress` worker group to CPUs 6 and 7.

You can use this feature for all tools that use one or more worker thread
groups. For example, the FUSE driver `dwarfs` and `dwarfsextract` use a
worker group `blkcache` that the block cache (i.e. block decompression and
lookup) runs on. `mkdwarfs` uses a whole array of different worker groups,
namely `compress` for compression, `scanner` for scanning, `ordering` for
input ordering, and `blockify` for segmenting. `blockify` is what you would
typically want to run on your "performance" cores.

0 comments on commit 7b3b504

Please sign in to comment.