Lines Matching full:memory
25 if ! ls $SYSFS/devices/system/memory/memory* > /dev/null 2>&1; then
26 echo $msg memory hotplug is not supported >&2
30 if ! grep -q 1 $SYSFS/devices/system/memory/memory*/removable; then
31 echo $msg no hot-pluggable memory >&2
37 # list all hot-pluggable memory
43 for memory in $SYSFS/devices/system/memory/memory*; do
44 if grep -q 1 $memory/removable &&
45 grep -q $state $memory/state; then
46 echo ${memory##/*/memory}
63 grep -q online $SYSFS/devices/system/memory/memory$1/state
68 grep -q offline $SYSFS/devices/system/memory/memory$1/state
73 echo online > $SYSFS/devices/system/memory/memory$1/state
78 echo offline > $SYSFS/devices/system/memory/memory$1/state
83 local memory=$1
85 if ! online_memory $memory; then
86 echo $FUNCNAME $memory: unexpected fail >&2
88 elif ! memory_is_online $memory; then
89 echo $FUNCNAME $memory: unexpected offline >&2
97 local memory=$1
99 if online_memory $memory 2> /dev/null; then
100 echo $FUNCNAME $memory: unexpected success >&2
102 elif ! memory_is_offline $memory; then
103 echo $FUNCNAME $memory: unexpected online >&2
111 local memory=$1
113 if ! offline_memory $memory; then
114 echo $FUNCNAME $memory: unexpected fail >&2
116 elif ! memory_is_offline $memory; then
117 echo $FUNCNAME $memory: unexpected offline >&2
125 local memory=$1
127 if offline_memory $memory 2> /dev/null; then
128 echo $FUNCNAME $memory: unexpected success >&2
130 elif ! memory_is_online $memory; then
131 echo $FUNCNAME $memory: unexpected offline >&2
149 echo "Usage $0 [ -e errno ] [ -p notifier-priority ] [ -r percent-of-memory-to-offline ]"
172 echo "Test scope: $ratio% hotplug memory"
175 # Online all hot-pluggable memory
178 echo -e "\t online all hot-pluggable memory in offline state:"
180 for memory in `hotpluggable_offline_memory`; do
181 echo "offline->online memory$memory"
182 if ! online_memory_expect_success $memory; then
187 echo -e "\t\t SKIPPED - no hot-pluggable memory in offline state"
191 # Offline $ratio percent of hot-pluggable memory
195 echo -e "\t offline $ratio% hot-pluggable memory in online state"
196 echo -e "\t trying to offline $target out of $hotpluggable_num memory block(s):"
197 for memory in `hotpluggable_online_memory`; do
199 echo "online->offline memory$memory"
200 if offline_memory_expect_success $memory; then
207 echo -e "\t\t FAILED - unable to offline some memory blocks, device busy?"
211 # Online all hot-pluggable memory again
214 echo -e "\t online all hot-pluggable memory in offline state:"
216 for memory in `hotpluggable_offline_memory`; do
217 echo "offline->online memory$memory"
218 if ! online_memory_expect_success $memory; then
223 echo -e "\t\t SKIPPED - no hot-pluggable memory in offline state"
227 # Test with memory notifier error injection
231 NOTIFIER_ERR_INJECT_DIR=$DEBUGFS/notifier-error-inject/memory
237 /sbin/modprobe -q -r memory-notifier-error-inject
238 /sbin/modprobe -q memory-notifier-error-inject priority=$priority
246 echo $msg memory-notifier-error-inject module is not available >&2
251 echo -e "\t Test with memory notifier error injection"
255 # Offline $ratio percent of hot-pluggable memory
258 for memory in `hotpluggable_online_memory`; do
260 offline_memory_expect_success $memory
265 # Test memory hot-add error handling (offline => online)
268 for memory in `hotpluggable_offline_memory`; do
269 online_memory_expect_fail $memory
273 # Online all hot-pluggable memory
276 for memory in `hotpluggable_offline_memory`; do
277 online_memory_expect_success $memory
281 # Test memory hot-remove error handling (online => offline)
284 for memory in `hotpluggable_online_memory`; do
285 offline_memory_expect_fail $memory
289 /sbin/modprobe -q -r memory-notifier-error-inject