From patchwork Wed Apr 23 08:43:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Singh Rawat X-Patchwork-Id: 28850 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB83D203AC for ; Wed, 23 Apr 2014 08:43:57 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id m5sf2032849qaj.1 for ; Wed, 23 Apr 2014 01:43:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=MYhqYTQVFn8000NISUP2HGEr9xqUR02LEupiH++aX5E=; b=RYwHPqd6x5MJ/tBWj1///crTj8+pnTmqfSiOIwKfa7VHJR6FYNBR7nGZZ6YI+XHfpT iACfn+oftUtX/bypapaWkwqpC0ceBc6r14l6736WxKqgZXk5kKCioqUlIzWXEghvB7n1 kXi6xJW2u3rrJxvMt7Hg2dnErqrfSekdvh5QPbwj7Oqp2Q7Zv7liXGVHPAuVrfjX3CZg rluPUg6C1wmz5fMFNFHpb9R9CL7Okte+q2+IjJsYU6mBkT7oYJnJ8RnD55miCy0Ury+V d5gHZO0MDUGV0JomOmm91tmUW5iVa+X0k0DZOcWi8V+7F20qi/GiuZXaKm8UO1Lox70X XJ/w== X-Gm-Message-State: ALoCoQnZkUNabbvyA+x0zB+SPdpgbX6fJcV6c6Qzmd+50DD5xrmYKyOsiSzeEb6U8pDFcCsSPUeA X-Received: by 10.58.107.203 with SMTP id he11mr25820705veb.12.1398242637600; Wed, 23 Apr 2014 01:43:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.52 with SMTP id j49ls458751qga.67.gmail; Wed, 23 Apr 2014 01:43:57 -0700 (PDT) X-Received: by 10.52.6.162 with SMTP id c2mr35120508vda.6.1398242637481; Wed, 23 Apr 2014 01:43:57 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id z15si52225vcj.36.2014.04.23.01.43.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 01:43:57 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id la4so755607vcb.17 for ; Wed, 23 Apr 2014 01:43:57 -0700 (PDT) X-Received: by 10.52.249.105 with SMTP id yt9mr1355376vdc.34.1398242637409; Wed, 23 Apr 2014 01:43:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp86981vcb; Wed, 23 Apr 2014 01:43:57 -0700 (PDT) X-Received: by 10.68.195.199 with SMTP id ig7mr16966494pbc.32.1398242636575; Wed, 23 Apr 2014 01:43:56 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id xy8si205167pab.78.2014.04.23.01.43.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 01:43:56 -0700 (PDT) Received-SPF: none (google.com: sanjay.rawat@linaro.org does not designate permitted sender hosts) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id y13so559831pdi.33 for ; Wed, 23 Apr 2014 01:43:56 -0700 (PDT) X-Received: by 10.68.231.196 with SMTP id ti4mr53091313pbc.48.1398242636024; Wed, 23 Apr 2014 01:43:56 -0700 (PDT) Received: from srawat-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id oa3sm892528pbb.15.2014.04.23.01.43.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 01:43:55 -0700 (PDT) From: Sanjay Singh Rawat To: private-pmwg@linaro.org Cc: Sanjay Singh Rawat Subject: [PATCH PMQA] cpuhotplug: add subtest to stress hotplug feature Date: Wed, 23 Apr 2014 14:13:36 +0530 Message-Id: <1398242616-9725-1-git-send-email-sanjay.rawat@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sanjay.rawat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Sanjay Singh Rawat --- - Tested on my x86 dev m/c Output: running hotplug stress on cpu : cpu1 pass: cpu hotplug count = 200 duration = 16.98 seconds running hotplug stress on cpu : cpu2 pass: cpu hotplug count = 200 duration = 16.36 seconds running hotplug stress on cpu : cpu3 pass: cpu hotplug count = 200 duration = 15.05 seconds - Issue: For a hotplug count of 500 the system just hangs. Need to manually restart. Is it safe to simply plugout the cpu? What will happend to the tasks in the cpu runqueue. --- cpuhotplug/cpuhotplug_09.sh | 70 ++++++++++++++++++++++++++++++++++++++++++ cpuhotplug/cpuhotplug_09.txt | 1 + 2 files changed, 71 insertions(+) create mode 100755 cpuhotplug/cpuhotplug_09.sh create mode 100644 cpuhotplug/cpuhotplug_09.txt diff --git a/cpuhotplug/cpuhotplug_09.sh b/cpuhotplug/cpuhotplug_09.sh new file mode 100755 index 0000000..be0c91c --- /dev/null +++ b/cpuhotplug/cpuhotplug_09.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# PM-QA validation test suite for the power management on Linux +# +# Copyright (C) 2014, Linaro Limited. +# +# 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. +# +# Contributors: +# Sanjay Singh Rawat +# - initial API and implementation +# + +# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification#cpuhotplug_09 + +source ../include/functions.sh +STRESS_COUNT=200 + +cpuhotplug_stress() { + local cpu=$1 + local dirpath=$CPU_PATH/$1 + local state= + local start= + local end= + shift 1 + + if [ "$cpu" == "cpu0" ]; then + # skipping main cpu + return 0 + fi + + echo "running hotplug stress on cpu :" $cpu + start=$(echo $(awk '{print $1}' /proc/uptime)) + + for i in $(seq 1 $STRESS_COUNT); + do + set_offline $cpu + state=$(get_online $cpu) + if [ $state -ne 0 ]; then + echo "fail: cpu offline failed at " $i + return 1 + fi + + set_online $cpu + state=$(get_online $cpu) + if [ $state -ne 1 ]; then + echo "fail: cpu online failed at " $i + return 1 + fi + done + + end=$(echo $(awk '{print $1}' /proc/uptime)) + echo "pass: cpu hotplug in/out count =" $i "duration =" $(echo "$end-$start" | bc) "seconds" + return 0 +} + +for_each_cpu cpuhotplug_stress +test_status_show diff --git a/cpuhotplug/cpuhotplug_09.txt b/cpuhotplug/cpuhotplug_09.txt new file mode 100644 index 0000000..5b0f8ac --- /dev/null +++ b/cpuhotplug/cpuhotplug_09.txt @@ -0,0 +1 @@ +test to stress cpu hotplug feature