- 刀客谝闲传 (25)
41 weeks 1 day ago - Linux系统知识 (27)
1 year 45 weeks ago - 技巧&手册 (31)
2 years 4 weeks ago - FreeBSD系统 (6)
3 years 20 weeks ago - 历史的回忆 (2)
3 years 26 weeks ago
奶粉抽检结果暴露出"潜规则"令人恶心
Submitted by lixiang on 三, 2008-09-17 19:44. 刀客谝闲传央视新闻联播由邢质斌主播的国家质检总局关于奶粉质量检查结果的通报。22家奶粉厂家产品含有三聚氰胺,著名国产品牌几乎一网打尽。报道里这样几条信息耐人寻味:
How likely should likely() be?
Submitted by lixiang on 六, 2007-08-18 09:42. Linux系统知识http://lwn.net/Articles/70473/
这篇文章讲内核代码中likely和unlikely的用法。这个两个宏在以前的内核里面是没有的,应该是在2.5以后的代码中引进的。
比较新的CPU,一般都会有指令预取的功能,也就是在执行当前指令的时候,可能把当前指令后的很多指令都取到了指令cache里面了,而且由于指令流水的 并行执行,很可能在执行当前指令时,把后面的很多指令都执行了。所以,如果当前指令是一个条件指令,那么,最后它后面的指令是条件为真时执行的指令,这样 可以提高执行的性能。
Linux用户进程是如何申请和释放内存的?
Submitted by lixiang on 三, 2007-06-27 21:19. Linux系统知识UTF-8
http://lixiang.cn/glibc_mem/glibc_mem.html
mmap释疑
Submitted by lixiang on 三, 2007-06-27 20:59. Linux系统知识MAP_PRIVATE 是创建一个写时拷贝映射(copy-on-write),也就是说如果有多个进程同时映射到一个文件上,映射建立时只是共享同样的存储页面,但是某进程企图修改页面内容,则复制一个副本给该进程私用,它的任何修改对其它进程都不可见。而MAP_SHARED则无论修改与否都使用同一副本,任何进程对页面的修改对其它进程都是可见的。所以它们占有的内存大小当然差别比较大了^_^
When Linux Runs Out of Memory
Submitted by lixiang on 三, 2007-06-27 20:57. Linux系统知识Perhaps you rarely face it, but once you do, you surely know what's wrong: lack of free memory, or Out of Memory (OOM). The results are typical: you can no longer allocate more memory and the kernel kills a task (usually the current running one). Heavy swapping usually accompanies this situation, so both screen and disk activity reflect this.
how to use one compiled kernel of bsd in a new server
Submitted by lixiang on 三, 2007-06-06 21:06.on 147.182 , cp /boot/kernel.tar.gz to new server
on new server: tar xvfz kernel.tar.gz /newkernel
cp -R /boot/kernel /boot/kernel.orig
mv /newkernel /boot/kernel
reboo
create your own customed boot disc
Submitted by lixiang on 日, 2007-06-03 18:25. 技巧&手册1. Put the contents of the boot.iso image into a temporary directory
# mkdir /tmp/iso
# mount -o loop boot.iso /mnt
# cd /mnt
# cp -a . /tmp/iso
2. Put additional files (e.g. kickstart files) into the same directory.
3. Edit isolinux/isolinux.cfg to modify/add boot entries.
4. You can also modify isolinux/boot.msg to privide a custom boot message.
5. Create a new bootable image with the following commands:
# cd /tmp/iso
# mkisofs -o ../bootcd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -Jr .
- ks=hd:<device>:/<file>
-
安装程序把文件系统挂载在 <device>(必须是 vfat 或 ext2),而且在该文件系统里以 <file> 来寻找 kickstart 文件(例如,ks=hd:sda3:/mydir/ks.cfg)。
Linux Memory Management or 'Why is there no free RAM?'
Submitted by lixiang on 一, 2007-05-21 17:39. Linux系统知识Linux Memory Management or 'Why is there no free RAM?'
Revision 2.3
Copyright 2004 sapphirecat. The text of this post is licensed under a Creative Commons License.
for loop
Submitted by lixiang on 四, 2007-05-17 15:33. 技巧&手册for i in `seq 1 10` ; do mount -o loop rhn-$i.iso /mnt; cp -dR /mnt/* /rhntmp; umount /mnt; done
Linux 的 Virtual Memory Areas(VMA):基本概念介紹
Submitted by lixiang on 二, 2007-04-10 15:18.由 user process 角度來說明的話,VMA 是 user process 裡一段 virtual address space 區塊;virtual address space 是連續的記憶體空間,當然 VMA 也會是連續的空間。VMA 對 Linux 的主要好處是,可以記憶體的使用更有效率,並且更容易管理 user process address space。
