Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751753AbdIUSsa (ORCPT ); Thu, 21 Sep 2017 14:48:30 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39602 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751700AbdIUSs3 (ORCPT ); Thu, 21 Sep 2017 14:48:29 -0400 Subject: Re: [mainline][DLPAR][Oops] OF: ERROR: Bad of_node_put() on /cpus To: Michael Ellerman , Rob Herring , abdul Cc: sachinp , Paul Mackerras , linuxppc-dev , linux-kernel References: <1505473476.9665.13.camel@abdul.in.ibm.com> <87bmm5lhuu.fsf@concordia.ellerman.id.au> <3c15ac5c-c966-be45-1a6c-ba3fa1b9e439@linux.vnet.ibm.com> <87fubgcr2g.fsf@concordia.ellerman.id.au> From: Tyrel Datwyler Date: Thu, 21 Sep 2017 11:48:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <87fubgcr2g.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17092118-0028-0000-0000-000008648A2A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007774; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000231; SDB=6.00920350; UDB=6.00462457; IPR=6.00700573; BA=6.00005601; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017238; XFM=3.00000015; UTC=2017-09-21 18:48:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17092118-0029-0000-0000-000037A51505 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-21_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709210254 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1509 Lines: 37 On 09/21/2017 02:57 AM, Michael Ellerman wrote: > Tyrel Datwyler writes: >> On 09/20/2017 04:39 AM, Michael Ellerman wrote: >>> Rob Herring writes: >>> >>> Testing a fix, will report back. >> >> So, that patch slipped past me. Not only is the parent reference not ours to drop, but >> when I went and looked at dlpar_cpu_add() I also noticed that of_node_put() was done on >> the parent prior to the call to dlpar_attach_node(). With the addition of "parent" to the >> dlpar_attach_node() parameter list dlpar_cpu_add() needs to be fixed up to hold the >> "parent" reference until after dlpar_attach_node() returns. > > Yep. I wrote the same patch :) > > Rob asked me to test it, which I did, but /cpus starts out with an > elevated ref count, so you have to do ~30 (on my system) DLPAR removes > to hit the bug, which I didn't do. Yeah, there are a lot of things that grab references to /cpus. So, I had a good idea that I needed to loop a few times adding and removing multiple cpus to trigger the issue. Its also obvious when using those OF trace points I wrote a while back that refcount for /cpus is dropping off uncharacteristically in response to symmetrical adds/removes of cpus. I saw your note about getting that patchset resubmitted. I'll try and get that queued back up soon. -Tyrel > > I've updated my test script to do roughly $(nproc) x 10 DLPAR removes, > which is hopefully sufficient to catch these bugs in future. > > cheers >