Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6752460ybe; Wed, 18 Sep 2019 08:28:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJ8qXZp7KdKN8cx5jqedlDUOnP/gb7rbo+evHuGOIdta0hmJHXDIfiJ7mYTu7blHXdYgPG X-Received: by 2002:aa7:c24c:: with SMTP id y12mr11162214edo.120.1568820526628; Wed, 18 Sep 2019 08:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568820526; cv=none; d=google.com; s=arc-20160816; b=IHXpAwhy4WiJXVmeMZqckeBeR2bM80Z+uS0SGFgqDm+1oF8pUMhZVmCq9FNcOsNw+7 KilpJGsOiTxi5T5XOopNyZLIjnOyiPQWTVxmyWtKu+GYltxOJSXCUiStMXIhGxYmlHfe R5lgHl+ZFhxvB3r3ytChYAnN0Yzv9laFwEoP3V3t+8wi2Em6uq7PMqKFJnYWqKYaruuY 88Vvo2HA6/xV3kfSaXqk+HIuHP0QPK9aKoN+0mPjYJnVmeOEGyHiozBFBLxO4oBSDuJx SMgPSoQFd0gqY6c4uqFVOSbaRC7yOH4gMVtkiSmV05FLIHGRYHZZ/OMPIrWgUOhdSNY0 liSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=MzqV8fiFea/jARO8vAvod9poLORYGzILD7f2SJzuDfY=; b=AJjP16KNjpxZ7jLrdmnziO9e5GsN+8gW8zXDoiETKS+V2rloq5ZMxmeaNfR/SJRDrm /80KqGlm7BfExScjIJQ7PE03j1pDO9P8MP4vBYuauxopLMxdxMjyL3JhRqUbmxc1b4Mw U1/2HytvvMAv7Ct5PO3Wa1754sxb+Jny++ClhQQj+scD1jJAe0y2lnJN6hKpxNiSzbaN Y3/+6gWbDVyVQozzt1NW/33fxjZOyS6BxUKSta6ijry5rQiXRTHvlvT8X3o64hmcJ3ch SvmaevcSIfu8sz/Z+nKPpPc3P11L51yT4GwW59bC0vygrbj4vunDgowatSOP1YzTvZEh Gygg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="Qvm2wNP/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si2774626ejj.132.2019.09.18.08.28.23; Wed, 18 Sep 2019 08:28:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="Qvm2wNP/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730141AbfIRLbk (ORCPT + 99 others); Wed, 18 Sep 2019 07:31:40 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:44771 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbfIRLbj (ORCPT ); Wed, 18 Sep 2019 07:31:39 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46YHqs1QHVz9s4Y; Wed, 18 Sep 2019 21:31:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1568806297; bh=bFi1/DiI56B9Yq5YZTtjn4LDQu+PhsudNKthRAcRdVg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Qvm2wNP/H00fKpCKhZS3NS0MN/rPbzBfBZQSPGN8K9S4W3FJdS01+gzK2YK+N9qhN ljTQ583mPYTrFq5CqrvKsTkjpgXXrmvytc80c0MbesAPr2B9piU0JMA+6VAAV1Kz98 5/N/lk1mBikm5lsOKRr+l95AlSlaMNFy36Fggu/n+0P+JFkV3x95G90NJZKfthIBDN gmHnwdz/d94fj6tm+H/eGUAclsPawFDyxQ/YwsBqtg3kKpMLAhgJWkn5b6wZxgB8He tm0QZgigj3JJpCrmV5JIKfSz3eO0hBiZTCkzSuO4vK31OARiOm5LjQwg8VWNCR1obk ZXitzcrQn1xhg== From: Michael Ellerman To: "Naveen N. Rao" , "Gautham R. Shenoy" , Nathan Lynch , Nicholas Piggin , Tyrel Datwyler Cc: "Aneesh Kumar K.V" , Kamalesh Babulal , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Vaidyanathan Srinivasan Subject: Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline In-Reply-To: <1568788924.kxcnnog4r7.naveen@linux.ibm.com> References: <1568284541-15169-1-git-send-email-ego@linux.vnet.ibm.com> <87r24ew5i0.fsf@mpe.ellerman.id.au> <1568788924.kxcnnog4r7.naveen@linux.ibm.com> Date: Wed, 18 Sep 2019 21:31:35 +1000 Message-ID: <877e65x2lk.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Naveen N. Rao" writes: > Michael Ellerman wrote: >> "Gautham R. Shenoy" writes: >>> From: "Gautham R. Shenoy" >>> >>> Currently on Pseries Linux Guests, the offlined CPU can be put to one >>> of the following two states: >>> - Long term processor cede (also called extended cede) >>> - Returned to the Hypervisor via RTAS "stop-self" call. >>> >>> This is controlled by the kernel boot parameter "cede_offline=on/off". >>> >>> By default the offlined CPUs enter extended cede. >> >> Since commit 3aa565f53c39 ("powerpc/pseries: Add hooks to put the CPU into an appropriate offline state") (Nov 2009) >> >> Which you wrote :) >> >> Why was that wrong? >> >>> The PHYP hypervisor considers CPUs in extended cede to be "active" >>> since the CPUs are still under the control fo the Linux Guests. Hence, when we change the >>> SMT modes by offlining the secondary CPUs, the PURR and the RWMR SPRs >>> will continue to count the values for offlined CPUs in extended cede >>> as if they are online. >>> >>> One of the expectations with PURR is that the for an interval of time, >>> the sum of the PURR increments across the online CPUs of a core should >>> equal the number of timebase ticks for that interval. >>> >>> This is currently not the case. >> >> But why does that matter? It's just some accounting stuff, does it >> actually break something meaningful? > > Yes, this broke lparstat at the very least (though its quite unfortunate > we took so long to notice). By "so long" you mean 10 years? Also I've never heard of lparstat, but I assume it's one of these tools that's meant to behave like the AIX equivalent? If it's been "broken" for 10 years and no one noticed, I'd argue the current behaviour is now "correct" and fixing it would actually be a breakage :) > With SMT disabled, and under load: > $ sudo lparstat 1 10 > > System Configuration > type=Shared mode=Uncapped smt=Off lcpu=2 mem=7759616 kB cpus=6 ent=1.00 > > %user %sys %wait %idle physc %entc lbusy vcsw phint > ----- ----- ----- ----- ----- ----- ----- ----- ----- > 100.00 0.00 0.00 0.00 1.10 110.00 100.00 128784460 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128784860 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128785260 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128785662 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128786062 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128786462 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128786862 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128787262 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128787664 0 > 100.00 0.00 0.00 0.00 1.07 107.00 100.00 128788064 0 What about that is wrong? > With cede_offline=off: > $ sudo lparstat 1 10 > > System Configuration > type=Shared mode=Uncapped smt=Off lcpu=2 mem=7759616 kB cpus=6 ent=1.00 > > %user %sys %wait %idle physc %entc lbusy vcsw phint > ----- ----- ----- ----- ----- ----- ----- ----- ----- > 100.00 0.00 0.00 0.00 1.94 194.00 100.00 128961588 0 > 100.00 0.00 0.00 0.00 1.91 191.00 100.00 128961988 0 > 100.00 0.00 0.00 0.00 inf inf 100.00 128962392 0 > 100.00 0.00 0.00 0.00 1.91 191.00 100.00 128962792 0 > 100.00 0.00 0.00 0.00 1.91 191.00 100.00 128963192 0 > 100.00 0.00 0.00 0.00 1.91 191.00 100.00 128963592 0 > 100.00 0.00 0.00 0.00 1.91 191.00 100.00 128963992 0 > 100.00 0.00 0.00 0.00 1.91 191.00 100.00 128964392 0 > 100.00 0.00 0.00 0.00 1.91 191.00 100.00 128964792 0 > 100.00 0.00 0.00 0.00 1.91 191.00 100.00 128965194 0 > > [The 'inf' values there show a different bug] > > Also, since we expose [S]PURR through sysfs, any tools that make use of > that directly are also affected due to this. But again if we've had the current behaviour for 10 years then arguably that's now the correct behaviour. cheers