Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp569215pxb; Thu, 21 Oct 2021 05:24:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTerGxgD7tshoOsnqEc3xCIkfePFG76HyUSPwg7mfW6ZygZCwr8GZqK7QOObaFzEEHieT8 X-Received: by 2002:a05:6a00:887:b0:474:1f41:2293 with SMTP id q7-20020a056a00088700b004741f412293mr1495186pfj.44.1634819076295; Thu, 21 Oct 2021 05:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634819076; cv=none; d=google.com; s=arc-20160816; b=W2N91TsuvJCnF58Dq0NYQpPhkVzrlMdYL0Br2+REcxW1QbJMMWZ2KIwSPd7Zu6oIJD JSpumQz2PtZPfh2X1bNs0h9CQYbmVXiue8F2oqjZ09goRaNUIy0yEsBu2aHEPLnhquxg SYLjBSSYh6P+ppEPb1/GmzMjySXdyqtVQQDfJiKDcQHsEdytI7wH8xjscPaBukXQLxNa xUe/VBJlPjA6vIY5/V0uvLIDAmFfIOzmtL5ch79skY6gIlvC+0nr49JrnuclyKvMRZVJ LXJQWZrlm9l0nCselsgSndgaBy+RLVNroG7LYoxKRxiBRq87EbJatUo4PIhFKhGXmhTD wSFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=3h0s/Q4jO7CyjJ9vQgvE5C6x7tYfUNUnkTzGLorSCd8=; b=jvooRenp0GB8+r622stigdWqUnoPO+ATvI29HeYJGxGh1AJ/2LQlpuZtkI2kAalW9M fRmI6gjb9IZptX07aaO+G1p7VqXDk6C7GDIP08NbxWxCycGiZ3++ubzr1y9qVgciuxhj 1ONOlm9vSiSKQ7WNe31UATbHs3j/QL9HykTpMuXFy/o4LsTejklMqa3P3fME9kEhNi/l eSy0Jkop1x989K/SI1GG8WJ+cFjU6aQU2wi0AesGz7vXXmsKQeccjCegMn2pq8Di5xfB Ik6FctezOavs8H8RkqM69NV+Qru7q833oRE8zDNY7v+ukZFogGo1L230Sw1dhE46ERi+ hTjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=AzlvgaLe; 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 p15si9555365pfh.253.2021.10.21.05.24.23; Thu, 21 Oct 2021 05:24:36 -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=AzlvgaLe; 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 S231547AbhJUMZZ (ORCPT + 99 others); Thu, 21 Oct 2021 08:25:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:61386 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231452AbhJUMZY (ORCPT ); Thu, 21 Oct 2021 08:25:24 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19LBfAQj009745; Thu, 21 Oct 2021 08:22:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=pp1; bh=3h0s/Q4jO7CyjJ9vQgvE5C6x7tYfUNUnkTzGLorSCd8=; b=AzlvgaLe7tHFHsRy5fiLm60ZOwmqPc9Pe1tBUbbmo+JwYxV5stmE4j7al/qv5qBlgoh1 JVm8OM+OTu2qFjgUERk2F+GGlyCoqgTgWj1FKnwHuCnYNDUMUt8DTGdLbMoqE3X/mGJJ kI58s9Pp53DuleSjlHDUBMXOR7c3BdtqLCeaQS4fscIPWytWsjy7H79kkAr5Ds79yIgQ sTTlhDnVZRDC7XXF8V6lnT6BL5SGUWH3Ct1xrq2UDG1Ti2ZhixkmZaPKm4stXceMZZKz 5O4VD7CkSYqabk35SWrs1eojs36DFk61YrEXavYq8WNjJy5Cljre8kh5jhqIU/pCzD6b bg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bty9ekjk4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Oct 2021 08:22:58 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 19LAURXh016288; Thu, 21 Oct 2021 08:22:58 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bty9ekjjd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Oct 2021 08:22:58 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19LCDfLs026944; Thu, 21 Oct 2021 12:22:55 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04fra.de.ibm.com with ESMTP id 3bqpcc3qa7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Oct 2021 12:22:55 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19LCGxaL53346744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Oct 2021 12:16:59 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EB366A4066; Thu, 21 Oct 2021 12:22:52 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2F37AA4065; Thu, 21 Oct 2021 12:22:51 +0000 (GMT) Received: from smtpclient.apple (unknown [9.79.186.49]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 21 Oct 2021 12:22:50 +0000 (GMT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [V2] perf/core: Avoid calling perf_mux_hrtimer_restart multiple times when scheduling event groups From: Athira Rajeev In-Reply-To: Date: Thu, 21 Oct 2021 17:52:10 +0530 Cc: Song Liu , Arnaldo Carvalho de Melo , Jiri Olsa , "linux-kernel@vger.kernel.org" , "maddy@linux.vnet.ibm.com" , "kjain@linux.ibm.com" , "mingo@redhat.com" , "eranian@google.com" Content-Transfer-Encoding: quoted-printable Message-Id: References: <20211015070403.4809-1-atrajeev@linux.vnet.ibm.com> <6E561141-B584-4DB8-A33E-BCD3FF572FA4@fb.com> To: Peter Zijlstra X-Mailer: Apple Mail (2.3654.120.0.1.13) X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0Ngq8a3GaGe_pwSnNR8us3AHgeIu2Ih9 X-Proofpoint-GUID: jTnuwRJajPBaIRpRSjCg_tnejEk1sbkw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-21_02,2021-10-21_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 malwarescore=0 spamscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 clxscore=1015 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110210064 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 18-Oct-2021, at 4:37 PM, Peter Zijlstra = wrote: >=20 > On Sat, Oct 16, 2021 at 01:08:04AM +0000, Song Liu wrote: >>=20 >>=20 >>> On Oct 15, 2021, at 12:04 AM, Athira Rajeev = wrote: >>>=20 >>> Perf uses multiplexing if there are more events to be scheduled than = the >>> available counters. With multiplexing, event groups will be rotated = at >>> specified interval of time which is set using "hrtimer". During = event >>> scheduling, if any of the event group fails to schedule, = multiplexing >>> gets enabled by setting "rotate_necessary" for that event context = and >>> starting the hrtimer by calling "perf_mux_hrtimer_restart". >>>=20 >>> Patch adds an optimisation to avoid calling = "perf_mux_hrtimer_restart" >>> multiple times if already rotate_necessary is set for that context. >>> Even though "perf_mux_hrtimer_restart" will just return if hrtimer = is >>> already active, this could avoid the overhead of calling this = function >>> multiple times if there are many event groups. Patch adds the check = to >>> avoid calling perf_mux_hrtimer_restart() for each event group on >>> every schedule. >>>=20 >>> Signed-off-by: Athira Rajeev >>=20 >> Acked-by: Song Liu >=20 > Thanks! Thanks for checking the patch. Hi Peterz, Should I resend this patch with Acked-by or can you consider pulling it, = if the patch looks fine to you. Thanks Athira.=