From patchwork Tue Nov 19 06:51:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuansheng Liu X-Patchwork-Id: 11250931 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FCD6138C for ; Tue, 19 Nov 2019 06:51:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 772A8222D1 for ; Tue, 19 Nov 2019 06:51:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 772A8222D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 266296E09C; Tue, 19 Nov 2019 06:51:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 821976E02F; Tue, 19 Nov 2019 06:51:39 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2019 22:51:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,322,1569308400"; d="scan'208";a="204427239" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga007.fm.intel.com with ESMTP; 18 Nov 2019 22:51:38 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 18 Nov 2019 22:51:38 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 18 Nov 2019 22:51:37 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.63]) with mapi id 14.03.0439.000; Tue, 19 Nov 2019 14:51:35 +0800 From: "Liu, Chuansheng" To: "intel-gfx@lists.freedesktop.org" Thread-Topic: [Intel-gfx] [PATCH i-g-t] i915/pm_rps: install SIGTERM handler for loader_helper Thread-Index: AdWepZ2GuR0vNPXyR0CwhamzFV/Cxw== Date: Tue, 19 Nov 2019 06:51:35 +0000 Message-ID: <27240C0AC20F114CBF8149A2696CBE4A615D54E9@SHSMSX101.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjkwMWYyMmMtMzgyZC00ZjI5LWEzNzUtN2E3OWE1ZjM3OTk4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaG9jMzlBdUtkUmxLS253XC82bEhZWEpoaWhYRTlVOGZndllYeStWdlp4OXhmRU41R3kzcHl2SGxZTmlMSEozenkifQ== dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] i915/pm_rps: install SIGTERM handler for loader_helper 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: "igt-dev@lists.freedesktop.org" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The issue we hit is the GPU keeps very high load after running the subtest min-max-config-loaded. Some background of the issue: Currently the rps is not fully enabled yet on TGL, and running the subtest min-max-config-loaded will hit below assertion: == (i915_pm_rps:1261) CRITICAL: Test assertion failure function loaded_check, file ../tests/i915/i915_pm_rps.c:505: (i915_pm_rps:1261) CRITICAL: Failed assertion: freqs[MAX] <= freqs[CUR] (i915_pm_rps:1261) CRITICAL: Last errno: 2, No such file or directory == with igt stress test, we find the GT keeps busy after running this subtest, it is due to the igt_spin_end() is not called randomly. The root cause analysis is: When the main process i915_pm_rps for running the subtest min-max-config-loaded hits the assertion, the main process will try to send signal SIGTERM to the child process loader_helper which is created by main process for starting GT load, then the main process itself will exit. The SIGTERM handler for loader_helper is the default one, which will cause the loader_helper exits directly. That is unsafe, we always expect the igt_spin_end() is called before loader_helper process exits, which is used to stop the load of GT. Furthermore, in normal scenario, before main process exits, it will send SIGUSR1 to child process for stopping GT loading in safe way. So here we install the proper handler for signal SIGTERM in the similar way. Without this patch, the GT may keep busy after running this subtest. Enabling rps should be tracked on the other side. Signed-off-by: Chuansheng Liu --- tests/i915/i915_pm_rps.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c index ef627c0b..8c71c1a1 100644 --- a/tests/i915/i915_pm_rps.c +++ b/tests/i915/i915_pm_rps.c @@ -252,6 +252,7 @@ static void load_helper_run(enum load load) signal(SIGUSR1, load_helper_signal_handler); signal(SIGUSR2, load_helper_signal_handler); + signal(SIGTERM, load_helper_signal_handler); igt_debug("Applying %s load...\n", lh.load ? "high" : "low");