[{"id":1772401,"web_url":"http://patchwork.ozlabs.org/comment/1772401/","msgid":"<87r2v0d5zi.fsf@concordia.ellerman.id.au>","date":"2017-09-21T04:34:57","subject":"Re: [PATCH] powerpc/perf: Fix for core/nest imc call trace on\n\tcpuhotplug","submitter":{"id":46580,"url":"http://patchwork.ozlabs.org/api/people/46580/","name":"Michael Ellerman","email":"mpe@ellerman.id.au"},"content":"Anju T Sudhakar <anju@linux.vnet.ibm.com> writes:\n\n> Nest/core pmu units are enabled only when it is used. A reference count is\n> maintained for the events which uses the nest/core pmu units. Currently in\n> *_imc_counters_release function a WARN() is used for notification of any\n> underflow of ref count. Replace WARN() with a pr_info since it is an overkill.\n\nAs discussed elsewhere this is not the right solution.\n\nIf it's OK for the reference count to be negative, then we shouldn't\nprint anything when it is.\n\nBut I don't understand how it can be OK for the refcount to be negative.\nThat means someone has a negative number of references to something?\n\ncheers","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyP281kMrz9s7v\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 14:36:16 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xyP275MTXzDrKC\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 14:36:15 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xyP0d6NG4zDqZv\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 21 Sep 2017 14:34:57 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xyP0d5Wt6z9s7v;\n\tThu, 21 Sep 2017 14:34:57 +1000 (AEST)"],"From":"Michael Ellerman <mpe@ellerman.id.au>","To":"Anju T Sudhakar <anju@linux.vnet.ibm.com>","Subject":"Re: [PATCH] powerpc/perf: Fix for core/nest imc call trace on\n\tcpuhotplug","In-Reply-To":"<1505151134-26128-1-git-send-email-anju@linux.vnet.ibm.com>","References":"<1505151134-26128-1-git-send-email-anju@linux.vnet.ibm.com>","User-Agent":"Notmuch/0.21 (https://notmuchmail.org)","Date":"Thu, 21 Sep 2017 14:34:57 +1000","Message-ID":"<87r2v0d5zi.fsf@concordia.ellerman.id.au>","MIME-Version":"1.0","Content-Type":"text/plain","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"hemant@linux.vnet.ibm.com, maddy@linux.vnet.ibm.com,\n\tlinuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,\n\tanju@linux.vnet.ibm.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1774671,"web_url":"http://patchwork.ozlabs.org/comment/1774671/","msgid":"<28e408f0-d773-6d91-9282-92aa65ef043e@linux.vnet.ibm.com>","date":"2017-09-25T11:52:01","subject":"Re: [PATCH] powerpc/perf: Fix for core/nest imc call trace on\n\tcpuhotplug","submitter":{"id":67491,"url":"http://patchwork.ozlabs.org/api/people/67491/","name":"Anju T Sudhakar","email":"anju@linux.vnet.ibm.com"},"content":"Hi mpe,\n\n\nOn Thursday 21 September 2017 10:04 AM, Michael Ellerman wrote:\n> Anju T Sudhakar <anju@linux.vnet.ibm.com> writes:\n>\n>> Nest/core pmu units are enabled only when it is used. A reference count is\n>> maintained for the events which uses the nest/core pmu units. Currently in\n>> *_imc_counters_release function a WARN() is used for notification of any\n>> underflow of ref count. Replace WARN() with a pr_info since it is an overkill.\n> As discussed elsewhere this is not the right solution.\n>\n> If it's OK for the reference count to be negative, then we shouldn't\n> print anything when it is.\n>\n> But I don't understand how it can be OK for the refcount to be negative.\n> That means someone has a negative number of references to something?\n>\n> cheers\n>\n\nScenario where this happens is in a stress test where perf session is \nstarted, followed by offlining of all cpus in a given core. And finally \nterminate the perf session.\n\nSo, in cpuhotplug offline path(ppc_core_imc_cpu_offline), function set \nthe ref->count to zero, if the current cpu which is about to offline is \nthe last cpu in a given core and make an OPAL call to disable the engine \nin that core.\nAnd on perf session termination, perf->destory \n(core_imc_counters_release) will first decrement the ref->count for this \ncore and based on the ref->count value an opal call is made to disable \nthe core-imc engine.\n\nNow, since cpuhotplug path already clears the ref->count for core and \ndisabled the engine, perf->destroy() decrementing again at event \ntermination make it negative which in turn fires the WARN_ON.\n\nSo we do prefer to remove the message as this wont happen in normal \noperation and the core counters are working as expected.\nI will send out a patch by removing the message asap.\n\n\nThanks,\nAnju","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y12Xg2Zp5z9sRV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 25 Sep 2017 21:53:23 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y12Xg0ng6zDsNl\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 25 Sep 2017 21:53:23 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3y12WH5tTKzDr4N\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tMon, 25 Sep 2017 21:52:11 +1000 (AEST)","from pps.filterd (m0098404.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8PBokT3118198\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 25 Sep 2017 07:52:09 -0400","from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d70ewknr3-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 25 Sep 2017 07:52:09 -0400","from localhost\n\tby e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <anju@linux.vnet.ibm.com>;\n\tMon, 25 Sep 2017 05:52:08 -0600","from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17)\n\tby e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tMon, 25 Sep 2017 05:52:04 -0600","from b03ledav002.gho.boulder.ibm.com\n\t(b03ledav002.gho.boulder.ibm.com [9.17.130.233])\n\tby b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8PBq43v2425330; Mon, 25 Sep 2017 04:52:04 -0700","from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 6DD0D136046;\n\tMon, 25 Sep 2017 05:52:04 -0600 (MDT)","from [9.124.35.137] (unknown [9.124.35.137])\n\tby b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id\n\tCC845136044; Mon, 25 Sep 2017 05:52:02 -0600 (MDT)"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=anju@linux.vnet.ibm.com; receiver=<UNKNOWN>)","Subject":"Re: [PATCH] powerpc/perf: Fix for core/nest imc call trace on\n\tcpuhotplug","To":"Michael Ellerman <mpe@ellerman.id.au>","References":"<1505151134-26128-1-git-send-email-anju@linux.vnet.ibm.com>\n\t<87r2v0d5zi.fsf@concordia.ellerman.id.au>","From":"Anju T Sudhakar <anju@linux.vnet.ibm.com>","Date":"Mon, 25 Sep 2017 17:22:01 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<87r2v0d5zi.fsf@concordia.ellerman.id.au>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","X-TM-AS-GCONF":"00","x-cbid":"17092511-8235-0000-0000-00000C51A33D","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007789; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000231; SDB=6.00922123; UDB=6.00463449;\n\tIPR=6.00702266; \n\tBA=6.00005605; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017265;\n\tXFM=3.00000015; UTC=2017-09-25 11:52:06","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092511-8236-0000-0000-00003DC954CE","Message-Id":"<28e408f0-d773-6d91-9282-92aa65ef043e@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-25_04:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709250182","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"hemant@linux.vnet.ibm.com, maddy@linux.vnet.ibm.com,\n\tlinuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]