From patchwork Mon Dec 11 12:18:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 176653 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7001793vqy; Mon, 11 Dec 2023 04:19:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMSaMuT3F/H14oboz6WPR5q2qZbZhhqhgCndAYU9NS+vtRt+OzgnaBm/jUkfz8Nf/7lE64 X-Received: by 2002:a17:902:e545:b0:1d0:7051:d316 with SMTP id n5-20020a170902e54500b001d07051d316mr2128135plf.102.1702297174733; Mon, 11 Dec 2023 04:19:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702297174; cv=none; d=google.com; s=arc-20160816; b=DCOkZFs2DUDJjyiq8Gn9COCi2gel8Cd9Cnsnn32q/+eTfjCnfHEs6E8/Euw9Yf6941 NZgVjBVNSlsG7td5aJSTpPWpAyrGKSEQOH6C3k6f4B+KaEqDmFJLYD6fTeKGh5Z1rVfA XC9P7SR+EcDTHX8BnPZPMavT5DrBPtaSNqzWZw1Y5AFzSPkN5pziWTBdLWzLb/itzXez CcCs2dGG+jWhivhh20KC767nEDwEJ72YZnqYqAio9ZwW51OFxTdY6N9WQYbWIXoqhQfl afjXTwAwCmRRY7i2teaQ00FMtJbHy7uqN8EjxMdwWY/4SmhFXOxJiv0v7Oj6n3sCzLyY EnZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Gk7GIXriunfwvTXhUUlAVTozahWyOFGVI5h5+ze+rw4=; fh=gPQ6jqLSfsDb5bE3yrtO+AlT5R4d75RXkjC5xckz7Dk=; b=L4CfTzlM+y1YRugjvs6MAsTqN1WJJdp7yFT0JdHUXsG8LuObH5RKrtrV5XH2fGiYZG xwefxC6dttpUYNgnwZJDiC7YeAecBXXEsVoIgc8QoSgoMArTbmCJytIDKz4+NL0diBv0 6GBcd2ssXWDv8dfqL3qwrrHMk/1sptLWxA22F//cQo/NvAA8lIdxM0FI8EXikZAyBTTU sxQzatAmWVuZUwDuDzGI+irN/MTKqJ0r6ElOXxVOmjXv6B2BsErG4RTE3bzRRZ8IJv3G HIgOXDLHbomMZPb0tCL3rtPaoxYqxE4700t7nJ1dxopWH04izL3IBNi/E0PE2NxPFkdV eXSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=I8dldixL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p10-20020a170902eaca00b001cc2f9d6a66si5911842pld.514.2023.12.11.04.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 04:19:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=I8dldixL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 434D3805FBAA; Mon, 11 Dec 2023 04:19:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234943AbjLKMTI (ORCPT + 99 others); Mon, 11 Dec 2023 07:19:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234895AbjLKMTD (ORCPT ); Mon, 11 Dec 2023 07:19:03 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79799D5; Mon, 11 Dec 2023 04:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702297150; x=1733833150; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4CfsvVmXuEt7o9BsBWAlVT1iOHdDJykjEbaX1Jbwtjg=; b=I8dldixLKtBSGGTx2XATdQfnAav5qFr7YZIULN7gM+mPJd0dKEOnvlbB wYsWhsURviFP6sos54Q7syhHmjxUgPB23s9XiS3FxOyGxUWzHHi+zBgrs yUSKcB8ybmdw+A12qVfaXlsO36Le4GnZ2AOfMJ+qSUbo2TLD87xshhOOD cx1zjXNMf3kp92vvMybOGGQT7zdK4Ek6xpBEkIYGzAGmpNiLHFBdqk1+m jzsKMBMr2KCouGBHGAlUcFjbOqayhGNkQKz3ChCKj5HwXk24pc2BjHvce mgmd6qmRXQc+6hJkXe+7CGyf+b1dn18jJv7OkivNkRLy2jmjh7NE1CVkA Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10920"; a="1757811" X-IronPort-AV: E=Sophos;i="6.04,267,1695711600"; d="scan'208";a="1757811" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 04:19:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10920"; a="1104461042" X-IronPort-AV: E=Sophos;i="6.04,267,1695711600"; d="scan'208";a="1104461042" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.246.50.188]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 04:19:04 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Reinette Chatre , Shuah Khan , Shaopeng Tan , =?utf-8?q?Maciej_Wiecz=C3=B3r-R?= =?utf-8?q?etman?= , Fenghua Yu Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 03/29] selftests/resctrl: Don't use ctrlc_handler() outside signal handling Date: Mon, 11 Dec 2023 14:18:00 +0200 Message-Id: <20231211121826.14392-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231211121826.14392-1-ilpo.jarvinen@linux.intel.com> References: <20231211121826.14392-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 11 Dec 2023 04:19:31 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784987962216023765 X-GMAIL-MSGID: 1784987962216023765 perf_event_open_llc_miss() calls ctrlc_handler() to cleanup if perf_event_open() returns an error. Those cleanups, however, are not the responsibility of perf_event_open_llc_miss() and it thus interferes unnecessarily with the usual cleanup pattern. Worse yet, ctrlc_handler() calls exit() in the end preventing the ordinary cleanup done in the calling function from executing. ctrlc_handler() should only be used as a signal handler, not during normal error handling. Remove call to ctrlc_handler() from perf_event_open_llc_miss(). As unmounting resctrlfs and test cleanup are already handled properly by error rollbacks in the calling functions, no other changes are necessary. Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- v3: - Corrected typo in the changelog --- tools/testing/selftests/resctrl/cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c index 1fa4b86e1459..6d60a2f1b3aa 100644 --- a/tools/testing/selftests/resctrl/cache.c +++ b/tools/testing/selftests/resctrl/cache.c @@ -41,7 +41,6 @@ static int perf_event_open_llc_miss(pid_t pid, int cpu_no) PERF_FLAG_FD_CLOEXEC); if (fd_lm == -1) { ksft_perror("Error opening leader"); - ctrlc_handler(0, NULL, NULL); return -1; }