Skip to content

multiload: add -f to fill the arenas from a file - #65

Open
jalanmiddleton wants to merge 1 commit into
google:masterfrom
jalanmiddleton:multiload-init-from
Open

jalanmiddleton wants to merge 1 commit into
google:masterfrom
jalanmiddleton:multiload-init-from

Conversation

@jalanmiddleton

Copy link
Copy Markdown

Multiload currently fills its arenas with constant patterns. For memory devices which handle different types of data differently (e.g. compression), this only offers one possible test case. Add -f FILE, which fills every arena with the contents of a regular file, so the arena contents can be set arbitrarily.

This change is different from multichase's -f, where alloc_arena_mmap() uses a passed-in file as the arena itself. This code does not use the file itself as the arena, but copies the contents to separate buffers. Without -f, behavior is maintained.

This is the first of three related multiload changes for configurable memory bandwidth patterns:

  1. This PR, for custom backing data.
  2. A configurable-access load mode with arbitrary read:write ratios.
  3. Access pattern controls (locality, strides between accesses in bandwidth load generation) in the configurable-access mode.

The plan is to add the other two features in separate PRs, but this could be handled with multiple commits as well.

Multiload always fills its arenas with a constant pattern (memset 1
for loads, zeros for the chase). For memory devices which handle
different types of data differently (e.g. compression), this only
offers one possible test case. Add -f FILE, which fills every arena
with the contents of a regular file, so the arena contents can be
set arbitrarily.

fill_arena_from_file() reads the file into the start of the arena with
pread(), and then tiles the rest by doubling the filled prefix with
memcpy(). Load threads fill their own arenas in place of the existing
memset; the chase arena is filled before the chase is generated.
This is different from multichase's -f, where alloc_arena_mmap() uses a
passed-in file as the arena itself.

-f is rejected together with -L, because the longer chase expects every
slot to start NULL. Directories, devices, empty files, and a second -f
are also rejected.
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.

1 participant