Skip to content

Commit 1f9e691

Browse files
authored
Merge pull request ceph#62165 from athanatos/sjust/wip-recovery-ops-leak-61594-with-history
osd: fix osd mclock queue item leak Reviewed-by: Sridhar Seshasayee <[email protected]> Reviewed-by: Radoslaw Zarzynski <[email protected]>
2 parents ba4ca37 + 35cf0f6 commit 1f9e691

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+11271
-44
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
[submodule "src/blkin"]
3939
path = src/blkin
4040
url = https://github.com/ceph/blkin
41-
[submodule "src/dmclock"]
42-
path = src/dmclock
43-
url = https://github.com/ceph/dmclock.git
4441
[submodule "src/seastar"]
4542
path = src/seastar
4643
url = https://github.com/ceph/seastar.git

src/dmclock

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/dmclock/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*~
2+
*.dSYM
3+
*.o
4+
build*
5+
cscope.*

src/dmclock/.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: cpp
2+
cache: ccache
3+
dist: focal
4+
sudo: false
5+
branches:
6+
only:
7+
- master
8+
os:
9+
- linux
10+
compiler:
11+
- clang
12+
- gcc
13+
addons:
14+
apt:
15+
packages:
16+
- cmake
17+
- libgtest-dev
18+
- libboost-dev
19+
before_script:
20+
- mkdir build
21+
- cd build
22+
script:
23+
- cmake ..
24+
- cmake --build . -- -j2 && ctest -V -j2
25+
env:
26+
global:
27+
- LANG="en_US.UTF-8"

src/dmclock/CMakeLists.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
cmake_minimum_required(VERSION 3.5.1)
2+
3+
project(dmclock CXX)
4+
5+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
6+
7+
if (NOT(BOOST_FOUND))
8+
find_package(Boost REQUIRED)
9+
endif()
10+
11+
find_package(Threads)
12+
13+
if(CMAKE_CXX_STANDARD OR CMAKE_CXX_FLAGS MATCHES "-std=(c|gnu)\\+\\+")
14+
# use existing settings if available
15+
else()
16+
set(CMAKE_CXX_STANDARD 11)
17+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
18+
endif()
19+
20+
add_subdirectory(src)
21+
22+
# Determine if dmclock is built as a subproject (using add_subdirectory)
23+
# or if it is the master project.
24+
set(MASTER_PROJECT FALSE)
25+
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
26+
set(MASTER_PROJECT TRUE)
27+
endif()
28+
29+
option(dmclock_TEST "Generate test targets" ${MASTER_PROJECT})
30+
if(dmclock_TEST)
31+
if (NOT(TARGET gtest AND TARGET gtest_main))
32+
if (NOT GTEST_FOUND)
33+
find_package(GTest QUIET)
34+
if (NOT GTEST_FOUND)
35+
include(BuildGTest)
36+
endif()
37+
endif()
38+
endif()
39+
40+
enable_testing()
41+
add_subdirectory(test)
42+
add_subdirectory(support/test)
43+
add_subdirectory(sim)
44+
endif()

src/dmclock/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# dmclock
2+
3+
This repository contains C++ 11 code that implements the dmclock
4+
distributed quality of service algorithm. See __mClock: Handling
5+
Throughput Variability for Hypervisor IO Scheduling__ by Gulati,
6+
Merchant, and Varman for a description of the algorithm.
7+
8+
## Bugs and features
9+
10+
There is a [dmclock project](https://tracker.ceph.com/projects/dmclock) through
11+
which bugs can be reported and features requested.
12+
13+
## Running cmake
14+
15+
When running cmake, set the build type with either:
16+
17+
-DCMAKE_BUILD_TYPE=Debug
18+
-DCMAKE_BUILD_TYPE=Release
19+
20+
To turn on profiling, run cmake with an additional:
21+
22+
-DPROFILE=yes
23+
24+
## Running make
25+
26+
### Building the dmclock library
27+
28+
The `make` command builds a library libdmclock.a. That plus the header
29+
files in the src directory allow one to use the implementation in
30+
their code.
31+
32+
### Building unit tests
33+
34+
The `make dmclock-tests` command builds unit tests.
35+
36+
### Building simulations
37+
38+
The `make dmclock-sims` command builds two simulations -- *dmc_sim*
39+
and *ssched_sim* -- which incorporate, respectively, the dmclock
40+
priority queue or a very simple scheduler for comparison. Other
41+
priority queue implementations could be added in the future.
42+
43+
## dmclock API
44+
45+
To be written....

src/dmclock/benchmark/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# dmclock benchmarking
2+
3+
**IMPORTANT**: now that K_WAY_HEAP is no longer allowed to have the
4+
value 1, the shell and Python scripts that generate the PDFs no longer
5+
work exactly correctly. Some effort to debug is necessary.
6+
7+
This directory contains scripts to evaluate effects of different
8+
branching-factors (k=1 to k=11) in the IndirectIntrusiveHeap
9+
data-structure. IndirectIntrusiveHeap is now a k-way heap, so finding
10+
an ideal value for k (i.e., k=2 or k=3) for a particular work-load is
11+
important. Also, it is well-documented that the right choice of
12+
k-value improves the caching behaviour [Syed -- citation needed
13+
here]. As a result, the overall performance of an application using
14+
k-way heap increases significantly [Syed -- citation needed here].
15+
16+
A rule of thumb is the following:
17+
if number of elements are <= 6, use k=1
18+
otherwise, use k=3.
19+
20+
## Prerequisites
21+
22+
requires python 2.7, gnuplot, and awk.
23+
24+
## Running benchmark
25+
26+
./run.sh [name_of_the_output] [k_way] [repeat] # [Syed -- last two command line args do not work]
27+
28+
The "run.sh" script looks for config files in the "configs" directory,
29+
and the final output is generated as
30+
"name_of_the_output.pdf". Internally, "run.sh" calls other scripts
31+
such as data_gen.sh, data_parser.py, and plot_gen.sh.
32+
33+
## Modifying parameters
34+
35+
To modify k-value and/or the amount of times each simulation is
36+
repeated, modify the following two variables in "run.sh" file:
37+
38+
k_way=[your_value]
39+
repeat=[your_value]
40+
41+
For example, k_way=3 means, the benchmark will compare simulations
42+
using 1-way, 2-way, and 3-way heaps.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[global]
2+
server_groups = 1
3+
client_groups = 2
4+
server_random_selection = true
5+
server_soft_limit = true
6+
7+
[server.0]
8+
server_count = 100
9+
server_iops = 160
10+
11+
[client.0]
12+
client_count = 99
13+
client_wait = 0
14+
client_total_ops = 10000
15+
client_server_select_range = 100
16+
client_iops_goal = 200
17+
client_outstanding_ops = 32
18+
client_reservation = 100.0
19+
client_limit = 0.0
20+
client_weight = 1.0
21+
22+
[client.1]
23+
client_count = 1
24+
client_wait = 10
25+
client_total_ops = 10000
26+
client_server_select_range = 100
27+
client_iops_goal = 200
28+
client_outstanding_ops = 32
29+
client_reservation = 100.0
30+
client_limit = 0.0
31+
client_weight = 1.0
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[global]
2+
server_groups = 1
3+
client_groups = 3
4+
server_random_selection = true
5+
server_soft_limit = true
6+
7+
[client.0]
8+
client_count = 2
9+
client_wait = 0
10+
client_total_ops = 1000
11+
client_server_select_range = 8
12+
client_iops_goal = 200
13+
client_outstanding_ops = 32
14+
client_reservation = 0.0
15+
client_limit = 0.0
16+
client_weight = 1.0
17+
18+
[client.1]
19+
client_count = 2
20+
client_wait = 5
21+
client_total_ops = 1000
22+
client_server_select_range = 8
23+
client_iops_goal = 200
24+
client_outstanding_ops = 32
25+
client_reservation = 20.0
26+
client_limit = 40.0
27+
client_weight = 1.0
28+
29+
[client.2]
30+
client_count = 2
31+
client_wait = 10
32+
client_total_ops = 1000
33+
client_server_select_range = 8
34+
client_iops_goal = 200
35+
client_outstanding_ops = 32
36+
client_reservation = 0.0
37+
client_limit = 50.0
38+
client_weight = 2.0
39+
40+
41+
[server.0]
42+
server_count = 8
43+
server_iops = 160

src/dmclock/benchmark/data_gen.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/bash
2+
config_dir="configs"
3+
repeat=2 #5
4+
5+
# parameter check -- output_file name
6+
if [ "$1" != "" ]; then
7+
output_file="$1"
8+
else
9+
echo "Please provide the name of the output file"
10+
exit
11+
fi
12+
13+
# parameter check -- k-value
14+
if [ "$2" != "" ]; then
15+
k_way="$2"
16+
else
17+
echo "Please provide the maximum K_WAY value"
18+
exit
19+
fi
20+
21+
# parameter check --repeat
22+
if [ "$3" != "" ]; then
23+
repeat="$3"
24+
fi
25+
26+
echo "k-way:$k_way, num_repeat:$repeat"
27+
28+
# create simulators in different directories
29+
k=2
30+
while [ $k -le $k_way ]
31+
do
32+
mkdir "build_$k"
33+
cd "build_$k"
34+
rm -rf *
35+
cmake -DCMAKE_BUILD_TYPE=Release -DK_WAY_HEAP=$k ../../.
36+
make dmclock-sims
37+
cd ..
38+
39+
k=$(( $k + 1 ))
40+
done
41+
42+
# run simulators
43+
echo '' > $output_file
44+
for config in "$config_dir"/*.conf
45+
do
46+
k=2
47+
while [ $k -le $k_way ]
48+
do
49+
cd "build_$k"
50+
51+
# repeat same experiment
52+
i=0
53+
while [ $i -lt $repeat ]
54+
do
55+
i=$(( $i + 1 ))
56+
57+
# clear cache first
58+
sync
59+
#sudo sh -c 'echo 1 >/proc/sys/vm/drop_caches'
60+
#sudo sh -c 'echo 2 >/proc/sys/vm/drop_caches'
61+
#sudo sh -c 'echo 3 >/proc/sys/vm/drop_caches'
62+
63+
# run with heap
64+
msg="file_name:$k:$config"
65+
echo $msg >> ../$output_file
66+
echo "running $msg ..."
67+
./sim/dmc_sim -c ../$config | awk '(/average/)' >> ../$output_file
68+
done # end repeat
69+
cd ..
70+
k=$(( $k + 1 ))
71+
done # end k_way
72+
done # end config
73+

0 commit comments

Comments
 (0)