原创 linux 進程調度策略

 Scheduling Policies The operating system supports four scheduling policies for threads. A thread object's schedulin

原创 TCP receive_queue prequeue backlog

接收到數據包時struct sock *sk 可能被進程下上文或者中斷上下文佔用: 1、如果被進程上下文使佔用時,軟中斷暫時拿不到鎖,所以數據只能暫存在後備隊列中(backlog),當進程上下文邏輯處理完成後會回調tcp_v4_do_rc

原创 linux kernel 2.6.35中RFS特性詳解

本文鏈接地址: linux kernel 2.6.35中RFS特性詳解 前面我介紹過google對內核協議棧的patch,RPS,它主要是爲了軟中斷的負載均衡,這次繼續來介紹google 的對RPS的增強path RFS(rece

原创 數據包在用戶空間的狀態

就象前面說的,包的狀態依據IP所包含的協議不同而不同,但在內核外部,也就是用戶空間裏,只有4種 狀態:NEW,ESTABLISHED,RELATED 和INVALID。它們主要是和狀態匹配一起使用。下面就簡要地介紹以下這幾種狀態: Ta

原创 Coping with the TCP TIME-WAIT state on busy Linux servers

Coping with the TCP TIME-WAITstate on busy Linux servers Vincent Bernat February 24, 2014 Also available in   Fr

原创 C 語言 類型強制轉換問題

 C語言編程經常存在計算時隱藏類型轉換問題,下面是轉換規則:         高          double    ←←   float        ↑          ↑                    ↑      

原创 MTU與MSS的關係

網上看到一張MTU與MSS關係圖,非常直觀,圖如下:     

原创 Blind Data Injection Attack

     TCP has historically been considered to be protected against spoofedoff-path packet injection attacks by relying o

原创 兩個單鏈表合併

#include <stdlib.h> #include <stdio.h> typedef struct listchain{ int value; struct listchain *next; }List; List *ma

原创 linx x86 彙編

0000000000400474 <add>: #include <stdio.h> int add(int x, int y) {   40047

原创 Hybrid Start(混合慢啓動)

    Standard slow start does not work well under large bandwidth-delay product (BDP) networks. We find two causes of th

原创 校驗和計算

#include <stdlib.h> #include <stdio.h> typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef unsi

原创 Linux Per-CPU Data

Linux Per-CPU Data Reasons for Using Per-CPU Data There are a couple benefits to using per-CPU data.The first is the re

原创 svn微型服務器搭建

    在日常的軟件開發中,有的時候需要自己搭建微型svn服務器用於代碼管理,下面是微型svn服務器的搭建方法: 1、創建svn根目錄: [root@localhost myfec-bic-svn]# mkdir wmp [root@l

原创 判斷一個整數是否是n^m次方類型數據,並比較乘法和除法性能差異

求取a = n^m #include <stdlib.h> #include <stdio.h> #include <ctype.h> int testnum(int num, int base) { if (num <= 0 |