Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1950435ima; Thu, 25 Oct 2018 07:28:00 -0700 (PDT) X-Google-Smtp-Source: AJdET5c70nF/kC+GqO8/UYq2QYOxNoARKLmAJsRgCo8/oYOSWUK7soK9C0G8ZKTFm+jUFmU+L8n1 X-Received: by 2002:a62:d405:: with SMTP id a5-v6mr1771713pfh.174.1540477680400; Thu, 25 Oct 2018 07:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477680; cv=none; d=google.com; s=arc-20160816; b=W0NvXEEfFLyRBDFcHMbd9cVzUsY0Haw59TiMva09bUQNOsfQEWLqmncD3czM1pvWDW 0TnGOSuYQUqdaJzAV3w9+YdPCZafgKRPtavv169N6cCqwJtgjfNluQbFSqVxe/9qWgqn MyrceN1au1Rem8+uT196scu0k4nd1/WdurKmUBE0a2BQeuLgCR2Bu0Ekw6jp79cQ6CXP NUcJ0F7awIf0KbnBy762GD6+EH/joVYsyNVtrA/hKzeYFBW9+d0n+cCTgVO+txOFIbHo h4a3LBeLiJ2oOF0Rq17G4R9Rsg7ivNBxr1BWfMbAegZAg6kR0YR9OJqJHrivPaAIVpxZ NeRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=KaPOkDg0YpQrjU/ZAwotxqAhAXmcVr88PCvSt/kA5J4=; b=DKZq8NkOwrpamsp55SGJureMUQ9oXFt6C2PaXytELb0NNmk6fGUEdr4j3vwfKNQoxj jb925Nyife+58w3q68pfc6yJpT4K43EYpjMu8vHQmwT9kByHpNZTGzWw1ntvDPhI+VhL RGQSNXN0yTToMO+ZE6eUhoLvJTS91ySUOcBGSTNtAV4IJKM6s9qjXmlCGny6kiPzAvhw //Ser9P3FgeH9W14k26cQSQ3XcFCkuYRCExK12OlqoDwP6q7xmDHjawvsLNpXC3T+jDb X7We34QCI2bISsDhrbGz07vPtlfMkn+LEP5BCd0le0Hh1QLPoi2R1cNNXv1pORuSCZiT 6Qbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="f/6XjPm5"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8-v6si8318110pgh.45.2018.10.25.07.27.18; Thu, 25 Oct 2018 07:28:00 -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=@kernel.org header.s=default header.b="f/6XjPm5"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731101AbeJYWxd (ORCPT + 99 others); Thu, 25 Oct 2018 18:53:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:36086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728023AbeJYWxb (ORCPT ); Thu, 25 Oct 2018 18:53:31 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01BC32086D; Thu, 25 Oct 2018 14:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540477233; bh=soP5hmq3U1fCx5SO3r/oZZHGL0haFi1J/pd8rtJys6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f/6XjPm5fF0xDnWWKJbKE7unv5qrzRFd6Ju0KEyKaH6x5vGhma57vVECG5mDJ2Yus pDBz2q50dVQMU2ry6VvkYuOQQNaxlQx3jZiRKRU/NGSTp26xoFs/EGqTJKSxEtgwOG ouu/s5zzE91HLcixRixyBD+IGiZGp3+ds6FzoEhg= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jisheng Zhang , len.brown@intel.com, Thomas Gleixner , Sasha Levin Subject: [PATCH AUTOSEL 3.18 65/98] x86/idle: Restore trace_cpu_idle to mwait_idle() calls Date: Thu, 25 Oct 2018 10:18:20 -0400 Message-Id: <20181025141853.214051-65-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141853.214051-1-sashal@kernel.org> References: <20181025141853.214051-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jisheng Zhang [ Upstream commit e43d0189ac02415fe4487f79fc35e8f147e9ea0d ] Commit b253149b843f ("sched/idle/x86: Restore mwait_idle() to fix boot hangs, to improve power savings and to improve performance") restores mwait_idle(), but the trace_cpu_idle related calls are missing. This causes powertop on my old desktop powered by Intel Core2 E6550 to report zero wakeups and zero events. Add them back to restore the proper behaviour. Fixes: b253149b843f ("sched/idle/x86: Restore mwait_idle() to ...") Signed-off-by: Jisheng Zhang Cc: Cc: stable@vger.kernel.org # 4.1 Link: http://lkml.kernel.org/r/1440046479-4262-1-git-send-email-jszhang@marvell.com Signed-off-by: Thomas Gleixner Signed-off-by: Sasha Levin --- arch/x86/kernel/process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index a388bb883128..54499d34cf55 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -430,6 +430,7 @@ static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c) static void mwait_idle(void) { if (!current_set_polling_and_test()) { + trace_cpu_idle_rcuidle(1, smp_processor_id()); if (this_cpu_has(X86_BUG_CLFLUSH_MONITOR)) { smp_mb(); /* quirk */ clflush((void *)¤t_thread_info()->flags); @@ -441,6 +442,7 @@ static void mwait_idle(void) __sti_mwait(0, 0); else local_irq_enable(); + trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); } else { local_irq_enable(); } -- 2.17.1