提交 2ca987f1 编写于 作者: Z ZhangPeng 提交者: Ma Wupeng

userswap: provide cpu info in userfault msg

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I6CAIM

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

The uffd_msg.reserved3 field is used to transfer the CPU information of
the PF.
Signed-off-by: NZhangPeng <zhangpeng362@huawei.com>
上级 ef3a1632
......@@ -218,6 +218,9 @@ static inline struct uffd_msg userfault_msg(unsigned long address,
msg.arg.pagefault.flags |= UFFD_PAGEFAULT_FLAG_WP;
if (features & UFFD_FEATURE_THREAD_ID)
msg.arg.pagefault.feat.ptid = task_pid_vnr(current);
#ifdef CONFIG_USERSWAP
uswap_get_cpu_id(reason, &msg);
#endif
return msg;
}
......
......@@ -66,6 +66,12 @@ static inline bool uswap_missing(struct vm_area_struct *vma)
return false;
}
static inline void uswap_get_cpu_id(unsigned long reason, struct uffd_msg *msg)
{
if (reason & VM_USWAP)
msg->reserved3 = smp_processor_id();
}
#endif /* CONFIG_USERSWAP */
#endif /* _LINUX_USERSWAP_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册