From: Martin Liu Date: Mon, 6 May 2019 16:57:20 +0000 (+0800) Subject: mm: mm_event: remove get/put_online_cpus call X-Git-Tag: MMI-RSA31.Q1-48-36-11~33 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=509fd9d757cb4c79619c20bdcd2185ab8c1b49bb;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mm: mm_event: remove get/put_online_cpus call remove get/put_online_cpus call since it could cause deadlock in cpu hotplug path. This might cause race but should be rare and we should be able to correct that with the next dump. ======================================================= Task name: Binder:897_2 pid: 3255 cpu: 0 start: 0xffffffd39e2f5700 state: 0x2 exit_state: 0x0 stack base: 0xffffff80241f0000 Prio: 116 Stack: [] __switch_to.cfi+0x138 [] __schedule+0xb7c [] rwsem_down_read_failed.cfi+0x270 [] __percpu_down_read.cfi+0x164 [] record_stat+0x6c0 [] mm_event_end.cfi+0x14c [] try_to_free_pages.cfi+0xaf4 [] __alloc_pages_nodemask.cfi+0x9c8 [] zcomp_cpu_up_prepare.cfi+0x88 [] cpuhp_invoke_callback+0x378 [] _cpu_up+0x1bc [] enable_nonboot_cpus.cfi+0x208 [] suspend_devices_and_enter.cfi+0xc20 [] pm_suspend.cfi+0xb30 [] state_store.cfi+0x94 [] kobj_attr_store.cfi+0x34 [] sysfs_kf_write.cfi+0x64 [] kernfs_fop_write.cfi+0x1a4 [] __vfs_write.cfi+0x50 [] vfs_write.cfi+0xcc [] SyS_write.cfi+0xa4 [] el0_svc_naked+0x34 Test: manual suspend/resume test Mot-CRs-fixed: (CR) Bug: 132011965 Change-Id: I112ca0d25e825bb4e0e8979d9b4f1d8e6090147f Signed-off-by: Martin Liu (cherry picked from commit 5f419093ab253702847a6b3a8417e47c2acfb652) Reviewed-on: https://gerrit.mot.com/1453731 Tested-by: Jira Key SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- diff --git a/mm/mm_event.c b/mm/mm_event.c index f5281cd80b0f..1f86a9efc455 100644 --- a/mm/mm_event.c +++ b/mm/mm_event.c @@ -52,8 +52,6 @@ static void record_vmstat(void) vmstat.ws_activate = global_node_page_state(WORKINGSET_ACTIVATE); vmstat.mapped = global_node_page_state(NR_FILE_MAPPED); - /* No want to make lock dependency between vmstat_lock and hotplug */ - get_online_cpus(); for_each_online_cpu(cpu) { struct vm_event_state *this = &per_cpu(vm_event_states, cpu); @@ -69,7 +67,6 @@ static void record_vmstat(void) vmstat.compact_scan += this->event[COMPACTFREE_SCANNED] + this->event[COMPACTMIGRATE_SCANNED]; } - put_online_cpus(); trace_mm_event_vmstat_record(&vmstat); }