kernel_optimize_test/arch/powerpc
Vaibhav Jain cc74896531 powerpc/mm: Add cond_resched() while removing hpte mappings
[ Upstream commit a5d6a3e73acbd619dd5b7b831762b755f9e2db80 ]

While removing large number of mappings from hash page tables for
large memory systems as soft-lockup is reported because of the time
spent inside htap_remove_mapping() like one below:

 watchdog: BUG: soft lockup - CPU#8 stuck for 23s!
 <snip>
 NIP plpar_hcall+0x38/0x58
 LR  pSeries_lpar_hpte_invalidate+0x68/0xb0
 Call Trace:
  0x1fffffffffff000 (unreliable)
  pSeries_lpar_hpte_removebolted+0x9c/0x230
  hash__remove_section_mapping+0xec/0x1c0
  remove_section_mapping+0x28/0x3c
  arch_remove_memory+0xfc/0x150
  devm_memremap_pages_release+0x180/0x2f0
  devm_action_release+0x30/0x50
  release_nodes+0x28c/0x300
  device_release_driver_internal+0x16c/0x280
  unbind_store+0x124/0x170
  drv_attr_store+0x44/0x60
  sysfs_kf_write+0x64/0x90
  kernfs_fop_write+0x1b0/0x290
  __vfs_write+0x3c/0x70
  vfs_write+0xd4/0x270
  ksys_write+0xdc/0x130
  system_call+0x5c/0x70

Fix this by adding a cond_resched() to the loop in
htap_remove_mapping() that issues hcall to remove hpte mapping. The
call to cond_resched() is issued every HZ jiffies which should prevent
the soft-lockup from being reported.

Suggested-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210404163148.321346-1-vaibhav@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-19 10:12:56 +02:00
..
boot powerpc/boot: Fix build of dts/fsl 2020-12-30 11:54:01 +01:00
configs
crypto
include powerpc/64: Fix the definition of the fixmap area 2021-05-14 09:50:42 +02:00
kernel powerpc/32: Statically initialise first emergency context 2021-05-19 10:12:54 +02:00
kexec powerpc/kexec_file: Use current CPU info while setting up FDT 2021-05-11 14:47:35 +02:00
kvm KVM: PPC: Book3S HV P9: Restore host CTRL SPR after guest exit 2021-05-14 09:50:35 +02:00
lib powerpc/32: Fix boot failure with CONFIG_STACKPROTECTOR 2021-05-11 14:47:35 +02:00
math-emu
mm powerpc/mm: Add cond_resched() while removing hpte mappings 2021-05-19 10:12:56 +02:00
net
oprofile
perf powerpc/perf: Fix the threshold event selection for memory events in power10 2021-05-14 09:50:42 +02:00
platforms powerpc/52xx: Fix an invalid ASM expression ('addi' used instead of 'add') 2021-05-14 09:50:42 +02:00
purgatory
sysdev powerpc/xive: Fix xmon command "dxi" 2021-05-14 09:50:38 +02:00
tools
xmon powerpc/xmon: Change printk() to pr_cont() 2020-12-30 11:54:16 +01:00
Kbuild
Kconfig powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration 2021-05-14 09:50:31 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-14 09:50:34 +02:00
Makefile Kbuild fixes for v5.10 (2nd) 2020-12-06 10:31:39 -08:00
Makefile.postlink