-
Are malloc() and free() functions thread-safe?
Recently, someone asked me why he can’t allocated enough memory with a lot of thread functions. At first, I just tried to explain that there is no problem in Linux kernel or malloc() functions. But, when double checked his code, I found that he used malloc() without any safeguard. Yeah, no synchronization around malloc(). Sigh. […]
-
At the year’s end
When I recall the year at the end, it was really remarkable year. First of all, I got a new job and it is really suitable to me. I love current my position, especially about the philosophy of our company. In this company, I met a lot of good people. They helped me in a […]
-
Meaning of /proc/stat
What are the meanings of each field in /proc/stat file? Some documents said that each field represented in jiffies, but actually it isn’t. It was true on kernel 2.4, but no more in kernel 2.6. We can easily see the meaning of each field at the kernel source. http://lxr.linux.no/linux+v2.6.27.10/fs/proc/proc_misc.c static int show_stat(struct seq_file *p, void […]
-
Unix Top command
If you are unix guys, you know well about ‘top’ command which display very useful information about the system usage. I also used this a lot during check the system states. But, in recent, one of my customer asked me about the difference between ‘CPU states:’ field and each process’s cpu usage. He asked why […]
-
What happened in my stack?
If you write a program which requires a big chunk of memory at the time, you will notice the influences of ‘stack size’. I will show you what will happen in this stack limitation with the following simple program. #include <stdio.h> #include <malloc.h> int main() { char *a; unsigned long i, half_gb = 512 * […]
-
Lucky by Jason Mraz ft. Colbie Caillat
I love this song very much. Do you hear me? I’m talking to you Across the water Across the deep blue ocean Under the open sky Oh my and baby I’m trying Boy I hear you in my dreams I feel your whisper across the sea I keep you with me in my heart You […]
-
Test from the iPod Touch
After bought this highly well-known gadget, I was busy to test every possibilities it can do. And now I am writing this blog post on iPod touch. Great, isn’t it? Not just music and movie player anymore. We can do even work on it because it provides VPN. I can read and write company e-mail […]
-
How to set the pattern of core file
Sometimes, when application’s going wrong, core files are created. This is useful for the debugging purpose. If you want to make core file with the ‘core.%pid’ format, you should set the following parameters in the sysctl configuration. kernel.core_pattern = core kernel.core_uses_pid = 1 You also need to change the limit of the core file size […]
-
What is the meaning of the tcp_max_tw_buckets?
You can find the file named /proc/sys/net/ipv4/tcp_max_tw_buckets. In the kernel-doc, it explained something like following messages. tcp_max_tw_buckets – INTEGER Maximal number of timewait sockets held by system simultaneously. If this number is exceeded time-wait socket is immediately destroyed and warning is printed. This limit exists only to prevent simple DoS attacks, you _must_ not lower […]
-
How many files can be opened on my linux machine at a time?
Basically, each process has a limit as 1024. You can check and change this with ulimit command. However, it does not change the overall counts of opened files on the machine. This is done with /proc/sys/fs/files-max. This file’s value is set dynamically with available memory on the boot time, but, you change this later. Related […]
-
ARP table update problem
Have you ever seen any problem with ARP table caching? What will happen if node A have two NIC with same IP. At first, just one of them is active and got a IP. If something is going wrong, the second NIC become active and request the same IP and node operate without hanging. This […]
-
do_coredump()
In linux v2.4.31, creation of coredump looks something like this. 1127int do_coredump(long signr, struct pt_regs * regs) 1128{ 1129 struct linux_binfmt * binfmt; 1130 char corename[CORENAME_MAX_SIZE + 1]; 1131 struct file * file; 1132 struct inode * inode; 1133 int retval = 0; 1134 int fsuid = current->fsuid; 1135 1136 lock_kernel(); 1137 binfmt = current->binfmt; […]
You must be logged in to post a comment.