Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp199406pxa; Wed, 26 Aug 2020 22:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCNEy9H+ddT09/OXuHkxlvQS0T9OuKnU48Mb2eJYDd+ozZ8mbIHzUuErvquwfWCrmNjiOD X-Received: by 2002:a50:bac2:: with SMTP id x60mr18719751ede.210.1598507401898; Wed, 26 Aug 2020 22:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598507401; cv=none; d=google.com; s=arc-20160816; b=kiFQQysUr8IYosQqqU9lmhn7stv3p83N8WIg16uWshRLS3TjVe5XS0TWrk0g7MPrLW UokXW82YZF/FUMXLyMz8DLBDiKHskA8aoVuRao4KuooTUdkf9VkJVoUfLDO3d23dDQ5f kIavugupzInyPLLJOrgnKR9t6l4ro2LzsPh+nT8n+3ZrOF/6aSBBpZwVbWZTuNY9Jo3N FaCEUbrCqS92IpQO/KGKvgl5Gl0MR/5xqJnShkB/5+xDCFmG2IEw/pKh+CnVdyZXw5bN VAGG8+6V1n0DzBhRZvFwnWSv7ZI9mtKiqZM5Tyt48+ZtK6ibTEDare8MBAvwQTI2Tg5y nGSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=zSIWCgv1AFSTEWsdYYA2McSDyTkrvCd17IJDAQrUJbw=; b=CldaZnce0JN5kByWZzM7T0zcpbz3mvvYFpwrRaHtPVU2xM306ME6VllTME+ZcedvXo QYeI1w4GBf4Kf9a0FzXldSWNPrnY9gvBl/fMwEgw85OeURM+skk9BzB8bGi1xVIZyElL +TZmP7bvOKcxxZVnyzEo50hibC1HGtAd6zJZEM8tpfHZY3L14/cqkPpI7iCVn/GcdS3l uMX5n8eDC+bfUsoEDoIA5kXw3XHBsW2R9eA74S+eM5w+wlgK8PWFwpNs6XF+yJiNYxYd cOMNoy1qKbYsOknlOhA8KzFc10KvP1U6TooLUNIHELJbi56HJhHwPwFnGPvNUgFnd+9Z v5uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mGpQuaLH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si782428edt.406.2020.08.26.22.49.39; Wed, 26 Aug 2020 22:50:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mGpQuaLH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbgH0FsQ (ORCPT + 99 others); Thu, 27 Aug 2020 01:48:16 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:4620 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726093AbgH0FsQ (ORCPT ); Thu, 27 Aug 2020 01:48:16 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07R5Wi3g048787; Thu, 27 Aug 2020 01:47:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : reply-to : references : mime-version : content-type : in-reply-to; s=pp1; bh=zSIWCgv1AFSTEWsdYYA2McSDyTkrvCd17IJDAQrUJbw=; b=mGpQuaLHPjFChdnevl1ny1zznoXkwqTQSUc16gqFAZIkB4cjQnbgETgIvhNhO3lEMhX6 2tefzQ3d1kLHWJ1xNE18cOcVY8qxmGJCSNbp83oVdbjGCcbQ0LhZuGVHJphpi8dbmloT V3ohDTLc3c+Rimr78EZWVVGiJcNbi8mWI6mqo0WZ+L/ACeA1DBodOnZ3o0Zdg5cL2lVl wbvIaVrVDzn6chuk8e/DPL9DVwChPLShrnJAz/X/qKMORg42V92jGnpvgkYqcYcfTB8S jDe5PP+/b5zsZQzBV4j0w4rGbvY16qlST6qCmkMRQlQQJ0VpUfGxR3tfUrqNHrfbR7cT JQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3366ax0ws0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Aug 2020 01:47:50 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07R5X7MR050140; Thu, 27 Aug 2020 01:47:50 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3366ax0wr8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Aug 2020 01:47:49 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07R5kpMG027213; Thu, 27 Aug 2020 05:47:48 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06ams.nl.ibm.com with ESMTP id 332uk6daq9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Aug 2020 05:47:48 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07R5ljgY61735298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Aug 2020 05:47:45 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 438215204F; Thu, 27 Aug 2020 05:47:45 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by d06av21.portsmouth.uk.ibm.com (Postfix) with SMTP id 0EF8152050; Thu, 27 Aug 2020 05:47:42 +0000 (GMT) Date: Thu, 27 Aug 2020 11:17:42 +0530 From: Srikar Dronamraju To: Kajol Jain Cc: acme@kernel.org, peterz@infradead.org, jolsa@redhat.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, maddy@linux.ibm.com, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, daniel@iogearbox.net, brho@google.com Subject: Re: [RFC v2] perf/core: Fixes hung issue on perf stat command during cpu hotplug Message-ID: <20200827054742.GA5431@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20200826145411.489169-1-kjain@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20200826145411.489169-1-kjain@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-27_01:2020-08-26,2020-08-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 phishscore=0 clxscore=1011 malwarescore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008270041 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kajol Jain [2020-08-26 20:24:11]: > Commit 2ed6edd33a21 ("perf: Add cond_resched() to task_function_call()") > added assignment of ret value as -EAGAIN in case function > call to 'smp_call_function_single' fails. > For non-zero ret value, it did > 'ret = !ret ? data.ret : -EAGAIN;', which always > assign -EAGAIN to ret and make second if condition useless. > > In scenarios like when executing a perf stat with --per-thread option, and > if any of the monitoring cpu goes offline, the 'smp_call_function_single' > function could return -ENXIO, and with the above check, > task_function_call hung and increases CPU > usage (because of repeated 'smp_call_function_single()') > > Recration scenario: > # perf stat -a --per-thread && (offline a CPU ) > > Patch here removes the tertiary condition added as part of that > commit and added a check for NULL and -EAGAIN. > > Fixes: 2ed6edd33a21("perf: Add cond_resched() to task_function_call()") > Signed-off-by: Kajol Jain > Reported-by: Srikar Dronamraju Tested-by: Srikar Dronamraju -- Thanks and Regards Srikar Dronamraju