Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux·¢Ëͺ¯Êýdev_queue_xmit·ÖÎö

µ±Éϲã×¼±¸ºÃÒ»¸ö°üÖ®ºó£¬½»¸øÏÂÃæÕâ¸öº¯Êý´¦Àí
int dev_queue_xmit(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
struct netdev_queue *txq;
struct Qdisc *q;
int rc = -ENOMEM;
/* GSO will handle the following emulations directly. */
if (netif_needs_gso(dev, skb))
goto gso;
//Ê×ÏÈÅжÏskbÊÇ·ñ±»·Ö¶Î£¬Èç¹û·ÖÁ˶β¢ÇÒÍø¿¨²»Ö§³Ö·ÖÉ¢¶ÁµÄ»°ÐèÒª½«ËùÓжÎÖØÐÂ×éºÏ³ÉÒ»¸ö¶Î
//ÕâÀï__skb_linearizeÆäʵ¾ÍÊÇ__pskb_pull_tail(skb, skb->data_len),Õâ¸öº¯Êý»ù±¾ÉϵÈͬÓÚpskb_may_pull
//pskb_may_pullµÄ×÷ÓþÍÊǼì²âskb¶ÔÓ¦µÄÖ÷bufÖÐÊÇ·ñÓÐ×ã¹»µÄ¿Õ¼äÀ´pull³ölen³¤¶È£¬
//Èç¹û²»¹»¾ÍÖØзÖÅäskb²¢½«fragsÖеÄÊý¾Ý¿½±´ÈëзÖÅäµÄÖ÷buffÖУ¬¶øÕâÀォ²ÎÊýlenÉèÖÃΪskb->datalen£¬
//Ò²¾ÍÊǻὫËùÓеÄÊý¾ÝÈ«²¿¿½±´µ½Ö÷buffÖУ¬ÒÔÕâÖÖ·½Ê½Íê³ÉskbµÄÏßÐÔ»¯
if (skb_shinfo(skb)->frag_list &&
!(dev->features & NETIF_F_FRAGLIST) &&
__skb_linearize(skb))
goto out_kfree_skb;
/* Fragmented skb is linearized if device does not support SG,
* or if at least one of fragments is in highmem and device
* does not support DMA from it.
*/
//Èç¹ûÉÏÃæÒѾ­ÏßÐÔ»¯ÁËÒ»´Î£¬ÕâÀïµÄ__skb_linearize¾Í»áÖ±½Ó·µ»Ø
//×¢ÒâÇø±ðfragsºÍfrag_list£¬
//Ç°ÕßÊǽ«¶àµÄÊý¾Ý·Åµ½µ¥¶À·ÖÅäµÄÒ³ÃæÖУ¬sk_buffÖ»ÓÐÒ»¸ö¡£¶øºóÕßÔòÊÇÁ¬½Ó¶à¸ösk_buff
if (skb_shinfo(skb)->nr_frags &&
(!(dev->features & NETIF_F_SG) || illegal_highdma(dev, skb)) &&
__skb_linearize(skb))
goto out_kfree_skb;
/* Èç¹û´Ë°üµÄУÑéºÍ»¹Ã»ÓмÆËã²¢ÇÒÇý¶¯²»Ö§³ÖÓ²¼þУÑéºÍ¼ÆË㣬ÄÇôÐèÒªÔÚÕâÀï¼ÆËãУÑéºÍ*/
if (skb->ip_summed == CHECKSUM_PARTIAL) {
skb_set_transport_header(skb, skb->csum_start -
skb_headroom(skb));
if (!dev_can_checksum(dev, skb) && skb_checksum_help(skb))
goto out_kfree_skb;
}
gso:
/* Disable soft irqs for various locks below. Also
* stops preemption for RCU.
*/
rcu_read_lock_bh();
//Ñ¡ÔñÒ»¸ö·¢ËͶÓÁУ¬Èç¹ûÉ豸ÌṩÁËselect_queue»Øµ÷º¯Êý¾ÍʹÓÃËü£¬·ñÔòÓÉÄÚºËÑ¡ÔñÒ»¸ö¶ÓÁÐ
//´ó²¿·ÖÇý¶¯¶¼²»»áÉèÖöà¸ö¶ÓÁ


Ïà¹ØÎĵµ£º

Mysql for linux mysql×Ô¶¯±¸·Ý½Å±¾

¿ÉÒÔ½«Õâ¸ö½Å±¾·Å½øcrontab£¬ËûµÄÅäÖÆÎļþÔÚ /etc/crontabÖÐÿÌìÁ賿ִÐÐÒ»´Î£¬×Ô¶¯±¸·Ý Õâ¸ö½Å±¾Ã¿Ìì×î¶àÖ»Ö´ÐÐÒ»´Î£¬¶øÇÒÖ»±£Áô×î½üÎåÌìµÄ±¸·ÝÔÚ·þÎñÆ÷ÉÏ¡£
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Powered by aspbiz
#2004-09
#Setting
#ÉèÖÃÊý¾Ý¿âÃû£¬Êý¾Ý¿âµÇ¼Ãû£¬ÃÜÂ룬±¸·Ý·¾¶£¬ÈÕ־ ......

linux ¹ÜµÀѧϰ

¹ÜµÀÊÇLinuxÖкÜÖØÒªµÄÒ»ÖÖͨÐÅ·½Ê½,ÊÇ°ÑÒ»¸ö³ÌÐòµÄÊä³öÖ±½ÓÁ¬½Óµ½ÁíÒ»¸ö³ÌÐòµÄÊäÈë,³£ËµµÄ¹ÜµÀ¶àÊÇÖ¸ÎÞÃû¹ÜµÀ,ÎÞÃû¹ÜµÀÖ»ÄÜÓÃÓÚ¾ßÓÐÇ×Ôµ¹ØϵµÄ½ø³ÌÖ®¼ä£¬ÕâÊÇËüÓëÓÐÃû¹ÜµÀµÄ×î´óÇø±ð¡£ 
ÓÐÃû¹ÜµÀ½Ðnamed pipe»òÕßFIFO(ÏȽøÏȳö)£¬¿ÉÒÔÓú¯Êýmkfifo()´´½¨¡£ 
Linux¹ÜµÀµÄʵÏÖ»úÖÆ 
ÔÚLinuxÖУ¬¹ÜµÀÊÇÒ»ÖÖ ......

LINUX½ø³ÌµÈÐÅÏ¢²é¿´

²é¿´·¢ÐаæÐÅÏ¢£º
lsb_release -a Õâ¸ö×îÏêϸ
²é¿´Äں˺ͲÙ×÷ϵͳλÊý£º
uname -a
64λ²Ù×÷ϵͳÓÐÀàËÆÐÅÏ¢£º.... x86_64 x86_64 x86_64...
32λ²Ù×÷ϵͳÓÐÀàËÆÐÅÏ¢£º.... i686 i686 i386...
²é¿´cpuÐÅÏ¢£º
more /proc/cpuinfo
²é¿´ºÍ¿ØÖÆϵͳ·þÎñ£¨Èç iptables·À»ðǽµÄ¿ªºÍ¹Ø£©£º
chkconfig ²é¿´ºÍÉ趨·þÎñÔÚ²»Í¬ ......

linux ssh ³£ÓÃÃüÁî

ssh³£ÓÃÃüÁî
Ŀ¼£º
1. Basic Instructions /»ù±¾Ö¸Áî
2. wget /ÏÂÔع¤¾ß
3. Crontab /¶¨Ê±ÈÎÎñ
4. tar/tar.gz /ѹËõÎļþ
5. vi /±à¼­Æ÷
1. Basic Instructions»ù±¾²Ù×÷ÃüÁî
ͨ³£À´Ëµ£¬Ê¹ÓÃ"$[Instructions] --help"¿ÉÒÔ»ñµÃÒÔϸ÷¸öÃüÁî[instructions]µÄ°ïÖú£¬°üº¬Æä²ÎÊýÁбíµÄ¶¨Òå¡£
-ls Áгöµ±Ç°Îļþ¼Ð ......

linux ²é¿´ CPU£¬Äڴ棬ÍøÂçÁ÷Á¿ºÍ´ÅÅÌ I/O

ʹÓÃvmstatÃüÁîÀ´²ì¿´ÏµÍ³×ÊÔ´Çé¿ö
ÔÚÃüÁîÐз½Ê½Ï£¬ÈçºÎ²é¿´CPU¡¢ÄÚ´æµÄʹÓÃÇé¿ö£¬ÍøÂçÁ÷Á¿ºÍ´ÅÅÌI/O£¿
Q: ÔÚÃüÁîÐз½Ê½Ï£¬ÈçºÎ²é¿´CPU¡¢ÄÚ´æµÄʹÓÃÇé¿ö£¬ÍøÂçÁ÷Á¿ºÍ´ÅÅÌI/O£¿
A: ÔÚÃüÁîÐз½Ê½Ï£¬
1. ²é¿´CPUʹÓÃÇé¿öµÄÃüÁî
""ÿ5ÃëË¢ÐÂÒ»´Î£¬×îÓÒ²àÓÐCPUµÄÕ¼ÓÃÂʵÄÊý¾Ý
$ vmstat 5
""top È»ºó°´Shift+P£¬°´ÕÕ½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ