高级操作系统高级操作系统 (31).pdf

上传人:刘静 文档编号:57972005 上传时间:2022-11-06 格式:PDF 页数:16 大小:415.90KB
返回 下载 相关 举报
高级操作系统高级操作系统 (31).pdf_第1页
第1页 / 共16页
高级操作系统高级操作系统 (31).pdf_第2页
第2页 / 共16页
点击查看更多>>
资源描述

《高级操作系统高级操作系统 (31).pdf》由会员分享,可在线阅读,更多相关《高级操作系统高级操作系统 (31).pdf(16页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、第 6 讲:The Programming Languages of OS第四节:The benefits and costs of writing kernel in a high-level languageIntroduction BiscuitShould we use high-level languagesto build OS kernels?BenefitsEasier to programSimpler concurrency with GCPrevents classes of kernel bugsDownsideBounds,cast,nil-pointer check

2、sReflectionGarbage collection.Introduction BiscuitGoal:measure HLL impactPros:Reduction of bugsSimpler codeCons:HLL safety taxGC CPU and memory overheadGC pause times.Introduction BiscuitMethodologyNone measure HLL impact in a monolithic POSIX kernelBuild new HLL kernel,compare with LinuxIsolate HLL

3、 impact:Same apps,POSIX interface,and monolithic organization.Introduction Biscuit58 syscalls,LOC:28k Go,1.5kassembly(boot,entry/exit)Go-langEasy to call asmCompiled to machine code w/good compilerEasy concurrency&static analysisGCConcurrent mark and sweepStop-the-world pauses of 10s of s.Introducti

4、on Biscuit58 syscalls,LOC:28k Go,1.5kassembly(boot,entry/exit)BiscuitMulticoreThreadsJournaled FS(7k LOC)Virtual memory(2k LOC)TCP/IP stack(5k LOC)Drivers:AHCI and Intel 10G NIC(3k LOC).Introduction Biscuit58 syscalls,LOC:28k Go,1.5kassembly(boot,entry/exit)Many implementation puzzles in BiscuitInte

5、rruptsThreadsKernel threads are lightweightRuntime on bare-metalHeap exhaustion(Surprising)etc.Introduction Biscuit58 syscalls,LOC:28k Go,1.5kassembly(boot,entry/exit)Cant allocate heap memory=nothing worksAll kernels face this problem.Introduction Biscuit58 syscalls,LOC:28k Go,1.5kassembly(boot,ent

6、ry/exit)Strawman 1:Wait for memory in allocator?May deadlock!Strawman 2:Check/handle allocation failure,like Ckernels?Difficult to get rightCant!Go doesnt expose failed allocationsand implicitly allocatesBoth cause problems for Linux;see“too small to fail”rule.Introduction Biscuit58 syscalls,LOC:28k

7、 Go,1.5kassembly(boot,entry/exit)ReservationsHLL easy to analyzeTool computes reservation via escape analysis three days of expert effort to apply tool.Introduction Biscuit58 syscalls,LOC:28k Go,1.5kassembly(boot,entry/exit)BISCUIT adopted many Linux optimizations:large pages for kernel textper-CPU

8、NIC transmit queuesRCU-like directory cacheconcurrent FS transactionspad structs to remove false sharingGood OS performance more about optimizations,lessabout HLL.Introduction Biscuit58 syscalls,LOC:28k Go,1.5kassembly(boot,entry/exit)Eval:Should we use high-level languages to build OSkernels?Did BI

9、SCUIT benefit from HLL features?Is BISCUIT performance in the same league asLinux?What is the breakdown of HLL tax?What is the performance cost of Go compared to C?.Introduction Biscuit58 syscalls,LOC:28k Go,1.5kassembly(boot,entry/exit)Eval:Qualitative benefits of HLL featuresGCed allocationdefermu

10、lti-valued returnclosuresmapsInspected fixes for all publicly-available execute codeCVEs in Linux kernel for 2017panic likely better than malicious code execution.Introduction BiscuitBiscuit and Linux in the same leaguethe breakdown of HLL tax in Biscuit.Introduction BiscuitC is 15%fasterPrologue/sa

11、fety-checks 16%more instructionsThe HLL worked well for kernel developmentPerformance is paramount use C(up to 15%)Minimize memory use use C(mem.budget,GC cost)Safety is paramount use HLL(40 CVEs stopped)Performance merely important use HLL(pay 15%,memory).ReferencesMultiprogramming a 64 kB Computer Safely and Efficiently,SOSP 2017The benefits and costs of writing a POSIX kernel in a high-level language,OSDI 2018.

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 大学资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁