All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Frederic Weisbecker <fweisbec@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Rik van Riel <riel@redhat.com>,
	Stanislaw Gruszka <sgruszka@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	Wanpeng Li <wanpeng.li@hotmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Sasha Levin <alexander.levin@verizon.com>
Subject: [PATCH 4.9 40/87] sched/cputime, powerpc32: Fix stale scaled stime on context switch
Date: Mon, 13 Nov 2017 13:55:57 +0100	[thread overview]
Message-ID: <20171113125619.007448157@linuxfoundation.org> (raw)
In-Reply-To: <20171113125615.304035578@linuxfoundation.org>

4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Frederic Weisbecker <fweisbec@gmail.com>


[ Upstream commit 90d08ba2b9b4be4aeca6a5b5a4b09fbcde30194d ]

On context switch with powerpc32, the cputime is accumulated in the
thread_info struct. So the switching-in task must move forward its
start time snapshot to the current time in order to later compute the
delta spent in system mode.

This is what we do for the normal cputime by initializing the starttime
field to the value of the previous task's starttime which got freshly
updated.

But we are missing the update of the scaled cputime start time. As a
result we may be accounting too much scaled cputime later.

Fix this by initializing the scaled cputime the same way we do for
normal cputime.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Wanpeng Li <wanpeng.li@hotmail.com>
Link: http://lkml.kernel.org/r/1483636310-6557-2-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/powerpc/kernel/time.c |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -407,6 +407,7 @@ void arch_vtime_task_switch(struct task_
 	struct cpu_accounting_data *acct = get_accounting(current);
 
 	acct->starttime = get_accounting(prev)->starttime;
+	acct->startspurr = get_accounting(prev)->startspurr;
 	acct->system_time = 0;
 	acct->user_time = 0;
 }

  parent reply	other threads:[~2017-11-13 13:01 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 12:55 [PATCH 4.9 00/87] 4.9.62-stable review Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 02/87] video: fbdev: pmag-ba-fb: Remove bad `__init annotation Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 03/87] PCI: mvebu: Handle changes to the bridge windows while enabled Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 04/87] sched/core: Add missing update_rq_clock() call in sched_move_task() Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 05/87] xen/netback: set default upper limit of tx/rx queues to 8 Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 06/87] ARM: dts: imx53-qsb-common: fix FEC pinmux config Greg Kroah-Hartman
2017-11-16  4:09   ` Patrick Brünn
2017-11-16 13:35     ` Greg Kroah-Hartman
2017-11-16 13:35       ` Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 07/87] dt-bindings: clockgen: Add compatible string for LS1012A Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 08/87] EDAC, amd64: Add x86cpuid sanity check during init Greg Kroah-Hartman
2017-11-13 12:55   ` [4.9,08/87] " Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 09/87] PM / OPP: Error out on failing to add static OPPs for v1 bindings Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 10/87] clk: samsung: exynos5433: Add IDs for PHYCLK_MIPIDPHY0_* clocks Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 12/87] KVM: PPC: Book 3S: XICS: correct the real mode ICP rejecting counter Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 13/87] iommu/arm-smmu-v3: Clear prior settings when updating STEs Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 14/87] pinctrl: baytrail: Fix debugfs offset output Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 15/87] powerpc/corenet: explicitly disable the SDHC controller on kmcoge4 Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 16/87] cxl: Force psl data-cache flush during device shutdown Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 17/87] ARM: omap2plus_defconfig: Fix probe errors on UARTs 5 and 6 Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 18/87] arm64: dma-mapping: Only swizzle DMA ops for IOMMU_DOMAIN_DMA Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 19/87] crypto: vmx - disable preemption to enable vsx in aes_ctr.c Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 20/87] drm: mali-dp: fix Lx_CONTROL register fields clobber Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 21/87] iio: trigger: free trigger resource correctly Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 22/87] iio: pressure: ms5611: claim direct mode during oversampling changes Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 23/87] iio: magnetometer: mag3110: claim direct mode during raw writes Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 24/87] iio: proximity: sx9500: claim direct mode during raw proximity reads Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 25/87] dt-bindings: Add LEGO MINDSTORMS EV3 compatible specification Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 26/87] dt-bindings: Add vendor prefix for LEGO Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 28/87] serial: sh-sci: Fix register offsets for the IRDA serial port Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 29/87] libertas: fix improper return value Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 30/87] usb: hcd: initialize hcd->flags to 0 when rm hcd Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 31/87] netfilter: nft_meta: deal with PACKET_LOOPBACK in netdev family Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 33/87] rt2800usb: mark tx failure on timeout Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 34/87] apparmor: fix undefined reference to `aa_g_hash_policy Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 35/87] IPsec: do not ignore crypto err in ah4 input Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 36/87] EDAC, amd64: Save and return err code from probe_one_instance() Greg Kroah-Hartman
2017-11-13 12:55   ` [4.9,36/87] " Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 37/87] s390/topology: make "topology=off" parameter work Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 38/87] Input: mpr121 - handle multiple bits change of status register Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 39/87] Input: mpr121 - set missing event capability Greg Kroah-Hartman
2017-11-13 12:55 ` Greg Kroah-Hartman [this message]
2017-11-13 12:55 ` [PATCH 4.9 41/87] IB/ipoib: Change list_del to list_del_init in the tx object Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.9 42/87] ARM: dts: STiH410-family: fix wrong parent clock frequency Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 43/87] s390/qeth: fix retrieval of vipa and proxy-arp addresses Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 44/87] s390/qeth: issue STARTLAN as first IPA command Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 45/87] wcn36xx: Dont use the destroyed hal_mutex Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 46/87] IB/rxe: Fix reference leaks in memory key invalidation code Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 47/87] clk: mvebu: adjust AP806 CPU clock frequencies to production chip Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 48/87] net: dsa: select NET_SWITCHDEV Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 51/87] KEYS: trusted: sanitize all key material Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 52/87] KEYS: trusted: fix writing past end of buffer in trusted_read() Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 55/87] x86/uaccess, sched/preempt: Verify access_ok() context Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 56/87] workqueue: Fix NULL pointer dereference Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 57/87] crypto: ccm - preserve the IV buffer Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 58/87] crypto: x86/sha1-mb - fix panic due to unaligned access Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 59/87] crypto: x86/sha256-mb " Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 60/87] KEYS: fix NULL pointer dereference during ASN.1 parsing [ver #2] Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 61/87] ARM: 8720/1: ensure dump_instr() checks addr_limit Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 62/87] ALSA: seq: Fix OSS sysex delivery in OSS emulation Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 63/87] ALSA: seq: Avoid invalid lockdep class warning Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 65/87] MIPS: microMIPS: Fix incorrect mask in insn_table_MM Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 66/87] MIPS: Fix CM region target definitions Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 67/87] MIPS: SMP: Use a completion event to signal CPU up Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 68/87] MIPS: Fix race on setting and getting cpu_online_mask Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 69/87] MIPS: SMP: Fix deadlock & online race Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 70/87] selftests: firmware: send expected errors to /dev/null Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 71/87] tools: firmware: check for distro fallback udev cancel rule Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 72/87] ASoC: sun4i-spdif: remove legacy dapm components Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 73/87] MIPS: BMIPS: Fix missing cbr address Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 74/87] MIPS: AR7: Defer registration of GPIO Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 75/87] MIPS: AR7: Ensure that serial ports are properly set up Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 76/87] Input: elan_i2c - add ELAN060C to the ACPI table Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 77/87] rbd: use GFP_NOIO for parent stat and data requests Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 78/87] drm/vmwgfx: Fix Ubuntu 17.10 Wayland black screen issue Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 79/87] drm/bridge: adv7511: Rework adv7511_power_on/off() so they can be reused internally Greg Kroah-Hartman
2017-11-13 12:56   ` Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 80/87] drm/bridge: adv7511: Reuse __adv7511_power_on/off() when probing EDID Greg Kroah-Hartman
2017-11-13 12:56   ` Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 81/87] drm/bridge: adv7511: Re-write the i2c address before EDID probing Greg Kroah-Hartman
2017-11-13 12:56   ` Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 82/87] can: sun4i: handle overrun in RX FIFO Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 83/87] can: ifi: Fix transmitter delay calculation Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 85/87] netfilter: nat: Revert "netfilter: nat: convert nat bysrc hash to rhashtable" Greg Kroah-Hartman
2017-11-14 15:54   ` Pablo Neira Ayuso
2017-11-14 15:55     ` Pablo Neira Ayuso
2017-11-13 12:56 ` [PATCH 4.9 86/87] x86/smpboot: Make optimization of delay calibration work correctly Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.9 87/87] x86/oprofile/ppro: Do not use __this_cpu*() in preemptible context Greg Kroah-Hartman
2017-11-13 21:51 ` [PATCH 4.9 00/87] 4.9.62-stable review Shuah Khan
2017-11-13 22:28 ` Guenter Roeck
2017-11-14  6:48 ` [PATCH 4.9 00/87] 4.9.62-stable review --> crash Sebastian Gottschall
2017-11-14  7:41   ` Greg Kroah-Hartman
2017-11-14  7:41     ` Greg Kroah-Hartman
2017-11-14  7:46     ` Sebastian Gottschall
2017-11-14  8:01       ` Greg Kroah-Hartman
2017-11-14  8:01         ` Greg Kroah-Hartman
2017-11-14 22:20 ` [PATCH 4.9 00/87] 4.9.62-stable review Tom Gall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171113125619.007448157@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.levin@verizon.com \
    --cc=benh@kernel.crashing.org \
    --cc=borntraeger@de.ibm.com \
    --cc=fenghua.yu@intel.com \
    --cc=fweisbec@gmail.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sgruszka@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=wanpeng.li@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.