[PATCH OLK-6.6 0/1] zcopy: Fix context switch within RCU read-side
zcopy: Fix context switch within RCU read-side Liu Mingrui (1): zcopy: Fix context switch within RCU read-side error drivers/misc/zcopy/zcopy.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.25.1
hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/ID96R2 -------------------------------- _pte_offset_map will enter in RCU read section, but we don't do pte_unmap, so we do not leave rcu read section. We add pte_unmap to solve it. ------------[ cut here ]------------ Voluntary context switch within RCU read-side critical section! WARNING: CPU: 3 PID: 16383 at kernel/rcu/tree_plugin.h:320 rcu_not_context_switch+0x45c/0x500 Call trace: rcu_note_context_switch+0x45c/0x500 __schedule+0xbc/0x898 schedule+0x60/0x138 p9_client_rpc+0x118/0x430 p9_client_clunk+0x48/0xa8 v9fs_dir_release+0xf0/0x138 __fput+0xbc/0x280 ____fput+0x14/0x28 task_work_run+0x70/0xd0 do_exit+0x31c/0xa48 do_group_exit+0x38/0xa0 __arm64_sys_exit_group+0x1c/0x28 invoke_syscall+0x48/0x110 el0_svc_common.constprop.0+0x44/0xe8 do_el0_svc+0x84/0xc8 el0_slow_syscall+0x3c/0x120 .slow_syscall+0x16c/0x170 Fixes: 8d543a8e74d5 ("zcopy: Introduce the pageattach interface") Signed-off-by: Liu Mingrui <liumingrui@huawei.com> --- drivers/misc/zcopy/zcopy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/misc/zcopy/zcopy.c b/drivers/misc/zcopy/zcopy.c index 65e83879733a..073134fbf737 100644 --- a/drivers/misc/zcopy/zcopy.c +++ b/drivers/misc/zcopy/zcopy.c @@ -407,6 +407,7 @@ static int attach_pte_range(struct vm_area_struct *dst_vma, struct vm_area_struc { struct mm_struct *dst_mm = dst_vma->vm_mm; pte_t *src_ptep, *dst_ptep, pte, dst_pte; + pte_t *orig_src_ptep, *orig_dst_ptep; spinlock_t *dst_ptl; int max_nr, ret, nr, i; int rss[NR_MM_COUNTERS]; @@ -420,6 +421,8 @@ static int attach_pte_range(struct vm_area_struct *dst_vma, struct vm_area_struc src_ptep = zcopy_pte_offset_map(src_pmdp, src_addr); dst_ptep = zcopy_pte_offset_map(dst_pmdp, dst_addr); dst_ptl = pte_lockptr(dst_mm, dst_pmdp); + orig_src_ptep = src_ptep; + orig_dst_ptep = dst_ptep; spin_lock_nested(dst_ptl, SINGLE_DEPTH_NESTING); do { @@ -457,6 +460,8 @@ static int attach_pte_range(struct vm_area_struct *dst_vma, struct vm_area_struc out: zcopy_add_mm_rss_vec(dst_mm, rss); spin_unlock(dst_ptl); + pte_unmap(orig_dst_ptep); + pte_unmap(orig_src_ptep); return ret; } -- 2.25.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/19339 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/FBM... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/19339 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/FBM...
participants (2)
-
Liu Mingrui -
patchwork bot