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

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

 Î壺kmem_cache_create£¨£©·ÖÎö
ÎÒÃÇÒÔÒ»¸öÀý×ÓÀ´¸ú×Ù·ÖÎöÒ»ÏÂslabµÄ»úÖÆ£º
ÏÂÃæÊÇÒ»¸ö²âÊÔÄ£¿éµÄ´úÂ룺
#include <linux/config.h>
#include <linux/module.h>
#include <linux/slab.h>
 
MODULE_LICENSE("GPL");
MODULE_AUTHOR("ericxiao <xgr178@163.com>");
MODULE_DESCRIPTION("slab test module");
 
static kmem_cache_t *test_cachep = NULL;
struct slab_test
{
       int val;
};
 
void fun_ctor(struct slab_test *object , kmem_cache_t *cachep , unsigned long flags )
{
                printk("in ctor fuction ...\n");
                object->val = 1;
}
 
void fun_dtor(struct slab_test *object , kmem_cache_t *cachep , unsigned long flags)
{
     printk("in dtor fuction ...\n");
     object -> val = 0;
}
 
static int __init init(void)
{
       struct slab_test *object = NULL;
       printk("slab test moudle init ... \n");
       test_cachep = kmem_cache_create("test_cachep",sizeof(struct slab_test),0,SLAB_HWCACHE_ALIGN, \
                    fun_ctor, fun_dtor);
       if(!test_cachep)
                        return;            
       object = kmem_cache_alloc( test_cachep, GFP_KERNEL );
       if(object)
       {
   &


Ïà¹ØÎĵµ£º

Linux¿ØÖÆ̨,ÖÐÎÄÏÔʾ,ÖÐÎÄÊäÈë

 Ò»¡¢Ç°ÑÔ
       
Linux×î³õµÄ¿ª·¢ÍêÈ«ÊÇΧÈÆASCII±àÂëÌåϵ½øÐеģ¬Ã»Óп¼ÂÇ·ÇÓ¢ÓïÓû§ÃæÁÙµÄÎÊÌ⣬Òò´Ëµ¼ÖÂÆäʹÓÃÃż÷½Ï¸ß£¬ÓÈÆä¶ÔÓÚÑÇÖÞÓû§¶øÑÔ£¬ÓÉÓÚ²ÉÓÃÏóÐÎ
ÎÄ×ÖµÄÌØÊâÐÔ£¨°üÀ¨ÖÐÎÄ¡¢º«ÎÄ¡¢ÈÕÎÄ£¬¼ò³ÆΪCJK£©£¬Ê¹µÃ¶ÔLinux½øÐб¾µØ»¯¸üΪÀ§ÄÑ¡£ÔÚÕâÑùµÄ±³¾°Ï£¬ejoyµÈÈË·¢Æð ......

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

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

ÈçºÎ³ÉΪһ¸öLinuxϵͳÄں˿ª·¢Õß

¡¡¡¡ÄãÏë³ÉÖªµÀÈçºÎ³ÉΪһ¸öLinuxÄں˿ª·¢Õßô£¿»òÕßÄãµÄÀÏ°å¸æËßÄ㣬“ȥΪÕâ¸öÉ豸дһ¸öLinuxÇý¶¯¡£“ÕâƪÎĵµµÄÄ¿µÄ£¬¾ÍÊÇͨ¹ýÃèÊöÄãÐèÒª¾­ÀúµÄ¹ý³ÌºÍÌáʾÄãÈçºÎºÍÉçÇøÒ»Æð¹¤×÷£¬À´½Ì¸øÄãΪ´ïµ½ÕâЩĿµÄËùÐèÒªÖªµÀµÄËùÓÐ֪ʶ¡£±¾ÎÄÒ²³¢ÊÔ½âÊÍÉçÇøΪʲôÕâÑù¹¤×÷µÄһЩԭÒò¡£
¡¡¡¡Äں˼¸ºõÈ«ÊÇÓÃCд³ÉµÄ£¬ÓÐ ......

»Ø¹Ë£º¶«¾©LinuxÄں˴ó»áºÏÓ°£¬NoÅ®ÐÔ

 ÕâÊdzöϯÔÚ2009Äê10ÔÂ20ÈÕÔÚ¶«¾©¾ÙÐеÄLinuxÄں˴ó»áºÏÓ°ÕÕ¡£È«·Ö±æÂÊÕÕƬ¡£Ò»¸öÅ®ÐÔ¶¼Ã»ÓС£ÄãÈÏʶÆäÖеļ¸Î»ÄØ£¿
ÒÔÏÂÊdzöϯ»áÒéµÄÃûµ¥£¬ÓÐÐËȤµÄÅóÓÑ¿ÉÒÔ¶ÔÒ»¶Ô£º
Al Viro
Alan Cox
Andi Kleen
Andrew Morton
Andy Whitcroft
Arjan van de Ven
Arnd Bergmann
Avi Kivity
Benjamin Herrenschmidt
Brian ......

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

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