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

linux tasklet

http://blog.chinaunix.net/u/24474/showart_227121.html
Çý¶¯³ÌÐòʹÓÃtasklet»úÖÆ
ת×Ô£ºhttp://blog.chinaunix.net/u/15169/showart.php?id=82989
Çý
¶¯³ÌÐòÔÚ³õʼ»¯Ê±£¬Í¨¹ýº¯Êýtask_init½¨Á¢Ò»¸ötasklet£¬È»ºóµ÷Óú¯Êýtasklet_schedule½«Õâ¸ötasklet·ÅÔÚ
tasklet_vecÁ´±íµÄÍ·²¿£¬²¢»½ÐѺǫ́Ïß³Ìksoftirqd¡£µ±ºǫ́Ïß³ÌksoftirqdÔËÐе÷ÓÃ__do_softirqʱ£¬»áÖ´ÐÐÔÚÖжÏ
ÏòÁ¿±ísoftirq_vecÀïÖжϺÅTASKLET_SOFTIRQ¶ÔÓ¦µÄtasklet_actionº¯Êý£¬È»ºótasklet_action±éÀú
tasklet_vecÁ´±í£¬µ÷ÓÃÿ¸ötaskletµÄº¯ÊýÍê³ÉÈíÖжϲÙ×÷¡£
 
ÏÂÃæ¶Ôº¯Êýtasklet_initºÍtasklet_schedule·ÖÎö£º
   º¯Êýtasklet_init³õʼ»¯Ò»¸ötasklet,Æä²ÎÊýtÊÇtasklet_struct½á¹¹ÃèÊöµÄtasklet,²ÎÊý(*func)ÊÇÈíÖжÏÏìÓ¦º¯Êý¡£
void tasklet_init(struct tasklet_struct *t,
    void (*func)(unsigned long), unsigned long data)
{
 t->next = NULL;
 t->state = 0;
 atomic_set(&t->count, 0);
 t->func = func;
 t->data = data;
}
Çý¶¯³ÌÐòµ÷Óú¯Êýtasklet_scheduleÀ´ÔËÐÐtasklet¡£
static inline void tasklet_schedule(struct tasklet_struct *t)
{
 if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
  __tasklet_schedule(t);
}
º¯Êý__tasklet_scheduleµÃµ½µ±Ç°CPUµÄtasklet_vecÁ´±í£¬²¢Ö´ÐÐTASKLET_SOFTIRQÈíÖжϡ£
void fastcall __tasklet_schedule(struct tasklet_struct *t)
{
 unsigned long flags;
 local_irq_save(flags);
 t->next = __get_cpu_var(tasklet_vec).list;
 __get_cpu_var(tasklet_vec).list = t;
 raise_softirq_irqoff(TASKLET_SOFTIRQ);
 local_irq_restore(flags);
}
º¯Êýraise_softirq_irqoffÉèÖÃÈíÖжÏnrΪ¹ÒÆð״̬£¬²¢ÔÚûÓÐÖжÏʱ»½ÐÑÏß³Ìksoftirqd¡£º¯Êýraise_softirq_irqoff±ØÐëÔÚ¹ØÖжÏÇé¿öÏÂÔËÐС£
inline fastcall void raise_softirq_irqoff(unsigned int nr)
{
 __raise_softirq_irqoff(nr);
 /*
  * If we're in an interrupt or softirq, we're done
  * (this also catches softirq-disabled code). We will
  * actually run the softirq once we return from
  * the irq or softirq.
  *
  *


Ïà¹ØÎĵµ£º

LINUX·ÖÒ³»úÖÆ

ÏßÐÔ—ÎïÀíµØÖ·µÄת»»£¬¿É½«ÆäÒâÒåÀ©Õ¹ÎªÔÊÐí½«Ò»¸öÏßÐÔµØÖ·±ê¼ÇΪÎÞЧ£¬¶ø²»ÊÇʵ¼ÊµØ²úÉúÒ»¸öÎïÀíµØÖ·¡£ÓÐÁ½ÖÖÇé¿ö¿ÉÄÜʹҳ±»±ê¼ÇΪÎÞЧ£ºÆäÒ»ÊÇÏßÐÔµØÖ·ÊDzÙ×÷ϵͳ²»Ö§³ÖµÄµØÖ·£»Æä¶þÊÇÔÚÐéÄâ´æ´¢Æ÷ϵͳÖУ¬ÏßÐÔµØÖ·¶ÔÓ¦µÄÒ³´æ´¢ÔÚ´ÅÅÌÉÏ£¬¶ø²»ÊÇ´æ´¢ÔÚÎïÀí´æ´¢Æ÷ÖС£ÔÚǰһÖÖÇé¿öÏ£¬³ÌÐòÒò²úÉúÁËÎÞЧµØÖ·¶ø±ØÐë±»Ö ......

Linux manÃüÁîµÄʹÓ÷½·¨

man¾ÍÊÇmanualµÄËõд£¬ÓÃÀ´²é¿´ÏµÍ³ÖÐ×Ô´øµÄ¸÷Öֲο¼Êֲᡣ
Ò»¡¢ËµÃ÷
1£¬ÊÖ²áÒ³·ÖΪºÃ¼¸¸ö²¿·Ö£¬ÈçÏÂËùʾ£º
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File fo ......

linux ipÃüÁî

ip ÊǸöÃüÁ ip ÃüÁîµÄ¹¦Äܺܶ࣡»ù±¾ÉÏËüÕûºÏÁË ifconfig Óë route ÕâÁ½¸öÃüÁ²»¹ýip µÄ¹¦ÄܸüÇ¿´ó£¡ Èç¹ûÄúÓÐÐËȤµÄ»°£¬Çë×ÔÐÐ vi /sbin/ifup ¾ÍÖªµÀÕû¸ö ifup ¾ÍÊÇÀûÓà ip Õâ¸öÃüÁîÀ´ÊµÏֵġ£ÏÂÃæ½éÉÜÒ»ÏÂʹÓ÷½·¨
[root@linux ~]# ip [option] [¶¯×÷] [ÃüÁî]
²ÎÊý£º
option £ºÉ趨µÄ²ÎÊý£¬Ö÷ÒªÓУº
   ......

linuxÄÚºËÔ´ÂëÖг£¼ûºê¶¨Òå

1. gccµÄ__attribute__±àÒïÊôÐÔ
ÒªÁ˽âLinux Kernel´úÂëµÄ·Ö¶ÎÐÅÏ¢£¬ÐèÒªÁ˽âÒ»ÏÂgccµÄ__attribute__µÄ±àÒïÊôÐÔ£¬__attribute__Ö÷ÒªÓÃÓڸıäËùÉùÃ÷»ò¶¨ÒåµÄº¯Êý»òÊý¾ÝµÄÌØÐÔ£¬ËüÓкܶà×ÓÏÓÃÓڸıä×÷ÓöÔÏóµÄÌØÐÔ¡£±ÈÈç¶Ôº¯Êý£¬noline½«½ûÖ¹½øÐÐÄÚÁªÀ©Õ¹¡¢noreturn±íʾûÓзµ»ØÖµ¡¢pure±íÃ÷º¯Êý³ý·µ»ØÖµÍ⣬²»»áͨ¹ýÆäËü ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ