From patchwork Mon Aug 20 19:49:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masayoshi Mizuma X-Patchwork-Id: 959934 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="icwJL6J0"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vPYs0WRzz9s78 for ; Tue, 21 Aug 2018 05:50:57 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 984123E6476 for ; Mon, 20 Aug 2018 21:50:54 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id D6F133E640F for ; Mon, 20 Aug 2018 21:50:47 +0200 (CEST) Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id F1C5B1400DA1 for ; Mon, 20 Aug 2018 21:50:46 +0200 (CEST) Received: by mail-qt0-x242.google.com with SMTP id b15-v6so17574460qtp.11 for ; Mon, 20 Aug 2018 12:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/qXaID5ZVm1VzWBu3F6NPOY3IF5sg/314ngi9sHrM2o=; b=icwJL6J0k9vxFcMT73O1QIo1jMFydTIyO74fnBGFSr/v33yDaXVE7L2eCexphfPEJc 3iXzAOg2IMcDS8Z5GAsGjjVIrKZH5w1Tru+7Rt7oFgCuIEvpZEpoIa/m2+8hZcIshHJl GxTqJn26iRohh2ocLI83yGuwI0KUs7nvGQBsPcL+u+iXkq1dkKKh/Gb5buITq9jUtVFU oEWZMK6irE+/7/fyZEPd0QeyJP72ka7Pog65MaCJuNdTfL3za2I9F9J0mYK5WAeDzSDx aUbrz35Q19o57C7pdFjpMrxCr2EXle9F21qOmV2256GpYTFwWyTU0bg6stbAR49maSaE 3kXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/qXaID5ZVm1VzWBu3F6NPOY3IF5sg/314ngi9sHrM2o=; b=Eb4XS8SYKNy3yVvBV6QUq0zx3bM3S8866eBAhyUuwGAtbghR/hGbC2mJHnBFUWkMmL HJlXF/KNS67ewLyChiK4tsDZRiqjK+G3EUSaraYX7IMcBAbMfxtlw44ETRD3stR3tj2e BH2bkO6950nLnFJySKZblZuybnL4Jcez7EG4BLpxhdC3hrxRHXkISJ3otrXAYXO8OSv5 M1FBKNdbAv2bHb7dRKehOrDIbxs6iELY1uQe891Gl7vnDiSE4BYAQCMRexPLEaaAYbLQ 2WtpHn+33uNF1h4EfDH6Fwn9u5oFBU7xWab+kalJsNX7rt84MZyfU79pH2jBBBJ5Drlc PC5Q== X-Gm-Message-State: AOUpUlFX6KKEa36qmksrfgqkiFVoIBPd/Z3rq9ZY3D5TPYk1WVCBEA6G bc9xP5CuThUlOKBR/D5/3XfbRLk= X-Google-Smtp-Source: ANB0VdY0E6cx0H5nnIm1+Q5UJH4qpsRTQbmXjep4h/qeVxUKkvK6oPUx8Jd66VM7+NG5bUvEftxjNw== X-Received: by 2002:ac8:488d:: with SMTP id i13-v6mr10206555qtq.235.1534794645776; Mon, 20 Aug 2018 12:50:45 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id a19-v6sm7321136qta.50.2018.08.20.12.50.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 12:50:45 -0700 (PDT) From: Masayoshi Mizuma To: ltp@lists.linux.it Date: Mon, 20 Aug 2018 15:49:11 -0400 Message-Id: <20180820194915.11805-2-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820194915.11805-1-msys.mizuma@gmail.com> References: <20180820194915.11805-1-msys.mizuma@gmail.com> X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Cc: Masayoshi Mizuma Subject: [LTP] [PATCH 1/5] acpi_hotplug: Add library file for ACPI based cpu and memory hotplug X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Masayoshi Mizuma This file includes some APIs to use ACPI based cpu and memory hotplug. Signed-off-by: Masayoshi Mizuma --- .../hotplug/acpi_hotplug/ACPIHOTPLUG_lib.sh | 310 ++++++++++++++++++ 1 file changed, 310 insertions(+) create mode 100755 testcases/kernel/hotplug/acpi_hotplug/ACPIHOTPLUG_lib.sh diff --git a/testcases/kernel/hotplug/acpi_hotplug/ACPIHOTPLUG_lib.sh b/testcases/kernel/hotplug/acpi_hotplug/ACPIHOTPLUG_lib.sh new file mode 100755 index 000000000..8c5dc1d89 --- /dev/null +++ b/testcases/kernel/hotplug/acpi_hotplug/ACPIHOTPLUG_lib.sh @@ -0,0 +1,310 @@ +#!/bin/sh + +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2018, FUJITSU LIMITED. All rights reserved. + +export HOTPLUGABLE_CONTAINER= +export HOTPLUGABLE_NODES=() +RETRY=5 +RETRY_TIME=60 + +# $1: node number +is_memoryless_node() +{ + local node=$1 + + numactl -H | awk ' + /node '$node' size:/ { + if ($4 == 0) + prine 1 + else + print 0 + }' +} + +# $1: node number +is_movable_node() +{ + local node=$1 + + awk ' + BEGIN { + zone = "" + NotMovableFound = 0 + nextnode = '$node' + 1 + } + /^Node '$node'/{ + zone = $4 + } + /present/ { + if (zone != "") { + if ((zone != "Movable") && ($2 != 0)) { + NotMovableFound = 1 + exit + } + } + } + match($0, "^Node " nextnode) { + exit + } + + END { + if (NotMovableFound == 0) + print 1 + else + print 0 + } + ' /proc/zoneinfo +} + +stop_udev() +{ + systemctl stop systemd-udevd-kernel.socket + systemctl stop systemd-udevd-control.socket + systemctl stop systemd-udevd.service +} + +resume_udev() +{ + systemctl start systemd-udevd.service + systemctl start systemd-udevd-kernel.socket + systemctl start systemd-udevd-control.socket +} + +_setup() +{ + local ACPI_CONTAINERS=() + local ONLINE_CONTAINERS=() + local CPUS=() + local tmp_NODES=() + local NODES=() + local movable_node= + local NOHP_NODES=0 + + ACPI_CONTAINERS=( $(find /sys/devices/LNXSYSTM\:00/ -name 'ACPI0004:*') ) + + ONLINE_CONTAINERS=() + for c in ${ACPI_CONTAINERS[@]}; do + status=$(cat $c/status) + if [[ $status -ne 0 ]]; then + ONLINE_CONTAINERS=( ${ONLINE_CONTAINERS[@]} $c ) + fi + done + + if [[ ${#ONLINE_CONTAINERS[@]} -lt 2 ]]; then + tst_brk TCONF "The number of online ACPI containers is not enough. 2 or more online ACPI containers are needed, but this system has ${#ONLINE_CONTAINERS[@]} contianers." + fi + + for c in ${ONLINE_CONTAINERS[@]}; do + CPUS=( $(find $c -name 'ACPI0007:*' ) ) + tmp_NODES=() + NODES=() + NOHP_NODES=0 + for cpu in ${CPUS[@]}; do + tmp_NODES=( ${tmp_NODES[@]} $(ls $cpu/physical_node/ 2> /dev/null | grep ^node | sed -e 's/node//') ) + done + NODES=( $(echo ${tmp_NODES[@]} | tr ' ' '\n' | sort | uniq ) ) + + # Memory device ID is PNP0C80, however, the memory ID is not used here + # but the node ID is used. + # The hotplugable memory section has ACPI_SRAT_MEM_HOT_PLUGGABLE flag + # and the zone is handled as Movable zone. Following assumes that + # the node has only Movable zone or it is memory less node. + # So using the node ID gets this test cleared rather than using memory ID. + for n in ${NODES[@]}; do + if [[ $(is_movable_node $n) -eq 0 ]] && [[ $(is_memoryless_node $n) -eq 0 ]]; then + NOHP_NODES=1 + break + fi + done + if [[ $NOHP_NODES -eq 0 ]]; then + HOTPLUGABLE_CONTAINER=$(basename $c) + HOTPLUGABLE_NODES=( ${NODES[@]} ) + break + fi + done + + # Some hotplug udev rules may disturb for this test. + # Let's stop them. + stop_udev + + tst_res TINFO "TARGET ACPI CONTANIER: $HOTPLUGABLE_CONTAINER" + tst_res TINFO "TARGET NODES: ${HOTPLUGABLE_NODES[@]}" +} + +_cleanup() +{ + resume_udev +} + +cpu_hp() +{ + local hpop= + local CPUS=( $(echo /sys/bus/acpi/devices/$HOTPLUGABLE_CONTAINER/ACPI0007:*/physical_node/online) ) + + local hp_cpus=${#CPUS[@]} + local current_cpus=$(nproc) + local expected_cpus= + local ACPI_CPU= + local force=0 + local hotplugedcpus=0 + + if [[ $1 == "hotremove" ]]; then + hpop=0 + else + hpop=1 + fi + if [[ $2 == "force" ]]; then + force=1 + fi + + if [[ $hpop -eq 0 ]]; then + expected_cpus=$(( current_cpus - hp_cpus )) + else + expected_cpus=$(( current_cpus + hp_cpus )) + fi + + for cpu in ${CPUS[@]}; do + echo -n $hpop > $cpu 2> /dev/null + ACPI_CPU=$( echo $cpu | sed -e 's#/sys/bus/acpi/devices/ACPI0004:[0-9a-f]\+/\(ACPI0007:.*\)/physical_node/online#\1#') + if [[ $? -ne 0 ]]; then + tst_res TINFO "CPU: $ACPI_CPU $1 failed." + if [[ $force -eq 0 ]]; then + return 1 + fi + else + if [[ $force -ne 0 ]]; then + tst_res TINFO "CPU: $ACPI_CPU $1 successed." + fi + hotplugedcpus=$(( hotplugedcpus + 1 )) + fi + done + + tst_res TINFO "CPU: current: $(nproc) hotpluged: $hotplugedcpus" + if [[ $(nproc) -eq $expected_cpus ]]; then + return 0 + else + return 1 + fi +} + +# $1: node number +# $2: expected memory size (MB) +memhp_result() +{ + local node=$1 + local expected=$2 + local current= + + current=$(numactl -H | awk ' + /^node '$node' size/ { + print $4 + } + ') + + if [[ $current -eq $expected ]]; then + echo 1 + else + echo 0 + fi +} + +memory_hp() +{ + local hpop= + local memory=() + local memhpdone= + local expected= + local block_size_bytes=$(cat /sys/devices/system/memory/block_size_bytes ) + block_size_bytes=$(echo "obase=10;ibase=16;$block_size_bytes" | bc) + local result=0 + local force=0 + local hotplugedsections= + local removable= + + declare -A mem_hotpluged + + if [[ $1 == "hotremove" ]]; then + hpop="offline" + else + hpop="online_movable" + fi + if [[ $2 == "force" ]]; then + force=1 + fi + + for node in ${HOTPLUGABLE_NODES[@]}; do + memory=$(ls /sys/devices/system/node/node$node/ | grep memory | sort -n -r) + for mem in ${memory[@]}; do + if [[ $force -eq 1 ]]; then + echo -n $hpop > /sys/devices/system/node/node$node/$mem/state 2> /dev/null + mem_hotpluged[$node]=$(( mem_hotpluged[$node] + 1 )) + hotplugedsections=$(( hotplugedsections + 1 )) + else + memhpdone=0 + for ((i = 1; i <= RETRY; i++)); do + echo -n $hpop > /sys/devices/system/node/node$node/$mem/state + if [[ $? -eq 0 ]]; then + memhpdone=1 + break + else + removable=$(cat /sys/devices/system/node/node$node/$mem/removable) + if [[ $removable -ne 1 ]]; then + tst_res TINFO "memory: Node: $node section: $mem something wrong..." + return 1 + fi + tst_res TINFO "memory: Node: $node section: $mem $1 failed ($i times). Retry..." + fi + sleep $RETRY_TIME + done + if [[ $memhpdone -eq 0 ]]; then + tst_res TINFO "memory: Node: $node section: $mem $1 failed." + return 1 + else + tst_res TINFO "memory: Node: $node section: $mem $1 successed." + mem_hotpluged[$node]=$(( mem_hotpluged[$node] + 1 )) + hotplugedsections=$(( hotplugedsections + 1 )) + fi + fi + done + done + + for node in ${HOTPLUGABLE_NODES[@]}; do + if [[ $hpop == "offline" ]]; then + expected=0 + else + expected=$(echo "${mem_hotpluged[$node]} * $block_size_bytes/1024/1024" | bc) + fi + if [[ $(memhp_result $node $expected) -ne 1 ]]; then + result=$((result + 1)) + fi + tst_res TINFO "Memory: Node: $node $hotplugedsections sections hotpluged." + done + + return $result +} + +container_hp() +{ + local hpop= + local online_ret=0 + + if [[ $1 == "hotremove" ]]; then + hpop=0 + else + hpop=1 + fi + + echo $hpop > /sys/bus/acpi/devices/$HOTPLUGABLE_CONTAINER/physical_node/online + online_ret=$? + + if [[ $online_ret -ne 0 ]]; then + tst_res TINFO "ACPI container: $HOTPLUGABLE_CONTAINER $1 failed." + numactl -H + return 1 + else + tst_res TINFO "ACPI container: $HOTPLUGABLE_CONTAINER $1 successed." + fi + + return 0 +} From patchwork Mon Aug 20 19:49:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masayoshi Mizuma X-Patchwork-Id: 959937 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QGzdMm53"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vPYx5pFjz9s78 for ; Tue, 21 Aug 2018 05:51:01 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 5ED693E6451 for ; Mon, 20 Aug 2018 21:50:59 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id 562543E640F for ; Mon, 20 Aug 2018 21:50:48 +0200 (CEST) Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 9DD2210007A6 for ; Mon, 20 Aug 2018 21:50:47 +0200 (CEST) Received: by mail-qt0-x243.google.com with SMTP id e19-v6so17604131qtp.8 for ; Mon, 20 Aug 2018 12:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DTTVcT9QMDiqq82OolqE1gZa0BrwINo/hzkbfxlZdAQ=; b=QGzdMm53oXBHFiXaJxfvPrO89VVrtjTMBYNr+MwhebVcqsGUF/l4trFJt2ILY3eUGy iGlKSbIDuvWfqisZ54Ssdu6aL4eyGpYOVIJAbgogR8zNHdwn8cdyLgVIGFjEksIzyO3k E0EoaRasuE0cJiNiDPflFG8QP9NA72vs8m1XlgJFaTRhoJt94dp7GdKwXxPTFVegO1X5 Necy+kfAMcHFXFkbJslTwTSYXA/Hjs8RAPEA+WPR4IuofM42KsPmEwCYW53IggWthdg5 1rfDVjMAoepI+jUJvl6/dm8YEdMZYE9MTAeclAJ0XU+oxY3lWWGwPF8J8dyorrUyQ8Nw zMXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DTTVcT9QMDiqq82OolqE1gZa0BrwINo/hzkbfxlZdAQ=; b=pQ48BtD8Pvz/WmcTrY9q0mo2f9m74+qb+htoDxebWWbf3YDiDP50bZdcYmVE9Wsp4u 2G5Ypx0G7jO7ZXZj1kR19MMYVtLEjXlPQv/e6tB3Jw297lL00RhlypxY9O8yGKxCuEwl SlB6jQMgqYyHYkCEb/6MJJMU0thMaVs7kBu52ndK5g2LQShKgzVX8E/S7h6tTFgArmpq YtG6U7Hwsof1yetRQnNv5M0o5NlkJPyjPXIiXtBedmUHNQ9WEsf/U9HY1tCKg9IOV+QA sqfsvR+EtT1V348ddHNE+3RuaSyowHWm6kyHE1e7fXCZhMoEbfjfura0dYUV1rv9024O 4ivg== X-Gm-Message-State: AOUpUlELyVy1YoydzMcYypMM/9jdVD1r4WpbaxHsaip9nt21hAzlLcIj Px0Ighss1WYNAjCoAhfH8nUATaY= X-Google-Smtp-Source: ANB0VdY0KRUOR34WiNtdvzUCf4IubPRWqNrFgNfNNOu8F0CBPSs+oz8KoSfTCsKVrbQ7Bs4DPAj0aA== X-Received: by 2002:ac8:7689:: with SMTP id g9-v6mr12388569qtr.144.1534794646538; Mon, 20 Aug 2018 12:50:46 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id a19-v6sm7321136qta.50.2018.08.20.12.50.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 12:50:46 -0700 (PDT) From: Masayoshi Mizuma To: ltp@lists.linux.it Date: Mon, 20 Aug 2018 15:49:12 -0400 Message-Id: <20180820194915.11805-3-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820194915.11805-1-msys.mizuma@gmail.com> References: <20180820194915.11805-1-msys.mizuma@gmail.com> X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Cc: Masayoshi Mizuma Subject: [LTP] [PATCH 2/5] acpi_hotplug: Add ACPI based cpu and memory hotplug testing X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Masayoshi Mizuma This tests the following ACPI based cpu and memory hotplugs. 1. Memory hot remove 2. CPU hot remove 3. ACPI container device hot remove 4. ACPI container device hot add 5. CPU hot add 6. Memory hot add Signed-off-by: Masayoshi Mizuma --- .../hotplug/acpi_hotplug/ACPIHOTPLUG_01.sh | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100755 testcases/kernel/hotplug/acpi_hotplug/ACPIHOTPLUG_01.sh diff --git a/testcases/kernel/hotplug/acpi_hotplug/ACPIHOTPLUG_01.sh b/testcases/kernel/hotplug/acpi_hotplug/ACPIHOTPLUG_01.sh new file mode 100755 index 000000000..e01b9ad79 --- /dev/null +++ b/testcases/kernel/hotplug/acpi_hotplug/ACPIHOTPLUG_01.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2018, FUJITSU LIMITED. All rights reserved. + +TST_SETUP=_setup +TST_CLEANUP=_cleanup +TST_TESTFUNC=test +TST_CNT=6 + +. tst_test.sh +. ACPIHOTPLUG_lib.sh + +test1() +{ + if [[ ${#HOTPLUGABLE_NODES[@]} -eq 0 ]]; then + tst_brk TCONF "Memory hotplug may be not supported in this system" + fi + memory_hp "hotremove" + if [[ $? -eq 0 ]]; then + tst_res TPASS "memory hotremove success" + else + tst_res TFAIL "memory hotremove failed" + fi +} + +test2() +{ + if [[ -z $HOTPLUGABLE_CONTAINER ]]; then + tst_brk TCONF "CPU hotplug may be not supported in this system" + fi + cpu_hp "hotremove" + if [[ $? -eq 0 ]]; then + tst_res TPASS "cpu hotremove success" + else + tst_res TFAIL "cpu hotremove failed" + fi +} + +test3() +{ + if [[ -z $HOTPLUGABLE_CONTAINER ]]; then + tst_brk TCONF "ACPI container hotplug may be not supported in this system" + fi + container_hp "hotremove" + if [[ $? -eq 0 ]]; then + tst_res TPASS "ACPI container hotremove success" + else + tst_res TFAIL "ACPI container hotremove failed" + fi +} + +test4() +{ + if [[ -z $HOTPLUGABLE_CONTAINER ]]; then + tst_brk TCONF "ACPI container hotplug may be not supported in this system" + fi + container_hp "hotadd" + if [[ $? -eq 0 ]]; then + tst_res TPASS "ACPI container hotadd success" + else + tst_res TFAIL "ACPI container hotadd failed" + fi +} + +test5() +{ + if [[ -z $HOTPLUGABLE_CONTAINER ]]; then + tst_brk TCONF "CPU hotplug may be not supported in this system" + fi + cpu_hp "hotadd" + if [[ $? -eq 0 ]]; then + tst_res TPASS "cpu hotadd success" + else + tst_res TFAIL "cpu hotadd failed" + fi +} + + +test6() +{ + if [[ ${#HOTPLUGABLE_NODES[@]} -eq 0 ]]; then + tst_brk TCONF "Memory hotplug may be not supported in this system" + fi + memory_hp "hotadd" + if [[ $? -eq 0 ]]; then + tst_res TPASS "memory hotadd success" + else + tst_res TFAIL "memory hotadd failed" + fi +} +tst_run From patchwork Mon Aug 20 19:49:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masayoshi Mizuma X-Patchwork-Id: 959938 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i05OXn82"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vPZ14gYQz9s78 for ; Tue, 21 Aug 2018 05:51:05 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 26DA93E6484 for ; Mon, 20 Aug 2018 21:51:03 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 0E20E3E642E for ; Mon, 20 Aug 2018 21:50:49 +0200 (CEST) Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 7F68D1A00923 for ; Mon, 20 Aug 2018 21:50:48 +0200 (CEST) Received: by mail-qk0-x233.google.com with SMTP id h138-v6so6782098qke.8 for ; Mon, 20 Aug 2018 12:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DEyb/hooHpFUJAAv0dp3d27KMceJNiz95d82BRSJL+4=; b=i05OXn82IMg0FfYXEjiQNF55NcvHJyqot1+G3VsU6Z3AcjOB9Nt7LEfqBBABk0cZ// lOoItmRSi2up2Kct9WASi2I0cLwGtOQnOJ++5Od5LU7EnpPLU6ecLxGTjZJM9F9gysMs OoEA36yITCVTrUs8tY9/vlVfRUGVKLMnyDxt9h1aCABkdGq8epoH6Gq3AIgPLNrws920 mEs71b1AkO3jmd4EyinAWGuNY7S8KfrncHMbSpogymAPOlvIVjTMbXBcf/9Hvyv4A/xo 3jwMh0QO8QQ09+dAfAlWaYJCPA8fdjPX5/KuYFkf0WB0FGUy0O7AzX1ACOypHYCmA2EK gQsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DEyb/hooHpFUJAAv0dp3d27KMceJNiz95d82BRSJL+4=; b=GM4ZSFD/azCmdLL8Vo/asBb6DQGKQNl0s8WojWgFdP4nKPXy3v0kCGBA9C6NTkWgTj fx6h0wiqBG5ZRn01nKrmORgy8JU6yxHdTu/FUbIXgYXUMb/S+t4RRPWyXeJ7AM1yFWoD ssxfKamT8NrAai12XKCTKhlAhk5e82kPf74r33VkKkw5bV9Rr52xg2g2TSaLpPy0pdyT eFZ8kf4VD814PFguiWg/B3bQvvmrvRkpsWSEFd+yoEKdx79YVMD5vjWqdNIKVX+pAe66 4tRFDRf4+z/XtmIh3Fn/X0usA/LmN/3Tu7FslSAjMky8M+PSlY+zsZ6GmtlclpGir8+1 ipKg== X-Gm-Message-State: AOUpUlGV4amP7rEmdASFCSfvXUB20qwMXdjDL9tTgc/bE+kkhwPWTGv5 +Q8WbGNOZ75Ru4yQUmmF3q9dCvQ= X-Google-Smtp-Source: AA+uWPwmkZ3BXvPhqVDCiYMvswW3spSiSuqpBX48ugP7BVuHSCTbwzmLjzDHKSh3YWxdJpL8lFr8LQ== X-Received: by 2002:a37:9f90:: with SMTP id i138-v6mr42419516qke.113.1534794647245; Mon, 20 Aug 2018 12:50:47 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id a19-v6sm7321136qta.50.2018.08.20.12.50.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 12:50:46 -0700 (PDT) From: Masayoshi Mizuma To: ltp@lists.linux.it Date: Mon, 20 Aug 2018 15:49:13 -0400 Message-Id: <20180820194915.11805-4-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820194915.11805-1-msys.mizuma@gmail.com> References: <20180820194915.11805-1-msys.mizuma@gmail.com> X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Cc: Masayoshi Mizuma Subject: [LTP] [PATCH 3/5] acpi_hotplug: Add ACPIHOTPLUG_01.sh under runtest X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Masayoshi Mizuma Add ACPI based hotplug test, ACPIHOTPLUG_01.sh under runtest directory. Signed-off-by: Masayoshi Mizuma --- runtest/acpi_hotplug | 1 + 1 file changed, 1 insertion(+) create mode 100644 runtest/acpi_hotplug diff --git a/runtest/acpi_hotplug b/runtest/acpi_hotplug new file mode 100644 index 000000000..9c6ccd3ad --- /dev/null +++ b/runtest/acpi_hotplug @@ -0,0 +1 @@ +ACPIHOTPLUG_01 ACPIHOTPLUG_01.sh From patchwork Mon Aug 20 19:49:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masayoshi Mizuma X-Patchwork-Id: 959939 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JFURFFk8"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vPZ634hjz9s5c for ; Tue, 21 Aug 2018 05:51:10 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B03163E646E for ; Mon, 20 Aug 2018 21:51:06 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id C814D3E6455 for ; Mon, 20 Aug 2018 21:50:50 +0200 (CEST) Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 1DD97600D78 for ; Mon, 20 Aug 2018 21:50:49 +0200 (CEST) Received: by mail-qt0-x244.google.com with SMTP id b15-v6so17574600qtp.11 for ; Mon, 20 Aug 2018 12:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PMKu/lrAzQSLl/1Ik/DKzOiWCw2ELItCg5qU/C85lXM=; b=JFURFFk8N4/7WmZiT6wWF4mxrhufuy89EF0Rqw2vHt0lYfloSvLMKLu7ivS4Qq7/0p D7DD3yWYBOcBCJPNlukB0jWec1GZO+ifyJBLkbBSyIq6S0VOcYZlG3rmlLRI6NMnhIGq d8zUm5dyww9SGAb0dnBdV31cwRtvzf1cSGh3Hz9+YuutcAfc3Kzqclf6UwAKj3M0LVd/ F6dlN3kok0CBJhEAKFWjmjpuVfUR/7Bn/5dxbHXQoAatlGqv/LMsTu6X0GCt4FQdO8Gx DfkmYOXY+K/9UJg8IR2v2kwIk/X7v/lc0ZtWc8HPgXxUT/q/50nziG4bE7QCnX7/THcG T8/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PMKu/lrAzQSLl/1Ik/DKzOiWCw2ELItCg5qU/C85lXM=; b=WeEY0KN4y0Fmfd0wII0ANW3mFfW16csvNXmpmWsUZ/xdadTjf5wJzEvvXm/JaPXT/N xT0qWQ8m2D3s1r6VT8EsPH4TzsuIa45iVvPZlLsaPvXY12qHGpU1TaCrKOorYoA5XzCm mC3mTqpiO0TdHMlVFDRy0Cjanu3W8iyKQSh+TVIEgHKOMLaVb/f9LyPbaisC5bsPafp5 xj+WYD4c+0+glxwinb3KcigGcud4z7683T6N82zaiIpLYnBRWmGQTqp0iozEVJfsggWr Bg84tDeMeyC7re6zqBRyU5yA2+ceNF8Mny/jeDxkEBCat+bHBpFq3FyLjM6IG/LB7QCV jO3w== X-Gm-Message-State: AOUpUlHuT5Znw3It22c44P14fHD7WcZolIiXQAlhxg6t73wYx2pv28q9 6RmH0UmS+IvVYnMgbD9hmy1y8ss= X-Google-Smtp-Source: AA+uWPxAuMmY6iELRcnJvClB4IiW2n0eo2wn/3GBluHngWYg4LMUof5WMu+mI+BlarHldeFeMKeeiA== X-Received: by 2002:a0c:c30f:: with SMTP id f15-v6mr42601139qvi.104.1534794647973; Mon, 20 Aug 2018 12:50:47 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id a19-v6sm7321136qta.50.2018.08.20.12.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 12:50:47 -0700 (PDT) From: Masayoshi Mizuma To: ltp@lists.linux.it Date: Mon, 20 Aug 2018 15:49:14 -0400 Message-Id: <20180820194915.11805-5-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820194915.11805-1-msys.mizuma@gmail.com> References: <20180820194915.11805-1-msys.mizuma@gmail.com> X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Cc: Masayoshi Mizuma Subject: [LTP] [PATCH 4/5] acpi_hotplug: Add Makefile X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Masayoshi Mizuma Signed-off-by: Masayoshi Mizuma --- .../kernel/hotplug/acpi_hotplug/Makefile | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 testcases/kernel/hotplug/acpi_hotplug/Makefile diff --git a/testcases/kernel/hotplug/acpi_hotplug/Makefile b/testcases/kernel/hotplug/acpi_hotplug/Makefile new file mode 100644 index 000000000..48c969b22 --- /dev/null +++ b/testcases/kernel/hotplug/acpi_hotplug/Makefile @@ -0,0 +1,26 @@ +# +# ACPI based CPU and Memory hotplug test suite Makefile. +# Copyright (c) 2018, FUJITSU LIMITED. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk From patchwork Mon Aug 20 19:49:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masayoshi Mizuma X-Patchwork-Id: 959940 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rJCyj4YM"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vPZB21vhz9s5c for ; Tue, 21 Aug 2018 05:51:14 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C73573E6411 for ; Mon, 20 Aug 2018 21:51:11 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) by picard.linux.it (Postfix) with ESMTP id 269F03E641C for ; Mon, 20 Aug 2018 21:50:51 +0200 (CEST) Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id CFF27200AEA for ; Mon, 20 Aug 2018 21:50:49 +0200 (CEST) Received: by mail-qk0-x244.google.com with SMTP id g197-v6so192566qke.5 for ; Mon, 20 Aug 2018 12:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=evP8SF/KqGck7Q3tCL6qzZAz3jTqV/1T21YZqu80wMA=; b=rJCyj4YMs3/iHIgz5c6hai88d/oFMebyPY1Q7uvsFyRwvFcina52CUiCE97DfPAYyK yK9LsudAhnbcIkbTD61dpgxrY5+jCIw1PMnl2jM6CvM7tB1Msu7a+J1jiFGyjc4pVRjg wZ0gutR8jQVqSmL+gl0XtrR9SdYbo+WosGHpCJ5IVnHNsq6Y/jtFnVHZ7utqZI8Mexjs jmjYWYcIHI76I1jYm5MaZi9e5gMYSfOy3cUkkzu0Rwr6dhu+6+1uTqXt24D7W9JKcNBw UpCcBqeBlPe8lxZMyQ3D6S5ZgJhzfgFBl7HMwPu1NnUXtUhYcYYNOrEE0LJgEdQbIo2s 4qiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=evP8SF/KqGck7Q3tCL6qzZAz3jTqV/1T21YZqu80wMA=; b=dCilOQ+iUedcaAl08pa0cjd2tNmPfu2KPgPHzCJAFDGC4+t1cjxglu9kgIozJQT7rP QhipJFju8kp+xzJicaxkzKG0bDb4G9YAFb0CopvRZlbwKU3aufFO6NUyRCKlB47PBp22 UC6ZVyakluA8CuMPnihuM3ziWq26QlOpR/UGJjDCu0zEXn0hDCgZgxf9lsO6T6lWyUpv VXGvkdmLLJCPAISE4nlSn/VkmLNY3yfg4kExRAiG4o5GgE2FeIlZkz//8AU3I5EtvuQY qC3BBAhrtlYFug2Mfulbf1AbLezxGbrlC+ucNexmECWGcg4iAR/lVu/5PFn6tXizyeg7 SKzA== X-Gm-Message-State: AOUpUlFWJX2MqiEUA9/WvZU1Oh0iLxfZxSOUDv7WnP8UHdb+ePq+Pyhj K8H1vnDusFpYlfHSocXFHVGvgiU= X-Google-Smtp-Source: AA+uWPzvJcvQcnaf545mS+/RDPRjC4X0sQIEBT95ir5jWhDGgOg9HYqcsWzt66hO+Fs/mIuVBwDM5g== X-Received: by 2002:a37:1adb:: with SMTP id l88-v6mr9888853qkh.43.1534794648705; Mon, 20 Aug 2018 12:50:48 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id a19-v6sm7321136qta.50.2018.08.20.12.50.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 12:50:48 -0700 (PDT) From: Masayoshi Mizuma To: ltp@lists.linux.it Date: Mon, 20 Aug 2018 15:49:15 -0400 Message-Id: <20180820194915.11805-6-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820194915.11805-1-msys.mizuma@gmail.com> References: <20180820194915.11805-1-msys.mizuma@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Cc: Masayoshi Mizuma Subject: [LTP] [PATCH 5/5] acpi_hotplug: Add README X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Masayoshi Mizuma Signed-off-by: Masayoshi Mizuma --- testcases/kernel/hotplug/acpi_hotplug/README | 80 ++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 testcases/kernel/hotplug/acpi_hotplug/README diff --git a/testcases/kernel/hotplug/acpi_hotplug/README b/testcases/kernel/hotplug/acpi_hotplug/README new file mode 100644 index 000000000..cec78e19f --- /dev/null +++ b/testcases/kernel/hotplug/acpi_hotplug/README @@ -0,0 +1,80 @@ +ACPI based CPU and Memory hotplug testing +========================================= + +Assumption +---------- +* The system has two or more ACPI container devices. The HID is 'ACPI0004'. +* The CPU (HID: ACPI0007) and memory (HID: PNP0C80) belong to the ACPI +container device. For example of the structure in sysfs is as follows. + +[source] +-------------- +/sys/devices/LNXSYSTM:00/device:00/ACPI0004:03/ +├── ACPI0007:168 +├── ACPI0007:169 +... +├── PNP0C80:06 +├── PNP0C80:07 +... +-------------- + +* The memory has Hot Pluggable affinity in Memory Affinity Structure, SRAT. +If the memory has Hot Pluggable affinity, you can see the following 'hotplug' +keyword in dmesg. + +[source] +-------------- +SRAT: Node 2 PXM 6 [mem 0x180000000000-0x1bffffffffff] hotplug +SRAT: Node 3 PXM 7 [mem 0x1c0000000000-0x1fffffffffff] hotplug +-------------- +* The memory is marked as 'Movable' which is available when movable_node +kernel option is set. + +* There are one or more memory node in the container device and the memory +node has 'Movable zone' only, not mixed the other zones. You can check +such memory node from /proc/pagetypeinfo or /proc/zoneinfo. The example +of /proc/pagetypeinfo is as follows. + +[source] +-------------- +Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10 +Node 3, zone Movable, type Unmovable 0 0 0 0 0 0 0 0 0 0 0 +Node 3, zone Movable, type Movable 0 0 1 0 1 1 0 1 1 0 16382 +Node 3, zone Movable, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0 +Node 3, zone Movable, type HighAtomic 0 0 0 0 0 0 0 0 0 0 0 +Node 3, zone Movable, type CMA 0 0 0 0 0 0 0 0 0 0 0 +Node 3, zone Movable, type Isolate 0 0 0 0 0 0 0 0 0 0 0 + +Number of blocks type Unmovable Movable Reclaimable HighAtomic CMA Isolate +Node 3, zone Movable 0 32768 0 0 0 0 +-------------- + +Test case description +--------------------- + +ACPIHOTPLUG_01.sh +~~~~~~~~~~~~~~~~ + +Test1 +^^^^^ +Verifies hot-removing the memory. + +Test2 +^^^^^ +Verifies hot-removing the CPU. + +Test3 +^^^^^ +Verifies hot-removing the ACPI container device. + +Test4 +^^^^^ +Verifies hot-adding the ACPI container device. + +Test5 +^^^^^ +Verifies hot-adding the CPU. + +Test6 +^^^^^ +Verifies hot-adding the memory.