更多奇技淫巧欢迎订阅博客:https://fuckcloudnative.io前言本文翻译自 2020 年 Joe Stringer 在 Linux Plumbers Conference 的一篇分享: Packet Mark In a Cloud Native World[1]。探讨一个在网络和安全领域非常重要但又讨论甚少的主题:skb mark。skb m…
原文链接:https://www.ebpf.top/post/linux_process_mgr/本文是技术团队内部分享的版本,目的是通过进程管理及调度器历史对于 Linux 进程管理的演进过程起到一个总览的作用,完整的 PDF 可以在这里 下载。水平有限,本文内容仅供参考…
Logstash 报错 问题:
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreadsN
某些软件包启动的时候默认…
译者序本文组合翻译了以下两篇文章的干货部分,作为 io_uring 相关的入门参考:How io_uring and eBPF Will Revolutionize Programming in Linux[1], ScyllaDB, 2020An Introduction to the io_uring Asynchronous I/O Framework[2], Oracle, 2020io_urin…
关注了就能看到更多这么棒的文章哦~Pulling slabs out of struct pageBy Jonathan CorbetOctober 8, 2021DeepL assisted translationhttps://lwn.net/Articles/871982/目前,在内存管理子系统中加入 folio 概念的工作看起来似乎已经停滞不前了࿰…
关注了就能看到更多这么棒的文章哦~Bye-bye bdflush()By Jonathan CorbetJuly 5, 2021DeepL assisted translationhttps://lwn.net/Articles/861431/在 Linux 内核中增加系统调用是经常发生的事情,几乎每个合并窗口期内都有这种动作。相反,删…
关注了就能看到更多这么棒的文章哦~Support for Intels Linear Address MaskingSupport for Intels Linear Address MaskingDeepL assisted translationhttps://lwn.net/Articles/902094/一个 64 位的指针可以对海量的内存进行寻址,远远超过真实世界中一…
关注了就能看到更多这么棒的文章哦~The ABI status of filesystem formatsBy Jonathan CorbetOctober 8, 2020DeepL assisted translationhttps://lwn.net/Articles/833696/Linux 内核开发有一个关键原则,那就是内核和用户空间之间的 ABI 不能被破坏。任…
安装 Linux 内核 4.0
从Elrepo或者源代码来安装最新的Linux内核4.0。代号为‘Hurr durr I’m a sheep’的Linux内核4.0是目前为止最新的主干内核。它是稳定版3.19.4之后发布的内核。4月12日,Linux Torvalds宣布了Linux内核4.0的发布,它现在就已经可用了…
关注了就能看到更多这么棒的文章哦~Software and hardware obsolescence in the kernelBy Jonathan CorbetAugust 28, 2020LPC原文来自:https://lwn.net/Articles/829733/DeepL assisted translation.在内核中添加代码以支持新的硬件,相对来说…
来源:baijiahao.baidu.com/s?id1723528229727988800虽然目前 PC 用户大多会选择 Windows 操作系统,因为它受众人群广,简单易用。那么除了 Windows 操作系统,还有没有其它选择呢?答案是肯定的。前段时间,Li…
本质上就是生产者和消费者的关系。
核心三组合:
M
P
G
S (sheduler)
M 指Machine,一个M关联了一个内核线程。负责运行goroutine.
P 指 Processor,代表了M所需的上下文环境。也是处理用户级代码逻辑的处理器。P的数量决定了系统内最大的…
关注了就能看到更多这么棒的文章哦~BPF as a safer kernel programming environmentSeptember 23, 2022This article was contributed by David VernetLPCDeepL assisted translationhttps://lwn.net/Articles/909095/无论好坏,C语言已经是内核开发领域的…
关注了就能看到更多这么棒的文章哦~Kernel topics on the radarBy Jonathan CorbetAugust 2, 2021DeepL assisted translationhttps://lwn.net/Articles/864603/内核开发社区非常繁忙,每天都有成千上万的电子邮件飞来飞去,每个时刻都有许多不…
关注了就能看到更多这么棒的文章哦~Looking back at the UMN episodeBy Jonathan CorbetSeptember 27, 2021DeepL assisted translationMaintainers summithttps://lwn.net/Articles/870415Looking back at the UMN episode今年早些时候,一个由明尼苏达大…
关注了就能看到更多这么棒的文章哦~A look forward to Linux Plumbers 2021By Jake EdgeJuly 27, 2021DeepL assisted translationhttps://lwn.net/Articles/864016/一年一度的 Linux Plumbers Conference(LPC)是从事 Linux 系统底层…
本文永久链接: https://www.xtplayer.cn/linux/network/could-not-generate-persistent-mac-address/问题现象在 docker 容器环境中,可能会看到很多如下的错误日志:Could not generate persistent MAC address for tap0: No such file or directory问题分…
错误:
CHK include/linux/version.h CHK include/generated/utsrelease.h CC kernel/bounds.s cc1: error: code model kernel does not support PIC mode /usr/src/linux-2.6.35.5/./Kbuild:35: recipe for target ‘kernel/bounds.s’ failed make[1]: *** [kern…
关注了就能看到更多这么棒的文章哦~Statistics from the 5.18 development cycleBy Jonathan CorbetMay 23, 2022DeepL assisted translationhttps://lwn.net/Articles/895800/5.18 版内核在经历了 9 周的开发周期后于 5 月 22 日发布。这说明又到了该看看这次 rele…
关注了就能看到更多这么棒的文章哦~Old compilers and old bugsBy Jonathan CorbetJanuary 11, 2021DeepL assisted translationhttps://lwn.net/Articles/842122/内核项目花费了很多精力来帮助使用旧的工具链的开发者。在一个新系统上编译内核本身已经是一个挑战了…
关注了就能看到更多这么棒的文章哦~Profile-guided optimization for the kernelBy Jonathan CorbetSeptember 3, 2020LPC原文来自:https://lwn.net/Articles/830300/DeepL assisted translationCovid-19 大流行带来的诸多影响之一,就是 2020…
关注了就能看到更多这么棒的文章哦~FIPS-compliant random numbers for the kernelBy Jake EdgeDecember 7, 2021DeepL assisted translationhttps://lwn.net/Articles/877607/Linux 随机数生成器(RNG, random-number generator)引出了大量的…
1.1 前言eBPF 是一项令人兴奋的强大技术,其允许开发者在 Linux 内核的核心处添加自定义代码功能,并且我们还可以通过编写简单的 C 或 Go 程序与加载到内核中的 eBPF 程序交互,用于加载或读取数据。运行在内核中的 BPF 程序可以检查所附加进程…
关注了就能看到更多这么棒的文章哦~What to do in response to a kernel warningBy Jonathan CorbetNovember 18, 2021DeepL assisted translationhttps://lwn.net/Articles/876209/内核内部提供了一些宏,供代码在出错的时候调用从而产生 warning。然而&…
关注了就能看到更多这么棒的文章哦~Extending restartable sequences with virtual CPU IDsBy Jonathan CorbetFebruary 28, 2022DeepL assisted translationhttps://lwn.net/Articles/885818/可重启序列(restartable sequence)是 Linux 内核…
1. 什么是CPU上下文
CPU 寄存器和程序计数器,都是 CPU 在运行任何任务前必须的依赖环境,被叫做CPU上下文。
CPU寄存器: CPU 内置的容量小、但速度极快的内存。程序计数器:存储 CPU 正在执行的指令位置、或者即将执行的下一条指令…
epollAPIepoll_createepoll_ctlepoll_waitcodeselect和poll差不多,原理一样,后来又出现了epoll,为什么呢?肯定做了优化。
API
首先,我们来看看epoll的api。
epoll_create int epoll_create(int size);epoll_create(…
Docker当前发布的最新版本已经到了1.11,其官网上针对Centos的的安装需求如下: Docker requires a 64-bit installation regardless of your CentOS version. Also, your kernel must be 3.10 at minimum, which CentOS 7 runs.看来如果我们想在低于3.x内核的操作系统…
硬件保护和软件保护A computer contains various hardware like processor, RAM, monitor etc. So OS must ensure that these devices remain intact ( not directly accessible by the user). 计算机包含各种硬件,例如处理器,RAM,监视器等。…
Linux 中,当外设触发中断后,大体处理流程如下:
a – 具体CPU architecture相关的模块会进行现场保护,然后调用machine driver对应的中断处理handler;
b – machine driver对应的中断处理handler中会根据硬件的信息获取HW interr…
关注了就能看到更多这么棒的文章哦~SA_IMMUTABLE and the hazards of messing with signalsBy Jonathan CorbetDecember 17, 2021DeepL assisted translationhttps://lwn.net/Articles/878768/内核中有一些部分,是哪怕那些最有经验和能力的开发者也不敢涉…
实验工具
clone实验源码 git clone git://g.csail.mit.edu/xv6-labs-2023进入目录 cd xv6-labs-2023运行内核 make qemu打印数据 Ctrl-p退出 ctrax
xv6中的system call
int fork() Create a process, return child’s PID.
int exit(int status) Terminate the current p…
The Linux Kernel Module Programming Guide
Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang译 断水客(WaterCutter)
6 字符设备驱动
include/linux/fs.h 中定义了结构体 file_operations ,这个结构体包含指…
[postgresdb223 home]$ pg_ctl start waiting for server to start....2023-08-17 18:51:47.852 CST [1281811] FATAL: could not create shared memory segment: 设备上没有空间 2023-08-17 18:51:47.852 CST [1281811] DETAIL: Failed system call was shmget(key161594131…
在内核编程的过程中,需要获取主机的内存使用率,多方搜索无果,以此为记!
代码如下:
void update_memory_rate()
{struct sysinfo mem_info;unsigned long total;unsigned long free;unsigned long used;uint32_t uint…
关注了就能看到更多这么棒的文章哦~NAPI polling in kernel threadsBy Jonathan CorbetOctober 9, 2020DeepL assisted translationhttps://lwn.net/Articles/833840/在那些需要进行大量网络传输的系统中,最终会花很大一部分 CPU 时间在网络协议栈&#…
关注了就能看到更多这么棒的文章哦~ kcmp() breaks loose By Jonathan Corbet February 11, 2021 DeepL assisted translation https://lwn.net/Articles/845448/ Linux 内核实现了大量的系统调用,所以对于大多数人来说总是会有一些不熟悉的系统调用&…
关注了就能看到更多这么棒的文章哦~ Handling brute force attacks in the kernel By Jake Edge March 17, 2021 DeepL assisted translation https://lwn.net/Articles/849531/ 针对 Linux 系统的若干种攻击都依赖于对 fork()系统调用进行暴力调用(brut…
DAODAO 是什么?#包含哪些要素?有哪些种类?#它的资产如何构成与分配?它将带来什么,改变什么?#无界社区会孵化哪些 DAO 组织?如果会,探索实践 DAO 的方式是?# DeepDAO 中按…
关注了就能看到更多这么棒的文章哦~Implementing eBPF for WindowsJune 10, 2021This article was contributed by Quentin MonnetDeepL assisted translationhttps://lwn.net/Articles/857215/Extended BPF(eBPF)是 Linux 内核中的一个通用执…
关注了就能看到更多这么棒的文章哦~The first half of the 5.14 merge windowBy Jonathan CorbetJuly 2, 2021DeepL assisted translationhttps://lwn.net/Articles/861248/目前为止,在 5.14 开发周期中只合入了不到 5000 个 non-merge changeset。这还不…
关注了就能看到更多这么棒的文章哦~Rust for Linux reduxBy Jake EdgeJuly 7, 2021DeepL assisted translationhttps://lwn.net/Articles/862018/7 月 4 日,Rust for Linux 项目又提供了一版 patch set,仍是为内核加入了 Rust 语言的支持。看…
关注了就能看到更多这么棒的文章哦~More IOPS with BIO cachingBy Jonathan CorbetSeptember 6, 2021DeepL assisted translationhttps://lwn.net/Articles/868070/很久很久以前,块存储设备(block storage device)速度非常慢&…
关注了就能看到更多这么棒的文章哦~The first half of the 6.1 merge windowBy Jonathan CorbetOctober 7, 2022DeepL assisted translationhttps://lwn.net/Articles/910312/6.1 合并窗口正在顺利进行中:自从窗口打开以来,已经有 5,752 个 n…
编译选项 - 内核5.9
General Setup---> Control Group support ---> io controllerEnable the block layer--->Block layer bio throttling support--->Multiqueue writeback throttling
.config编译名称
CONFIG_FAIR_GROUP_SCHEDy
# CONFIG_CFS_BANDWIDTH is …
关注了就能看到更多这么棒的文章哦~Moving the kernel to modern CBy Jonathan CorbetFebruary 24, 2022DeepL assisted translationhttps://lwn.net/Articles/885941/尽管 Linux kernel 项目总体上是在快速发展的,但它还是依赖于一些旧工具。虽然批评者…
1、漏洞简述
linux kernel一般指Linux内核。Linux是一种开源电脑操作系统内核。它是一个用C语言写成,符合POSIX标准的类Unix操作系统。
Linux内核中overlayfs文件系统中的Ubuntu特定问题,它未正确验证关于用户名称空间的文件系统功能的应用。
由于Ubu…
Supporting Linux kernel development in RustAugust 31, 2020This article was contributed by Nelson ElhageLPC(https://lwn.net/Archives/ConferenceByYear/#2020-Linux_Plumbers_Conference)DeepL assisted translation.长期以来,Rust 编程语言的一个目标都是能…
Linux proc system proc 文件系统是由内核创建的虚拟文件系统,被内核用来向外界报告信息的一个文件系统,存储着当前内核运行状态的一系列特殊文件,是在系统运行时才创建的,所以它仅存在于内存之中而不在外存(硬盘、flash)上。通过…
了解更多Greenplum相关内容,欢迎访问Greenplum中文社区网站 时隔14年,2021 SIGMOD大会将于6月20-25日来到古城西安。作为最高学术地位的国际性学术会议,SIGMOD收录的论文代表了行业的最高水平。Greenplum内核团队的论文《Greenplum: A Hybrid…
关注了就能看到更多这么棒的文章哦~Would you like signs with those chars?By Jonathan CorbetOctober 24, 2022DeepL assisted translationhttps://lwn.net/Articles/911914/C 语言之所以让人沉迷的众多原因(怪癖)之一,就是那些…
关注了就能看到更多这么棒的文章哦~The first half of the 5.17 merge windowBy Jonathan CorbetJanuary 13, 2022DeepL assisted translationhttps://lwn.net/Articles/880909/目前为止,有将近 7000 个 non-merge commit 已经合入了 mainline࿰…
关注了就能看到更多这么棒的文章哦~A "kill" button for control groupsBy Jonathan CorbetMay 3, 2021DeepL assisted translationhttps://lwn.net/Articles/855049/内核的 cgroup 机制(control group)是用来划分进程并为每个进程…
关注了就能看到更多这么棒的文章哦~ Development statistics for the 5.11 kernel By Jonathan Corbet February 15, 2021 https://lwn.net/Articles/845831/ Linux kernel 5.11 在 2 月 14 日正式发布了,这可以算得上人们期待的一个浪漫情人节礼物了。这…
1.函数的作用
确定当前内核的机器码,然后确定当前内核所用的CPU
2.machine_desc
机器码的描述符。里面包含了机器平台的相关信息。
struct machine_desc {/** Note! The first four elements are used* by assembler code in head.S, head-common.S*///机器码号…
内核调试工具crash使用 前言初识获取vmlinuxDwarf Error: wrong version in compilation unit header (is 5, should be 2, 3, or 4) 其他 前言
在编写内核驱动的过程中,时不时就导致内核崩溃,也没啥好的调试方法,要么dmesg打印内核日志&…
1、Linux环境
Redhat6.2,
Linux version 2.6.32-220.el6.i686 (mockbuildx86-003.build.bos.redhat.com) (gccversion 4,4.5 20110214 (Red Hat 4.4.5-6) (GCC) ) #1 SMP Wed Nov 9 08:02:18 EST 2011
2、故障现象 修改TCP相关文件,重启完Linux系统之…
官方文档如下:
2D convolution layer (e.g. spatial convolution over images). This layer creates a convolution kernel that is convolved with the layer input to produce a tensor of outputs. If use_bias is True, a bias vector is created and added to…
用树莓派自身进行编译,首先需要安装树莓派下缺少的库: sudo apt-get install git bc 安装git是为了可以用git获取源码,源码获取方式和上面一样。
配置
cd linux KERNELkernel7 make bcm2709_defconfig
编译与更新
make -j4 zImage mo…
operating system-操作系统概述An operating system (OS) is software that manages computer hardware and software resources and provides common services forcomputer programs. The operating system is an essential component of the system software in a computer s…
关注了就能看到更多这么棒的文章哦~A look at some 5.17 development statisticsBy Jonathan CorbetMarch 21, 2022DeepL assisted translationhttps://lwn.net/Articles/887559/在 5.17 开发周期结束时,13038 个 non-merging changeset 已经进入 mainli…
关注了就能看到更多这么棒的文章哦~Some 5.15 development statisticsBy Jonathan CorbetNovember 1, 2021https://lwn.net/Articles/874283/5.15 内核在 10 月 31 日正式发布了,code name 也就顺利成章地起名为 "Trick or Treat" 了。当时&am…
关注了就能看到更多这么棒的文章哦~Why RISC-V doesnt (yet) support KVMBy Jonathan CorbetMay 20, 2021DeepL assisted translationhttps://lwn.net/Articles/856685/近年来 RISC-V CPU 架构的地位日益突出。其相对开放的性质使其成为一个有吸引力的平台ÿ…
项目概览 输入 输出Project Jupyter has a large and growing developer community, one that both includes and extends beyond the Jupyter org on GitHub. In this post, we’ll take a walk through the wonderful things people are building based on Jupyter technolog…
OK, here’s another psutil release. Main highlights of this release are more accurate memory metrics on Linux and different OSX fixes. Here goes. 好,这是另一个psutil版本。 此版本的主要亮点是Linux上的内存指标更加准确以及OSX的不同修复。 开始。 Li…
本文分析linux-4.14.69代码的bbr拥塞算法
bbr算是一个完全独立的拥塞算法,具有自己的拥塞状态机.tcp_cong_control函数已经被bbr_main函数接管了.()
/* The "ultimate" congestion control function that aims to replace the ri…
作者:罗宇哲,中国科学院软件研究所智能软件研究中心
在上一期中,我们以 Linux 网络模块中的 CAKE 系统为例,介绍了对 Linux 补丁源码的分析方法,这一期中我们将介绍如何查看 Linux 内核中各模块的依赖关系。
一、查看…
本文是Linux设备驱动程序系列的续篇,并对字符驱动程序及其实现进行了讨论。这是Linux设备驱动程序教程的第10部分。现在,我们将讨论Linux中的Waitqueue。 Waitqueue in LinuxLinux中的等待队列介绍初始化等待队列静态方法动态方法排队wait_eventwait_eve…
定义在v4.19.133 /mm/memory.c
int remap_pfn_range(struct vm_area_struct *, unsigned long addr,unsigned long pfn, unsigned long size, pgprot_t);/*** remap_pfn_range - 映射内核内存到用户空间* vma: user vma to map to* addr: 目标用户地址开始于* pfn: 内核内存的…
Thank Zhihao Tao for your hard work. The document spent countless nights and weekends, using his hard work to make it convenient for everyone. If you have any questions, please send a email to zhihao.taooutlook.com 目录1. 概述1.1 配置修改1.2 内核参数1.2.1 …
一、简介
KASan,全称Kernel Address Sanitizer,它是一个动态检测内存错误的工具,主要功能是检查内存越界访问和使用已释放的内存等问题。KASan 集成在 Linux 内核中,随 Linux 内核代码一起发布,并由内核社区维护和发展…
Linux 内核,这个经常听见,却不不知道它具体是干嘛的东西,是不是觉得非常神秘?
Linux 内核看不见摸不着,而对于这类东西,我们经常无从下手。本文就以浅显易懂的语言,带你钻进 Linux 内核&#x…
Linux time system Linux中跟时间有关的函数变量有很多,但是对开发者来说无非就是用了计时/延时/挂起/获取时间等,下面列出自己所使用过的一些时间接口,供大家理解使用。 jiffies 在内核代码中,到处充斥着jiffies变量,…
大家好,我是张晋涛。我们用 Go 构建的二进制文件中默认包含了很多有用的信息。例如,可以获取构建用的 Go 版本:(这里我使用我一直参与的一个开源项目 KIND[1] 为例)➜ kind git:(master) ✗ go version ./bin/kind
./bin/kind: go1.16或者也…
❝本文转自田飞雨的博客,原文:https://www.jianshu.com/p/dd7b6b6fe1a0,版权归原作者所有。欢迎投稿,投稿请添加微信好友:cloud-native-yangcgroups 简介❝cgroups(是 control groups 的简写)是…
最近在生产环境中遇到了几次创建容器报错 ”no space left on device“ 失败的案例,但是排查过程中发现磁盘使用空间和 inode 都比较正常。在常规的排查方式都失效的情况下,有没有快速通用思路可以定位问题根源呢?本文是在单独环境中使用 eBP…
在高并发、短连接的场景下,kube-proxy ipvs 存在 rs 删除失败或是延迟高的问题,社区也有不少 Issue 反馈,比如kube-proxy ipvs conn_reuse_mode setting causes errors with high load from single client[1]。文本对这些问题进行了梳理&…
更多奇技淫巧欢迎订阅博客:https://fuckcloudnative.io译者序本文翻译自 2020 年的一篇英文博客 How to use eBPF for accelerating Cloud Native applications[1]。原文标题非常宽泛,但内容其实很技术:展示了如何编写简单的 BPF 程序做 sock…
http://blog.chinaunix.net/uid-27411029-id-3339059.html (L)ittle (K)ernelbootloader 1.主要功能,红色部分是android特有的一些功能,如fastboot,recovery模式等: * Variety of nand devices for bootup * USB driver to enable upgrading…
Linux 内核与架构速查
博主博客
https://blog.uso6.comhttps://blog.csdn.net/dxk539687357 本文主要记录查询 Linux 计算机的内核与架构, 用于下载对应架构的第三方软件。 一、查询内核版本
[rootnukix ~]# cat /proc/version
Linux version 4.18.0-408.el8.x86…
目录
概述
__unmap_and_move函数
step1: Lock the page to be migrated
step2: Insure that writeback is complete.
step3: Lock the new page that we want to move to.
step4: All the page table references to the page are converted to migration entries.
st…
「发表于知乎专栏《移动端算法优化》」 本文首先给出 OpenCL 运行时 API 的整体编程流程图,然后针对每一步介绍使用的运行时 API,讲解 API 参数,并给出编程运行实例。总结运行时 API 使用的注意事项。最后展示基于 OpenCL 的图像转置代码。在…