LinuxÄÚ´æ¹ÜÀíÖ®slab·ÖÅäÆ÷·ÖÎö(ÐøËÄ)
Æß£ºkmem_cache_free£¨£©µÄʵÏÖ
kmem_cache_freeÓÃÓÚ°Ñ´ÓslabÖзÖÅäµÄ¶ÔÏóÊͷŵô£¬Í¬·ÖÅäÒ»Ñù£¬ËüÊ×ÏÈ»á°ÑËü·Åµ½ACÖУ¬Èç¹ûACÂúÁË£¬Ôò°Ñ¶ÔÏóÊͷŵ½shareÁ´ÖУ¬Èç¹ûshareÒ²ÂúÁË£¬Ò²¾Í°ÑËüÊÍ·ÅÖÁslab¡£À´¿´¾ßÌåµÄ´úÂ룺
void kmem_cache_free (kmem_cache_t *cachep, void *objp)
{
unsigned long flags;
local_irq_save(flags);
__cache_free(cachep, objp);
local_irq_restore(flags);
}
º¯Êýµ÷ÓÃ__cache_free(),´úÂëÈçÏ£º
static inline void __cache_free (kmem_cache_t *cachep, void* objp)
{
struct array_cache *ac = ac_data(cachep);
check_irq_off();
//DEBUGÓ㬺öÂÔ
objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));
//Èç¹ûACÖеĶÔÏñûÓг¬¹ýÏÞÖÆ£¬ÄǾͰÑËüÊͷŵ½ACÖС£
if (likely(ac->avail < ac->limit)) {
STATS_INC_FREEHIT(cachep);
ac_entry(ac)[ac->avail++] = objp;
return;
} else {
//Èç¹ûACÖжÔÏóÊýÄ¿µ½ÁËÏÞÖµ£¬Ôòcache_flusharray£¨£©ºó£¬ÔٰѶÔÏñ¼ÓÈëACÖÐ
STATS_INC_FREEMISS(cachep);
cache_flusharray(cachep, ac);
ac_entry(ac)[ac->avail++] = objp;
}
}
Èç¹ûµ±Ç°ACÖжÔÏóÊýÒѾµ½´ïÏÞÖµ£¬¾Í»áµ÷ÓÃcache_flusharray()½«ÀïÃæµÄ¶ÔÏó“ˢД³öÈ¥¡£´úÂëÈçÏ£º
static void cache_flusharray (kmem_cache_t* cachep, struct array_cache *ac)
{
int batchcount;
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
ÖÚËùÖÜÖª£¬LinuxµÄÎļþȨÏÞÈç:
777;666µÈ£¬ÆäʵֻҪÔÚÏàÓ¦µÄÎļþÉϼÓÉÏUIDµÄȨÏÞ£¬¾Í¿ÉÒÔÓõ½¼ÓȨÏÞÈ˵ÄÉí·ÝÈ¥ÔËÐÐÕâ¸öÎļþ¡£ËùÒÔÎÒÃÇÖ»ÐèÒª½«bash¸´ÖƳöÀ´µ½ÁíÒ»¸öµØ·½£¬
È»ºóÓÃroot¼ÓÉÏUIDȨÏÞ£¬Ö»ÒªÓû§ÔËÐдËShell¾Í¿ÉÒÔÓÃÓÃrootµÄÉí·ÝÀ´Ö´ÐÐÈκÎÎļþÁË¡£
£±.LinuxÏÂÈçºÎÖªµÀij¸ö¶Ë¿ÚÔÚÔËÐÐʲô³ÌÐò
µ±ÎÒÃÇÓ ......
¼¶±ð£º ³õ¼¶
ФÎÄÅô
(xiaowp@263.net
), ˶ʿÑо¿Éú, ±±¾©Àí¹¤´óѧ¼ÆËã»úϵ
2004 Äê 2 ÔÂ 01 ÈÕ
Á÷
ýÌåÖ¸µÄÊÇÔÚÍøÂçÖÐʹÓÃÁ÷¼¼Êõ´«ÊäµÄÁ¬ÐøÊ±»ùýÌ壬ÆäÌØµãÊÇÔÚ²¥·Åǰ²»ÐèÒªÏÂÔØÕû¸öÎļþ£¬¶øÊDzÉÓñßÏÂÔØ±ß²¥·ÅµÄ·½Ê½£¬ËüÊÇÊÓÆµ»áÒé¡¢IPµç»°µÈÓ¦Óó¡ºÏ
µÄ¼¼Êõ»ù´¡¡£RTPÊǽøÐÐʵʱÁ÷ýÌå´«ÊäµÄ±ê×¼ÐÒéº ......
ÕâÊ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 ......