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

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

 ¾Å£º¼¸µã²¹³ä£º
1: SlabÖÐʹÓõÄÒ³Ã涼»á¼ÓÉÏ“PG_slab”±êÖ¾£¬ÒÔ¸úÒ»°ãµÄÒ³ÃæÇø±ð¡£ÁíÍ⣬ÔÚÊÍ·ÅÄÚ´æµÄʱºò£¬¾­³£ÐèÒªÓõ½´ÓÒ³Ãæµ½slabµÄ¶ÔӦת»»¹Øϵ¡£ÄÇÊÇÔõÑù±êʶµÄÄØ£¿
¹ØÓÚ±êÖ¾£º
×¢ÒâÓÐÒÔÏ´úÂ룺
static void *kmem_getpages(kmem_cache_t *cachep, int flags, int nodeid)
{
     ……
     while (i--) {
         //Ϊ·ÖµÃµÄÿһ¸öÒ³ÃæÉèÖÃPG_slab±êÖ¾
         SetPageSlab(page);
         page++;
     }
……
}
¹ØÓÚ´ÓÒ³Ãæµ½slabµÄת»»£º
  Ïò»ï°éϵͳÇëÇóÄÚ´æ
static int cache_grow (kmem_cache_t * cachep, int flags)
{
     ……
     //ÇëÇóÄÚ´æ¹ýºó£¬ÉèÖÃÄÚ´æÊôÐÔ
set_slab_attr(cachep, slabp, objp);
……
}
static void set_slab_attr(kmem_cache_t *cachep, struct slab *slabp, void *objp)
{
     int i;
     struct page *page;
     //¼ÆËãÒ³Ãæ×ÜÊý
     i = 1 << cachep->gfporder;
     //ÐéÄâµØַת»»³ÉÏàÓ¦Ò³Ãæ
     page = virt_to_page(objp);
     do {
         // #define    SET_PAGE_CACHE(pg,x)  ((pg)->lru.next = (struct list_head *)(x))
         SET_PAGE_CACHE(page, cachep);
         #define  SET_PAGE_SLAB(pg,x)   ((pg)->lru.prev = (struct list_head *)(x))
         SET_PAGE_SLAB(page, slabp);
         page++;
     } while (--i);
}
´ÓÉÏÃæµÄº¯


Ïà¹ØÎĵµ£º

°²×°ATI LinuxÏÔ¿¨Çý¶¯

LINUX´ó¶à·¢ÐаæĬÈÏ°²×°¶¼Ã»ÓÐ×°ÏÔ¿¨3DÇý¶¯£¬ÐëÊÖ¹¤°²×°¡£
ATI ÏÔ¿¨µÄLinuxÇý¶¯³£¼ûµÄÓÐÁ½ÖÖ£ºATI catalyst drivers ºÍ open source RadeonHD drivers¡£ATI catalyst driversÊǹٷ½Ö§³ÖµÄ°æ±¾£¬Ö§³Ö´ó¶àÊýATIÏÔ¿¨£¬¿ÉÒÔÔÚ http://support.amd.com/us/gpudownload/Pages/index.aspx Ñ¡Ôñ¶ÔÓ¦µÄ°æ±¾ÏÂÔØ¡£
ÏÂÃæÊÇATI Catal ......

½¨Á¢»ùÓÚlinuxµÄMIPS½»²æ±àÒë»·¾³

 ×÷Õߣº·ëÀÚ (flw10000) MAIL£ºflw10000 AT 163.com
¾­¹ý½üÒ»ÖܵÄæºõ£¬°Ñ»ùÓÚlinuxµÄMIPS½»²æ±àÒë»·¾³»ù±¾´î½¨³É¹¦£¬ÕâÀï˵"»ù±¾"´î½¨³É¹¦ÊÇÒòΪ»·¾³ËäÈ»´î½¨ºÃÁË£¬¿ÉÒÔ±àÒë»ùÓڣͣɣУӵĿÉÖ´ÐÐÎļþÁË£¬µ«»¹Ã»ÓÐÔÚÕæÕýµÄ£Í£É£Ð£Ó»·¾³Ï²âÊÔ¹ý£¬»¹ÓÐÔÚ±àÒëµÄ¹ý³ÌÖгöÏÖÁËЩÎÊÌ⣬ËäÈ»½â¾öÁË£¬Ò²ÒòûÓÐÔÚÕæÕýµÄ£Í£É£ ......

Linuxϵͳ³ÌÐòÆô¶¯Òýµ¼¹ý³ÌÏêϸÆÊÎö

 LinuxµÄÒ»¸öÎüÒýÈ˵ÄÌØÐÔ¾ÍÊÇÓû§¿ÉÒÔ×ÔÐж¨ÖÆÕû¸öϵͳ£¬Äã¿ÉÊÇÔËÐÐÒ»¸öÖ»ÓÐ1MµÄ“ÃÔÄã”Linux£¬Ò²¿ÉÒÔÔËÐÐÒ»¸ö¼¸GµÄÇ¿´óLinux¡£¶øÎÞÂÛÄãÔËÐÐÔõÑùµÄLinux£¬Ä㶼ÊÇÏÈ´ÓÒýµ¼³ÌÐò¿ªÊ¼ÔËÐеġ£¶ÔÓÚÆÕͨÓû§£¬´ó¶à¶¼ÊÇÔÚ¸öÈ˵çÄÔÉÏÔËÐÐLinuxµÄ¡£
¡¡¡¡¸öÈ˵çÄÔ£¬ÓÖ½ÐPC»ú£¬ÊÇÎÒÃdz£¼ûµÄʹÓÃIntel»òAMDµÄоƬµÄµç ......

Linux Shell

 ShellÊÇϵͳµÄÓû§½çÃ棬ÌṩÁËÓû§ÓëÄں˽øÐн»»¥²Ù×÷µÄÒ»ÖÖ½Ó¿Ú¡£Ëü½ÓÊÕÓû§ÊäÈëµÄÃüÁî²¢°ÑËüËÍÈëÄÚºËÈ¥Ö´ÐС£
¡¡¡¡Êµ¼ÊÉÏShellÊÇÒ»¸öÃüÁî½âÊÍÆ÷£¬Ëü½âÊÍÓÉÓû§ÊäÈëµÄÃüÁî²¢ÇÒ°ÑËüÃÇË͵½Äںˡ£²»½öÈç´Ë£¬ShellÓÐ×Ô¼ºµÄ±à³ÌÓïÑÔÓÃÓÚ¶ÔÃüÁîµÄ±à¼­£¬ËüÔÊÐíÓû§±àдÓÉshellÃüÁî×é³ÉµÄ³ÌÐò¡£Shell±à³ÌÓïÑÔ¾ßÓÐÆÕͨ±à³ÌÓ ......

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


Æߣºkmem_cache_free£¨£©µÄʵÏÖ
kmem_cache_freeÓÃÓÚ°Ñ´ÓslabÖзÖÅäµÄ¶ÔÏóÊͷŵô£¬Í¬·ÖÅäÒ»Ñù£¬ËüÊ×ÏÈ»á°ÑËü·Åµ½ACÖУ¬Èç¹ûACÂúÁË£¬Ôò°Ñ¶ÔÏóÊͷŵ½shareÁ´ÖУ¬Èç¹ûshareÒ²ÂúÁË£¬Ò²¾Í°ÑËüÊÍ·ÅÖÁslab¡£À´¿´¾ßÌåµÄ´úÂ룺
void kmem_cache_free (kmem_cache_t *cachep, void *objp)
{
     unsi ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ