Skip to content

[WIP] Restructure#84

Open
NicolasT wants to merge 29 commits into
masterfrom
restructure
Open

[WIP] Restructure#84
NicolasT wants to merge 29 commits into
masterfrom
restructure

Conversation

@NicolasT

Copy link
Copy Markdown
Contributor

No description provided.

This allows to set larger maximum sector transfers from userspace, which
increases bandwidth in sequential write workloads.

This change doesn't have any effect unless some block configuration
changes are made (from userspace) as well. Assuming an SRB device,
`srb1` was created (using `attach`), first validate its
`max_hw_sectors_kb` value:

```
$ cat /sys/class/block/srb1/queue/max_hw_sectors_kb
32768
```

Next, the `max_sectors_kb` value can be configured. This sets the
maximal transfer size for a single call to the CDMI server. The kernel
sets this to 512 (1024 sectors) by default.

Making this value larger can have a positive impact on performance in
some workloads (sequential writes mostly, or writes of large blocks),
but also has a negative impact at the kernel side (more allocator
pressure etc.). Tune it according to your workload (use `blktrace` or
`btrace` to find out write sizes while running your workload).

We can e.g. set this to 8MB using

```
$ echo $(( 8 * 1024 )) > /sys/class/block/srb1/queue/max_sectors_kb
$ cat /sys/class/block/srb1/queue/max_sectors_kb
8192
```

After formatting the device, you can quickly validate the performance
impact using e.g.

```
$ dd if=/dev/zero of=/mnt/srb1/zeros bs=8M count=$(( 1024 / 8 )) conv=fsync
```

When checking `btrace`, you should see commits of (1024 * 1024 * 8 /
512) sectors (or other relatively large values):

```
251,0   15       70   570.000979569  6491  C  WS 1795072 + 16384 (14691129571) [0]
251,0    8      135   570.413638516  6492  C  WS 1811456 + 16384 (15103788266) [0]
251,0    7      399   570.725110955  6496  C   W 1916928 + 8192 (2249808356) [0]
251,0    3     1478   570.946574847  6493  C  WS 1925120 + 8192 (2470209854) [0]
251,0    5     1072   571.397512583  6490  C   W 1867776 + 16384 (10230081008) [0]
251,0    8      136   571.615532644  6492  C   W 1948672 + 9216 (3136311330) [0]
251,0    4      250   571.892105568  6494  C  WS 1851392 + 16384 (10725763791) [0]
251,0   14     1000   572.277086118  6497  C   W 1884160 + 16384 (3804676232) [0]
```

You're looking for lines with 'C'ommit lines for 'W'rites or synchronous
'WS'rites. These lines also provide the sector of the request and the
request size (in sectors, 512B units) divided by a '+'. See `man
blkparse`.
Also, keep private headers private.
Thanks to f34d45b we no longer need `jsmn` at all.
That code clearly needs some cleanup.
When removing functionality from a kernel driver and claiming it should
be implemented in userspace, it really should be.
Some might be required though when `srb.h` is gone.
@NicolasT

Copy link
Copy Markdown
Contributor Author

Work-in-progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant