Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp884070imm; Wed, 6 Jun 2018 07:22:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJISeueUnHuRh16NWwNkcUA1yEigYt/mUG7TAbDNiHeHx4VzilGK2VAoLkprQi4bm+Cod3Y X-Received: by 2002:a65:5348:: with SMTP id w8-v6mr2781094pgr.247.1528294924953; Wed, 06 Jun 2018 07:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528294924; cv=none; d=google.com; s=arc-20160816; b=qdIWl2EVAiwO/Uz3zkULUqjLiwRXpNk/zO1cz8yusC1l7tCBDefrMdYxfr/DB4LwCh HUZxWr/2hWvrYwXnWIXbzyplN4JMjlM1/rEkpciStZ1JaVfO/ANSffkaFDmVROv3UF7m sV0OG2PRqGdPOVEfg2VxaUH4glC8AFPE9rPtCJpKL5gbTtbx6jnJ10UzJBsrktA6Nvzh ZU6cvnacfINr+NmGtp9khvcX97XGwv2ubu3MtPeBHD6hxs2BLcNH995VgG7oENDdaOwE JRPAbQsTA5Q1jZMG30JIBtKbcxo8VSF++BFzIugvugeAByPFEw0N3JAgaQk+RWW1bqkl uUtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:arc-authentication-results; bh=L9t9LQD2d2dzhoDozLBOxbsNWt70+ggfYBHGfAUuOB8=; b=bRriLlQ2L7axwN29KDqrY8SMTpsZI5207DT6tnrs+mYvv08BF9HYdeOAMh3hsf1n2n DbcUsL2GtrL8I2BkJnBNWRp6MSgEY2deYHwe6U3EjOiqGjq5MvCzdz0ABo/9gkrxEvv+ RJu2DAhOpEHGLtX/G9krdj8zZziObN8B/pUV7USbwtDKwIR+34j1HHg1ZSt9VYksY2jn 9EuPcQ1GmDbIgzCpPkLM/j/+u+1VpMdcWE4TAWYEFXXq2+UFRd1pt4hFtOdOxa5tTPoW xOfFFlbCvxkdeB+aLmxF50HZvB5RAyr+z9QmoryYPL6NA6V6I7Yt9klpKOkuq+H9jWq6 hqnw== ARC-Authentication-Results: i=1; mx.google.com; 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 e5-v6si17675240pgp.105.2018.06.06.07.21.48; Wed, 06 Jun 2018 07:22:04 -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; 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 S1752177AbeFFOVR (ORCPT + 99 others); Wed, 6 Jun 2018 10:21:17 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:59567 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbeFFOVM (ORCPT ); Wed, 6 Jun 2018 10:21:12 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4119ny6dq0z9ttgG; Wed, 6 Jun 2018 16:21:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id XqqZ4YTOmc9S; Wed, 6 Jun 2018 16:21:10 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4119ny6B92z9ttCS; Wed, 6 Jun 2018 16:21:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A1DE98B935; Wed, 6 Jun 2018 16:21:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id qD3Tis4A0yS4; Wed, 6 Jun 2018 16:21:10 +0200 (CEST) Received: from po14934vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7B2B08B934; Wed, 6 Jun 2018 16:21:10 +0200 (CEST) Received: by po14934vm.idsi0.si.c-s.fr (Postfix, from userid 0) id E005E6F822; Wed, 6 Jun 2018 14:21:10 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 2/2] powerpc/time: no steal_time when CONFIG_PPC_SPLPAR is not selected To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Frederic Weisbecker , Nicholas Piggin Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 6 Jun 2018 14:21:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_PPC_SPLPAR is not selected, steal_time will always be NUL, so accounting it is pointless Signed-off-by: Christophe Leroy --- v4: removed the check in vtime_account_system(), the compiler removes the code regardless. v3: new arch/powerpc/kernel/time.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 7a9f4e2f22c8..eda78b1ed7d3 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -412,9 +412,6 @@ void vtime_flush(struct task_struct *tsk) if (acct->gtime) account_guest_time(tsk, cputime_to_nsecs(acct->gtime)); - if (acct->steal_time) - account_steal_time(cputime_to_nsecs(acct->steal_time)); - if (acct->idle_time) account_idle_time(cputime_to_nsecs(acct->idle_time)); @@ -431,13 +428,17 @@ void vtime_flush(struct task_struct *tsk) acct->utime = 0; acct->gtime = 0; - acct->steal_time = 0; acct->idle_time = 0; acct->stime = 0; acct->hardirq_time = 0; acct->softirq_time = 0; vtime_flush_scaled(tsk, acct); + + if (IS_ENABLED(CONFIG_PPC_SPLPAR) && acct->steal_time) { + account_steal_time(cputime_to_nsecs(acct->steal_time)); + acct->steal_time = 0; + } } #else /* ! CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ -- 2.13.3