Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io_tester: implement unlinking via blocks discarding #2141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pwrobelse
Copy link
Contributor

@pwrobelse pwrobelse commented Mar 12, 2024

This change is intended to implement a possibility
to select the implementation of unlink operation
used by unlink_request_type.

A new YAML parameter called 'unlink_type' is now
available to the users. Two following values are supported:
a) ordinary - uses unlink() to remove a file
b) blocks_discarding - opens a file, unlinks it, then
issues trim request for each block
according to RPS parameter. In the
end closes the file.

It will be used to conduct measurements related to
impact of unlinking on read and write operations.

@avikivity
Copy link
Member

Experimentation can be done with fio, it's just playing with configuration files.

This change is intended to implement a possibility
to select the implementation of unlink operation
used by unlink_request_type.

A new YAML parameter called 'unlink_type' is now
available to the users. Two following values are supported:
 a) ordinary - uses unlink() to remove a file
 b) blocks_discarding - opens a file, unlinks it, then
                        issues trim request for each block
                        according to RPS parameter. In the
                        end closes the file.

It will be used to conduct measurements related to
impact of unlinking on read and write operations.

Signed-off-by: Patryk Wrobel <patryk.wrobel@scylladb.com>
@pwrobelse pwrobelse force-pushed the implement_punch_hole_unlinks_in_io_tester branch from a8a774f to 7f33695 Compare June 5, 2024 14:40
Comment on lines +769 to +777
future<size_t> issue_blocks_discarding_unlink() {
return ensure_file_to_discard_open().then([this]() {
return discard_next_block();
}).then([this]() {
return close_file_if_all_blocks_discarded();
}).then([]() {
return make_ready_future<size_t>(0u);
});
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly, the behavior of these lines of code differs from the behavior of fallocate --punch-hole tool.

When the workload is inspected via blktrace, the trim requests are issued only after the flush completes via xfsaild.

I also tested calling unlink() when all blocks are discarded. No difference.

When I added a call to fsync() after each discard is issued, then I saw trim requests issued with certain frequency.

@pwrobelse pwrobelse marked this pull request as ready for review June 6, 2024 13:19
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.

None yet

2 participants