谷歌建议为Linux提供用户线程

2020-07-28 00:49:13

/color/Atom提要发件人:Peter Oskolkov<;[email protected]>;收件人:Linux内核邮件列表<;[email protected]>;,Thomas Gleixner<;[email protected]>;,ingo Molnar<;[email protected]>;,ingo Molnar<;mingo@kernelt;抄送:Peter Oskolkov<;[email protected]>;,Andrei Vagin<;[email protected]>;,Paul Turner<;[email protected]>;,Ben Segall<;[email protected]>;,Aaron Lu<;[email protected]>;主题:[PATCH for 5.9 0/3]Fut;[[email protected]>;,Aaron Lu<;[email protected]>;(RAW)来自:Peter Oskolkov<;[email protected]>;正如保罗·特纳在2013年的lpc上介绍的那样...-pdf:http://pdxplumbers.osuosl.org/2013/ocw//system/presentations/1653/original/LPC%20-%20User%20Threading.pdf-视频:https://www.youtube.com/watch?v=KXuZi9aeGTw...。Google已经开发了一个由Google-private Switchto Linux内核API命名的M:N用户空间线程子系统(上面参考的PDF中的第17页)。这个子系统在Google提供延迟敏感型服务,对运行时间进行细粒度的用户空间控制/调度,并且这个子系统在内部被广泛使用(称为调度器或光纤)。这个补丁集是开源这项工作的第一步。正如链接的pdf和视频中所解释的,SwitchTo API有三个核心操作:等待、恢复和交换(=switch)。因此,此修补程序集添加了一个FUTEX_SWAP操作,除了FUTEX_WAIT和FUTEX_WAKE之外,它还将提供一个基础,在此基础上可以构建用户空间线程库。FUTEX_SWAP的另一个常见用例是在任务之间传递消息:任务/线程T1准备消息,唤醒T2处理消息,并等待结果;T2完成后,它唤醒T1并等待更多工作到来。目前实现这一点的最简单方式是ISA。T1:Futex-Wake T2,Futex-Waitb。T2:唤醒,执行已唤醒到DOC的操作。T2:Futex-WAKE T1,Futex-wait使用Futex_SWAP,上述步骤a和c可以减少为一个Futex操作,运行速度提高5-10倍。此修补程序集中的补丁程序:补丁程序1:引入内部执行WAKE+WAIT的Futex_SWAP Futex操作。此补丁程序的目的是制定API。补丁程序2:第一次粗略尝试使Futex_SWAP比WAKE+WAIT的速度更快。补丁程序3:也可用于对Futex_SWAP与Futex_WAIT+Futex_WAIT进行基准测试的自测试。Peter Oskolkov(3):Futex:引入Futex_SWAP操作Futex/sched:ADD WAKEX_UP_PROCESS_PREER_CURRENT_CPU,在Futex_SWAP自检/Futex中使用:添加Futex_SWAP自检include/linux/Sched.h|1+include/uapi/linux/futex.h|2+kernel/futex.c|89+--kernel/sched/core.c|5+kernel/sched/air.c|3+kernel/sched/ed.h|1+.../selftest/futex/function/.gitignore|1+.../selftestore|1+.../selftest/.gitignore|1+.../selftest。|209+.../selftest/futex/include/futextest.h|19++10个文件已更改,315个插入(+),16项删除(-)创建模式100644 tools/testing/selftests/futex/functional/futex_swap.c--2.25.1回复索引线程概述:9+消息/展开[平面|嵌套]mbox.gz Atom feed top 2020-07-22 23:45 Peter Oskolkov[此消息]2020-07-22 23:45`[5.9 1/3]Futex:介绍Futex_SWAP操作Peter Oskolkov2020-07-23 11:27`Peter Zijlstra2020-07-24 0:25`Peter Oskolkov2020-07-23 11:27`Peter Zijlstra2020-07-24 0:25`Peter Oskolkov2020-07-23 11:27`Peter Zijlstra2020-07-24 0:25`Peter Oskolkov2020。00`外曼龙2020-07-24 3:22`Peter Oskolkov2020-07-27 9:51`peterz2020-07-22 23:45`[5.9 2/3补丁]futex/sched:add WAKE_UP_PROCESS_PREER_CURRENT_CPU,在FUTEX_SWAP Peter Oskolkov2020-07-22 23:45`[5.93/3补丁程序]中使用自检/FUTEX:添加FUTEX_SWAP自测试Peter Oskolkov回复说明:您可以使用以下任何一种方法通过纯文本电子邮件公开回复此消息:*保存以下mbox文件,将其导入到您的邮件客户端,然后从那里回复给所有人:mbox避免顶部张贴,而倾向于交叉引用:https://en.wikipedia.org/wiki/Posting_style#Interleaved_style*使用--to回复,和Git-Send-Email(1)的回复开关(1):git send-email\[email protected]\[email protected]\[email protected]\[email protected]\[email protected]\[email protected]\[email protected]\--cc。Com\[email protected]\[email protected]\[email protected]\[email protected]\[email protected]\/https://kernel.org/pub/software/scm/git/docs/git-send-email.html*/to/Your_Reply MAILTO:如果您的邮件客户端支持通过MAILTO:链接设置In-Reply-To报头,尝试使用mailto:link lkml Archive on lore.kernel.org归档文件是可克隆的:git克隆--镜像https://lore.kernel.org/lkml/0 lkml/git/0.git git克隆--镜像https://lore.kernel.org/lk