手动触发OOM
2021-9-9
使用sysrq-trigger的f命令,可以手动触发OOM。# echo f > /proc/sysrq-trigger[46104.833134] sysrq: SysRq : Manual OOM execution[46104.840333] kworker/1:2 invoked oom-
守护进程无法通过SIGTERM杀死问题分析
2022-1-17
在调试logd守护进程时,概率性出现/etc/init.d/logd stop无法停止的问题。stop是通过发送SIGTERM命令实现的。测试发现通过SIGINT信号可以杀死logd。由于测试过程中,需要重新编译,然后覆盖旧的bin文件,覆盖bin是strip命令-o选项覆盖的,以为是覆盖bin导致
Linux namespace 学习第一篇
2022-1-20
初识namespaceXrouter平台支持X86上运行,来加快开发速度。最开始没有使用namespace,而只是使用chroot,切换到rootfs,然后拉起相关业务:$ chroot . /bin/sh -c "/etc/rcS S boot; /bin/sh -i; /etc/rcS K sh
Inter namespace communication
2022-1-24
在虚拟化环境中,默认net namespace怎么和新创建的net namespace通信呢?答案是使用veth pair。创建一对veth接口,这两个接口相当于点对点的两端。ip link add veth0 type veth peer name veth1然后添加ip地址和路由条目即可:$ i
shell backgroud process ignore SIGINT signal
2022-2-7
在/etc/init.d/logd 脚本中,start (){ logd -d &}发现在后台执行的方式启动守护进程,其SIGINT和SIGQUIT被设置成为SIG_IGN,导致无法通过SIGINT杀死。start (){ logd -d}这种方式就没问题。原因:根据 The Shell
signalfd, pidfd 实现poll等待子进程退出
2022-3-13
通常我们使用wait()/waitpid()/waitid()来回收子进程,但是这个方法,需要我们去轮询。没有事件监听机制。本文研究了相关的技术,可以实现poll监听子进程退出。 linux 有 signalfd,timerfd,eventfd。后续最新的5.4内核还添加了pidfd。
linux directory modification time
2022-3-28
The mtime (modification time) on the directory itself changes when a file or a subdirectory is added, removed or renamed.Modifying the contents of a f
System V shared memory 学习
2022-6-29
shared memory有两一种,一种是更老的但是兼容性更好的 System V shared memory。一种是POSIX shared memory。man shm_overview 可以查看POSIX shared memory的介绍。接口 #include
获得内核模块的加载地址
2022-7-14
有两个接口,一个是/sys/module/xxx/sections/.txt。一个是/proc/modules。例如:# cat /sys/module/bootconfig/sections/.text0xffffffc008772000# cat /proc/modules | grep boo
If I mmap a file from tmpfs, will it double the memory usage
2022-9-24
最近在研究rootfs升级方案。通常由于rootfs正在运行,所以直接写mtd可能造成问题。所以要使用privot_root切换到initramfs。然后卸载rootfs. 但是由于init进程,使用了rootfs, 又没法杀掉init进程。是没法直接卸载rootfs的。一个方案是在启动的过程中,就
Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.