Linux ÄÚºËÈíÖжÏ(softirq)Ö´ÐзÖÎö
Linux ÄÚºËÈíÖжÏ(softirq)Ö´ÐзÖÎö
Author: sinister
Email: sinister@whitecell.org
Homepage:http://www.whitecell.org
Date: 2007-01-11
±¾ÎÄ¶Ô Linux ÄÚºËÈíÖжϵÄÖ´ÐÐÁ÷³Ì½øÐÐÁË·ÖÎö£¬²¢¾¡¿ÉÄܵĽáºÏµ±Ç°ÔË
Ðл·¾³ÏêϸµØд³öÎÒµÄÀí½â£¬µ«Õâ²¢²»±íÃ÷ÎÒµÄÀí½âÒ»¶¨ÕýÈ·¡£Õâ±¾ÊÇÂÛ̳
ÀïµÄһƪÌû×Ó£¬·¢³öÀ´ÊÇΪÁËÅ×שÒýÓñ£¬Èç¹ûÄúÔÚÔĶÁ±¾ÎÄʱ·¢ÏÖÁËÎҵĴí
Î󣬻¹ÍûµÃµ½ÄúµÄÖ¸Õý¡£
½ñÌìÎÞÒâÖп´ÁËÑÛ 2.6 Äں˵ÄÈíÖжÏʵÏÖ£¬·¢ÏÖºÍÒÔÇ°ÎÒ¿´µ½µÄ´ó²»Ïàͬ
£¨ÒÔÇ°Ò²ÊÇ×ßÂí¹Û»¨£¬²»´ó×Ðϸ£©£¬¿ÉÒÔ˵¸Ä¶¯ºÜ´ó¡£Á¬ softirq µÄµ÷ÓÃ
µã¶¼²»Ò»ÑùÁË£¬ÒÔÇ°ÊÇÈý¸öµ÷Óõ㣬½ñÌìËÑË÷ÁËÒ»ÏÂÔ´´úÂ룬·¢ÏÖÔÚ¶à³öÁË
ksoftirqd ºó£¬softirq ÔÚϵͳÖеĵ÷Óõã½öÊÇÔÚ ISR ·µ»ØʱºÍʹÓÃÁË
local_bh_enable() º¯Êýºó±»µ÷ÓÃÁË¡£Íø¿¨²¿·ÖµÄÏÔʾµ÷Óã¬ÎÒ¾õµÃÓ¦¸Ã²»
ËãÊÇϵͳÖеĵ÷Óõ㡣ksoftirqd ·µ»ØÈ¥µ÷Óà do_softirq() º¯ÊýÓ¦¸ÃÒ²Ö»
ÄÜËãÊÇÆäÖеÄÒ»¸ö·ÖÖ§£¬ÒòΪÆä±¾Éí´ÓÔ´Í·ÉÏÀ´½²Ò²»¹ÊÇÔÚ ISR ·µ»Øʱ
irq_exit() µ÷Óõġ£ÕâÑùÒ»À´¾ÍºÍǰЩÈÕ×ÓдµÄÄǷݱʼǣ¨Windows/Linux
/Solaris ÈíÖжϻúÖÆ£©Àï½éÉÜµÄ Linux Äں˲¿·ÖµÄÈíÖжÏÓгö´¦ÁË£¬¿´À´
ÒÔºóÌÖÂÛ Linux kernel ´úÂëÒ»¶¨ÒªÒÔÄں˰汾ΪǰÌ⣬Ҫ²»·ÇÂÒÁ˲»¿É¡£
µÃÂò±¾ Linux ·½ÃæµÄÊéÁË£¬Ã¿´ÎÉÏÀ´Ö±½Ó¿´Ïà¹Ø´úÂëÒ²²»ÊÇ»ØÊ£¬Ê±¼äÒ²
²»ÔÊÐí¡£
//
// do_IRQ º¯ÊýÖ´ÐÐÍêÓ²¼þ ISR ºóÍ˳öʱµ÷Óô˺¯Êý¡£
//
void irq_exit(void)
{
account_system_vtime(current);
trace_hardirq_exit();
sub_preempt_count(IRQ_EXIT_OFFSET);
//
// Åжϵ±Ç°ÊÇ·ñÓÐÓ²¼þÖжÏǶÌ×£¬²¢ÇÒÊÇ·ñÓÐÈíÖжÏÔÚ
// pending ״̬£¬×¢Ò⣺ÕâÀïÖ»ÓÐÁ½¸öÌõ¼þͬʱÂú×ã
// ʱ£¬²ÅÓпÉÄܵ÷Óà do_softirq() ½øÈëÈíÖжϡ£Ò²¾ÍÊÇ
// ˵ȷÈϵ±Ç°ËùÓÐÓ²¼þÖжϴ¦ÀíÍê³É£¬ÇÒÓÐÓ²¼þÖжϰ²×°ÁË
// ÈíÖжϴ¦ÀíʱÀíʱ²Å»á½øÈë¡£
//
if (!in_interrupt() && local_softirq_pend
Ïà¹ØÎĵµ£º
×÷ÕߣºÀîÇ¿,»ªÇåÔ¶¼ûǶÈëʽѧԺ½²Ê¦¡£
ÔÚLinuxÉ豸Çý¶¯ÖУ¬É豸ºÅÉèÒ»¸öºÜÖØÒªµÄ¸ÅÄîºÍ±äÁ¿¡£²»ÂÛÊÇÖ÷É豸ºÅ£¬»¹ÊÇ´ÎÉ豸ºÅ£¬ÔÚÉ豸Çý¶¯Öж¼Õ¼¾ÝÁ˺ÜÖØÒªµÄµØλ¡£ÄÇôËûÔÚKernelÖÐÊÇÈçºÎ²Ù×÷µÄ£¿Õâ¸öÊý¾Ý½á¹¹¶¼ÊÇͨ¹ýÄÇЩº¯Êý¿ÉÒÔºÜÈÝÒ×µÄÔÚÎÒÃÇдLinuxÉ豸Çý¶¯Ä£¿éʱ±»ÎÒÃÇËùʹÓÃÄØ£¿
ÔÚinclude/linux/type.hÎļþÖÐÎÒÃÇÄ ......
Ϊ Linux Ó¦ÓóÌÐò±àд DLL ÔÚ½ö½öÖ»»á±àд²å¼þµÄʱºòΪʲôҪ±àдÕû¸öÓ¦ÓóÌÐò£¿
ÎĵµÑ¡Ïî
´òÓ¡±¾Ò³
½«´ËÒ³×÷Ϊµç×ÓÓʼþ·¢ËÍ ¼¶±ð£º ³õ¼¶ Allen Wilson (wilsona@us.ibm.com), µç×ÓÉÌÎñÉè¼Æʦ, IBM 2001 Äê 10 Ô 01 ÈÕ ²å¼þºÍ DLL ͨ³£ÊÇÓÃÀ´ÎÞÐë±àдÕû¸öÐÂÓ¦ÓóÌÐò¶øÌí¼Ó¹¦Äܵļ ......
linux
ϵÄÎļþ½á¹¹£¬¿´¿´Ã¿¸öÎļþ¼Ð¶¼ÊǸÉÂðÓõÄ
/bin
¶þ½øÖÆ¿ÉÖ´ÐÐÃüÁî
/dev
É豸ÌØÊâÎļþ
/etc
ϵͳ¹ÜÀíºÍÅäÖÃÎļþ
/etc/rc.d
Æô¶¯µÄÅäÖÃÎļþºÍ½Å±¾
/home
Óû§Ö÷Ŀ¼µÄ»ùµã£¬±ÈÈçÓû§user
µÄÖ÷Ŀ¼¾ÍÊÇ/home/user
£¬¿ÉÒÔÓÃ~user
±íʾ
/lib
±ê×¼³ÌÐòÉè¼Æ¿â£¬Óֽж¯Ì¬Á´½Ó¹²Ïí¿â£¬×÷ÓÃÀàËÆwindows
ÀïµÄ. ......
¡¡Í¨¹ý SCSI ÃüÁî¹ÜÀí¼ÆËã»úÉϵÄÊý¾Ý£¬²¢½«Êý¾Ý´«Êäµ½ SCSI É豸¡£ÔÚ±¾ÎÄÖУ¬×÷Õß½éÉÜÁËһЩ SCSI ÃüÁÒÔ¼°ÔÚ Linux? ÖÐʹÓà SCSI API ʱִÐÐ SCSI ÃüÁîµÄ·½·¨¡£Ëû½éÉÜÁË SCSI ¿Í»§»ú/·þÎñÆ÷Ä£Ðͺʹ洢 SCSI ÃüÁîµÄ±³¾°¡£½ÓÏÂÀ´½âÊÍ Linux ͨÓà SCSI Çý¶¯Æ÷ API£¬²¢Ìṩһ¸öʾÀý£¬ÌÖÂÛʹÓÃͨÓÃÇý¶¯Æ÷Ö´ÐÐ inquiry ÃüÁîµÄÏ ......