From patchwork Mon Feb 19 13:40:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10227859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DEC7060392 for ; Mon, 19 Feb 2018 13:40:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE341288E0 for ; Mon, 19 Feb 2018 13:40:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C197E28911; Mon, 19 Feb 2018 13:40:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56DBD288E0 for ; Mon, 19 Feb 2018 13:40:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D506D6E17B; Mon, 19 Feb 2018 13:40:49 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC0AC89F0A for ; Mon, 19 Feb 2018 13:40:47 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id t74so15295745wme.3 for ; Mon, 19 Feb 2018 05:40:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=72boEmxPPvJ4obDGHcHJx7LPmtirUb8990YYkHJu0I0=; b=jcPFSzjvalULH1MJ7KW+vWyxIQAmnRE80WdSOyxIMi0Rd6wbOBBQJsEMjC+nOzaMHx 4idbEzx6JEHRBVGiaZEHWzBowjno1q6Q5J2yiT5YlHL+qnyWgmCiVToFB4cBF9SHQC0t fj3RlOPm8EqLjcwWfWH1qAmLvgyt2T0OAX3DE4D+7+OeE4ZHmdsCJLZ06GoHG2x4C4r4 3LXfw6094Of+rY13XF8mERu4T2Qlc/XK4/v3alusm7jKTGAlr3PbY7jlVCagPedxWkDK 4BVZasSdCmgdi/RX2ROdOC+qlUmg02JP990qySoC+CFZX/L7sQ39DWKdoXXvqcPVqe28 x9zg== 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; bh=72boEmxPPvJ4obDGHcHJx7LPmtirUb8990YYkHJu0I0=; b=l/FL47TeRVpN4Md2ebnGqmaAxag2U+GlhwFKXAwYO13oLe5PORjLB9ZPwtBMtF6KY3 ednrux2msxOh6y+UXiKChJgDj1jMyX4YcFL6SMJl9UoAWH6nUqXJnxgser05vTUaH7Wl xbmV+pWKPm0d+ZIPFXF6wD4zJwC1GFdFwr3Nif/fBrr2sqQ3EuN/TsckwL8mfXMfg9c/ c5B2D2SiVb/QM6XOUAJfRw+liwM2AYQQZVR/zOzZidyh27uAlLiU+LHQs+N2QuixfWoB CojpjQpXgUDBZkVFVMNzReb6lutE9t6MT8/T5/0WYGOFvYynDLs/FIPfzgT8WKT1zNe2 2wPQ== X-Gm-Message-State: APf1xPB4lXzWgyv/0Cw6H6HrBPoP7CNB7Wg2Clhc4VK+JuCPkivdPb/e XXl1ttQK3wtUt8xVD2r1Oehgvg== X-Google-Smtp-Source: AH8x227TJ/jySv9yzmnmbmmzgrmNre74EtwpPvUHccmlyulW6kJqY7Op4il3immH3GGPQD78ysv92w== X-Received: by 10.28.161.4 with SMTP id k4mr1434978wme.103.1519047646191; Mon, 19 Feb 2018 05:40:46 -0800 (PST) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id s13sm24781919wrf.11.2018.02.19.05.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 05:40:45 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Mon, 19 Feb 2018 13:40:37 +0000 Message-Id: <20180219134037.28708-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 Subject: [Intel-gfx] [PATCH i-g-t] tests/perf_pmu: Avoid off-lining all CPUs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Bail out from the cpu-hotplug test if we failed to bring a CPU back online. This still leaves the machine in a quite bad state, but at least it avoids hard hanging it. Signed-off-by: Tvrtko Ursulin Reviewed-by: Chris Wilson --- tests/perf_pmu.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c index 7fab73e22c2d..a334d3b5770e 100644 --- a/tests/perf_pmu.c +++ b/tests/perf_pmu.c @@ -965,6 +965,7 @@ static void cpu_hotplug(int gem_fd) int link[2]; int fd, ret; int cur = 0; + char buf; igt_require(cpu0_hotplug_support()); @@ -1012,7 +1013,15 @@ static void cpu_hotplug(int gem_fd) /* Offline followed by online a CPU. */ igt_assert_eq(write(cpufd, "0", 2), 2); usleep(1e6); - igt_assert_eq(write(cpufd, "1", 2), 2); + ret = write(cpufd, "1", 2); + if (ret < 0) { + /* + * Abort the test if we failed to bring a CPU + * back online. + */ + igt_assert_eq(write(link[1], "s", 1), 1); + break; + } close(cpufd); cpu++; @@ -1026,7 +1035,6 @@ static void cpu_hotplug(int gem_fd) * until the CPU core shuffler finishes one loop. */ for (;;) { - char buf; int ret2; usleep(500e3); @@ -1053,6 +1061,9 @@ static void cpu_hotplug(int gem_fd) close(fd); close(link[0]); + /* Skip if child signals a problem with bringing a CPU back online. */ + igt_skip_on(buf == 's'); + assert_within_epsilon(val, ts[1] - ts[0], tolerance); }