How to check which applications are using hugepages

You can find how much is allocated and how much is actually used by HugePages by run the following command. $ grep -i huge /proc/meminfo AnonHugePages: 776192 kB HugePages_Total: 241 HugePages_Free: 113 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB But, there's a time you also want to know which applications are actually used HugePages. You… Continue reading How to check which applications are using hugepages

How to build a module with source codes in separate directories.

If you want to use separate directories for source files and target modules, you can use below scheme. mod_main.c #include #include MODULE_LICENSE("GPL"); static int __init mod_entry(void) { return 0; } static void __exit mod_exit(void) { return; } module_init(mod_entry); module_exit(mod_exit); sub_mod.c #include #include int sub_func(int i) { printk("Hello %d", i); return 0; } EXPORT_SYMBOL(sub_func); Makefile… Continue reading How to build a module with source codes in separate directories.

How to debug an application

If you want to debug an application that is shipped with the fedora, you can use the following command. [root@localhost ~]# debuginfo-install gedit-3.4.2-1.fc17.x86_64 Loaded plugins: langpacks, presto, refresh-packagekit enabling fedora-debuginfo enabling updates-debuginfo --> Running transaction check ---> Package atk-debuginfo.x86_64 0:2.4.0-1.fc17 will be installed ---> Package cairo-debuginfo.x86_64 0:1.10.2-7.fc17 will be installed ---> Package enchant-debuginfo.x86_64 1:1.6.0-4.fc17 will… Continue reading How to debug an application

Very very very very very simple boot up code.

I think it's 2003 or 2004 that I made this very simple booting code to demonstrate how OS starts. I paste the output here for the future reference. bootsec.asm ORG 0x7c00 jmp begin_boot bootmesg1 db "Press any to boot KERNEL....." mesglen equ $ - bootmesg1 drive db 0 [BITS 16] print_mesg: mov ah, 0x13 mov… Continue reading Very very very very very simple boot up code.

module taint

static char *module_flags(struct module *mod, char *buf) { int bx = 0; if (mod->taints || mod->state == MODULE_STATE_GOING || mod->state == MODULE_STATE_COMING) { buf[bx++] = '('; if (mod->taints & (1 <taints & (1 <taints & (1 <state == MODULE_STATE_GOING) buf[bx++] = '-'; /* Show a + for module-is-being-loaded */ if (mod->state == MODULE_STATE_COMING) buf[bx++] =… Continue reading module taint