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

LinuxÄÚ´æ¹ÜÀíÖ®slab·ÖÅäÆ÷·ÖÎö(ÐøÈý)

Áù£ºkmem_cache_allocµÄʵÏÖ·ÖÎö:
ÎÒÃÇÔÚÉÏÃæ¿ÉÒÔ¿´µ½£¬´´½¨Ò»¸öcacheÃèÊö·ûµÄʱºò£¬²¢Ã»ÓÐÕâÖ®·ÖÅäslabÊý¾Ý¡£ÏÖÔÚÎÒÃÇÀ´¿´Ò»ÏÂÔõô´ÓcacheÖÐÉêÇë¶ÔÏó
void * kmem_cache_alloc (kmem_cache_t *cachep, int flags)
{
     return __cache_alloc(cachep, flags);
}
ʵ¼ÊÉÏ»áµ÷ÓÃ__cache_alloc
ÈçÏ£º
static inline void * __cache_alloc (kmem_cache_t *cachep, int flags)
{
     unsigned long save_flags;
     void* objp;
     struct array_cache *ac;
     //Èç¹û¶¨ÒåÁË__GFP_WAIT¡£¿ÉÄÜ»áÒýÆð˯Ãß
     cache_alloc_debugcheck_before(cachep, flags);
 
     local_irq_save(save_flags);
     //È¡µÃµ±Ç°´¦ÀíÆ÷ËùÔÚµÄarray_cache(¼ò³ÆΪAC£¬ÎÒÃÇÏÂÃæÒ²ÕâÑù³ÆºôËü)
     ac = ac_data(cachep);
     //ac->avail:ACÖеںóÒ»¸ö¿ÉÓõĶÔÏóË÷Òý
    
//Èç¹ûACÖл¹ÓпÉÓõĶÔÏó
if (likely(ac->avail)) {
         STATS_INC_ALLOCHIT(cachep);
         //ÿ´Î·ÖÅ䶼»á°Ñac->touchedÖÃΪ1
         ac->touched = 1;
         objp = ac_entry(ac)[--ac->avail];
     } else {
         //Èç¹ûACÖÐûÓпÉÓöÔÏó£¬ÄÇÖ»ÄÜ´Ól3ÖГ°á³ö”¶ÔÏóµ½ACÖÐ
         STATS_INC_ALLOCMISS(cachep);
         objp = cache_alloc_refill(cachep, flags);
     }
     local_irq_restore(save_flags);
     objp = cache_alloc_debugcheck_after(cachep, flags, objp, __builtin_return_address(0));
     return objp;
}
Ê


Ïà¹ØÎĵµ£º

linux ÃüÁî

ÖÚËùÖÜÖª£¬LinuxµÄÎļþȨÏÞÈç:
777;666µÈ£¬ÆäʵֻҪÔÚÏàÓ¦µÄÎļþÉϼÓÉÏUIDµÄȨÏÞ£¬¾Í¿ÉÒÔÓõ½¼ÓȨÏÞÈ˵ÄÉí·ÝÈ¥ÔËÐÐÕâ¸öÎļþ¡£ËùÒÔÎÒÃÇÖ»ÐèÒª½«bash¸´ÖƳöÀ´µ½ÁíÒ»¸öµØ·½£¬
È»ºóÓÃroot¼ÓÉÏUIDȨÏÞ£¬Ö»ÒªÓû§ÔËÐдËShell¾Í¿ÉÒÔÓÃÓÃrootµÄÉí·ÝÀ´Ö´ÐÐÈκÎÎļþÁË¡£
£±.LinuxÏÂÈçºÎÖªµÀij¸ö¶Ë¿ÚÔÚÔËÐÐʲô³ÌÐò

µ±ÎÒÃÇÓ ......

linux·þÎñÆ÷ÓÃlighttpd+mysql5+php5+SupeSite/X

Ò»¡¢°²×°ÏµÍ³»·¾³
1¡¢ÏµÍ³£ºcentos5
2¡¢²âÊÔÔÚvm5.5
×¼±¸Èí¼þ
lighttpd-1.4.18
ÏÂÔصØÖ·
mysql-5.0.41
part1ÏÂÔصØÖ·
part2ÏÂÔصØÖ·
part3ÏÂÔصØÖ·
php-5.2.3
ÏÂÔصØÖ·
SupeSite/X-Space
part1ÏÂÔصØÖ·
part2ÏÂÔصØÖ·
part3ÏÂÔصØÖ·
discuz
ÏÂÔصØÖ·
¶þ¡¢´î½¨web·þÎñÆ÷°²×°¹ý³Ì
1¡¢mysql5°²×°
$ tar zx ......

ÔÚLinuxÏÂÓÃbuildroot´î½¨mips/armµÄ½»²æ±àÒëƽ̨

 ÔÚLinuxÏÂÓÃbuildroot´î½¨mips/armµÄ½»²æ±àÒëƽ̨
Õâ¸ö±àÒë»·¾³ÊDz»ÄܱàÒëfor¿ªÔ´ÎÞÏß·ÓÉÆ÷µÄ³ÌÐòµÄ£¬ÒòΪÄÚºËÊÇ2.6µÄ
½¨Òé²Î¿¼Õâƪ: http://www.felix021.com/blog/read.php?1467
Ç°Á½ÌìÂòÁËNetGear WRT614 V9£¬´îÔصÄÊÇBroadcomµÄ200MHz MIPS´¦ÀíÆ÷¡£
ÓÉÓÚʹÓõÄÊÇ¿ªÔ´²Ù×÷ϵͳLinux£¬ËùÒÔ¿ÉÒÔË¢ÍøÉÏһЩNBµÄ ......

linuxÖÐELF¼ÓÔعý³Ì·ÖÎö

sys_execve
   | - do_execve
|
| - search_binary_handler         
           |- linux_binfmt= elf_format
       |- elf_format-> load_elf_binary
| -&nbs ......

Linux±ØѧµÄ60¸öÃüÁî (ת)

inux±ØѧµÄ60¸öÃüÁî
LinuxÌṩÁË´óÁ¿µÄÃüÁÀûÓÃËü¿ÉÒÔÓÐЧµØÍê³É´óÁ¿µÄ¹¤×÷£¬Èç´ÅÅ̲Ù×÷¡¢Îļþ´æÈ¡¡¢Ä¿Â¼²Ù×÷¡¢½ø³Ì¹ÜÀí¡¢ÎļþȨÏÞÉ趨µÈ¡£ËùÒÔ£¬ÔÚLinuxϵͳÉϹ¤×÷Àë²»¿ªÊ¹ÓÃϵͳÌṩµÄÃüÁî¡£ÒªÏëÕæÕýÀí½âLinuxϵͳ£¬¾Í±ØÐë´ÓLinuxÃüÁîѧÆð£¬Í¨¹ý»ù´¡µÄÃüÁîѧϰ¿ÉÒÔ½øÒ»²½Àí½âLinuxϵͳ¡£
²»Í¬Linux·¢ÐаæµÄÃüÁîÊýÁ¿² ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ