-
Notifications
You must be signed in to change notification settings - Fork 1k
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
controllers/cpuset_memory_spread: #831
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,15 +187,23 @@ cleanup() | |
|
||
find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read subdir | ||
do | ||
if [ "$subdir" != "/dev/cpuset/sys" ]; then | ||
while read pid | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While should be indented. |
||
do | ||
/bin/kill -9 $pid > /dev/null 2>&1 | ||
if [ $? -ne 0 ]; then | ||
tst_brkm TFAIL "Couldn't kill task - "\ | ||
"$pid in the cpuset" | ||
fi | ||
done < "$subdir/tasks" | ||
rmdir "$subdir" | ||
do | ||
/bin/kill -9 $pid > /dev/null 2>&1 | ||
if [ $? -ne 0 ]; then | ||
tst_brkm TFAIL "Couldn't kill task - "\ | ||
"$pid in the cpuset 1" | ||
fi | ||
done < "$subdir/tasks" | ||
fi | ||
|
||
if [ "$subdir" == "/dev/cpuset/sys" ]; then | ||
cgdelete -r cpuset:sys | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is It is not a shell function or program I have installed. |
||
else | ||
rmdir "$subdir" | ||
fi | ||
|
||
if [ $? -ne 0 ]; then | ||
tst_brkm TFAIL "Couldn't remove subdir - " | ||
"$subdir in the cpuset" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,7 @@ result_check() | |
general_memory_spread_test() | ||
{ | ||
local cpusetpath="$CPUSET/1" | ||
local cpusetpathsys="$CPUSET/sys" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there appears to be an extra indent. Maybe you are mixing tabs and spaces? |
||
local is_spread="$1" | ||
local cpu_list="$2" | ||
local node_list="$3" | ||
|
@@ -206,6 +207,12 @@ general_memory_spread_test() | |
tst_resm TFAIL "set general group parameter failed." | ||
return 1 | ||
fi | ||
cpuset_set "$cpusetpathsys" "$cpu_list" "$node_list" "0" 2> $CPUSET_TMP/stderr | ||
if [ $? -ne 0 ]; then | ||
cpuset_log_error $CPUSET_TMP/stderr | ||
tst_resm TFAIL "set general group parameter failed for sys." | ||
return 1 | ||
fi | ||
|
||
/bin/echo "$is_spread" > "$cpusetpath/cpuset.memory_spread_page" 2> $CPUSET_TMP/stderr | ||
if [ $? -ne 0 ]; then | ||
|
@@ -214,6 +221,19 @@ general_memory_spread_test() | |
return 1 | ||
fi | ||
|
||
/bin/echo "$is_spread" > "$cpusetpathsys/cpuset.memory_spread_page" 2> $CPUSET_TMP/stderr | ||
if [ $? -ne 0 ]; then | ||
cpuset_log_error $CPUSET_TMP/stderr | ||
tst_resm TFAIL "set spread value failed for sys." | ||
return 1 | ||
fi | ||
|
||
array=`ps -elf |grep -v "\["|awk '{print $4}'|xargs echo` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this supposed to do and is it the simplest way to do it? For example, could you do this by reading Also after we move all these processes, do they get moved back to where they came from? Do we split the memory nodes between between group |
||
for element in ${array[@]} | ||
do | ||
/bin/echo $element > "$cpusetpathsys/tasks" 2> /dev/null #$CPUSET_TMP/stderr | ||
done | ||
|
||
/bin/echo "$test_pid" > "$cpusetpath/tasks" 2> $CPUSET_TMP/stderr | ||
if [ $? -ne 0 ]; then | ||
cpuset_log_error $CPUSET_TMP/stderr | ||
|
@@ -224,6 +244,7 @@ general_memory_spread_test() | |
# we'd better drop the caches before we test page cache. | ||
sync | ||
/bin/echo 3 > /proc/sys/vm/drop_caches 2> $CPUSET_TMP/stderr | ||
sleep 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the same thing be achieved by writing to Note that |
||
if [ $? -ne 0 ]; then | ||
cpuset_log_error $CPUSET_TMP/stderr | ||
tst_resm TFAIL "drop caches failed." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use
$CPUSET
?