How to avoid transparent_hugepage/defrag warning from mongodb?

Official MongoDB documentation gives several solutions for this issue. You can also try this solution, which worked for me: Note: Try official documentation directives if MongoDB version is greater than 3.0 Open /etc/init.d/mongod file. (if no such file you might check /etc/init.d/mongod, /etc/init/mongod.conf files – credit: the below comments) Add the lines below immediately after … Read more

Context switches much slower in new linux kernels

The solution to the bad thread wake up performance problem in recent kernels has to do with the switch to the intel_idle cpuidle driver from acpi_idle, the driver used in older kernels. Sadly, the intel_idle driver ignores the user’s BIOS configuration for the C-states and dances to its own tune. In other words, even if … Read more

Image vs zImage vs uImage

What is the difference between them? Image: the generic Linux kernel binary image file. zImage: a compressed version of the Linux kernel image that is self-extracting. uImage: an image file that has a U-Boot wrapper (installed by the mkimage utility) that includes the OS type and loader information. A very common practice (e.g. the typical … Read more

Using gdb to single-step assembly code outside specified executable causes error “cannot find bounds of current function”

Instead of gdb, run gdbtui. Or run gdb with the -tui switch. Or press C-x C-a after entering gdb. Now you’re in GDB’s TUI mode. Enter layout asm to make the upper window display assembly — this will automatically follow your instruction pointer, although you can also change frames or scroll around while debugging. Press … Read more

What are vdso and vsyscall?

The vsyscall and vDSO segments are two mechanisms used to accelerate certain system calls in Linux. For instance, gettimeofday is usually invoked through this mechanism. The first mechanism introduced was vsyscall, which was added as a way to execute specific system calls which do not need any real level of privilege to run in order … Read more

How to “hibernate” a process in Linux by storing its memory to disk and restoring it later?

I used to maintain CryoPID, which is a program that does exactly what you are talking about. It writes the contents of a program’s address space, VDSO, file descriptor references and states to a file that can later be reconstructed. CryoPID started when there were no usable hooks in Linux itself and worked entirely from … Read more

Read/write files within a Linux kernel module

You should be aware that you should avoid file I/O from within Linux kernel when possible. The main idea is to go “one level deeper” and call VFS level functions instead of the syscall handler directly: Includes: #include <linux/fs.h> #include <asm/segment.h> #include <asm/uaccess.h> #include <linux/buffer_head.h> Opening a file (similar to open): struct file *file_open(const char … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)