Anatomy of the Linux slab allocator
Anatomy of the Linux slab allocator
Learn how Linux manages memory
M. Tim Jones, Consultant Engineer, Emulex Corp.
M. Tim Jones is an embedded software architect and the author of GNU/Linux Application Programming, AI Application Programming, and BSD Sockets Programming from a Multilanguage Perspective. His engineering background ranges from the development of kernels for geosynchronous spacecraft to embedded systems architecture and networking protocols development. Tim is a Consultant Engineer for Emulex Corp. in Longmont, Colorado.
Summary: Good operating system performance depends in part on the operating system's ability to efficiently manage resources. In the old days, heap memory managers were the norm, but performance suffered due to fragmentation and the need for memory reclamation. Today, the Linux® kernel uses a method that originated in Solaris but has been used in embedded systems for quite some time, allocating memory as objects based on their size. This article explores the ideas behind the slab allocator and examines its interfaces and their use.
Tag this!
Update My dW interests (Log in | What's this?) Skip to help for Update My dW interests
Date: 15 May 2007
Level: Intermediate
Activity: 16559 views
Comments: 0 (Add comments)
Average rating (based on 90 votes)
Dynamic memory management
The goal of memory management is to provide a method by which memory can be dynamically shared amongst a variety of users for a variety of purposes. The memory management method should do both of the following:
Minimize the amount of time required to manage the memory
Maximize the available memory for general usage (minimize management overhead)
Memory management is ultimately a zero-sum game of tradeoffs. You can develop an algorithm that uses little memory for management but takes more time to manage the available memory. You can also develop an algorithm that efficiently manages memory but uses a bit more
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍ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 ......
²»Í¬µÄ¹ú¼ÒºÍµØÇøÒòÎÄ»¯µÄ²îÒ죬ÔÚÈÕÆÚ¡¢Ê±¼äÒÔ¼°»õ±Ò·ûºÅµÈ±íʾ·½Ê½É϶¼²»ÍêÈ«Ïàͬ£¬×îΪÃ÷ÏԵľÍÊÇÓïÑÔ¡£ÓÐʱÔÚ±àдÈí¼þ¸øÓû§Ê¹ÓÃʱ£¬¿ª·¢Õß¡¢Î¬
»¤ÕßÒÔ¼°×îÖÕÓû§¿ÉÄÜ·Ö±ðÀ´×Ô²»Í¬µÄÇøÓò£¬¶øÒªÇóËûÃǾùʹÓÃͬһÖÖÓïÑÔÏÔÈ»ÊDz»Ã÷ÖªµÄ£¬Òò´Ëµ±Ò»¸ö³ÌÐò»òÕßÈí¼þ±àд¸øÈ«ÊÀ½çÈËʹÓÃʱ£¬Í¨³£·ÖΪÁ½¸ö²¿·Ö£º
¹ú¼Ê»¯ (intern ......
ÔÚLinux²Ù×÷ϵͳÏÂÐÞ¸ÄIP¡¢DNSºÍ·ÓÉÅäÖÃ
¡¡¡¡ifconfig eth0 ÐÂip
¡¡¡¡È»ºó±à¼/etc/sysconfig/network-scripts/ifcfg-eth0£¬ÐÞ¸Äip
¡¡¡¡Ò»¡¢ÐÞ¸ÄIPµØÖ·
¡¡¡¡[aeolus@db1 network-scripts]$ vi ifcfg-eth0
¡¡¡¡DEVICE=eth0
¡¡¡¡ONBOOT=yes
¡¡¡¡BOOTPROTO=static
¡¡¡¡IPADDR=219.136.241.211
¡¡¡¡NETMASK=255 ......
rhel5Óërhel4²»Í¬µÄµØ·½ÊÇ£¬rhel5ÀïûÓÐ/etc/X11/gdm/Õâ¸öĿ¼£¬rhel5µÄgdmµÄÅäÖÃÎļþ·ÅÔÚÕâÀï/usr/share/gdm/defaults.conf¡£
ÐèÒªÐ޸ĵĵط½ÈçÏ£º
ÐÞ¸Ä/usr/share/gdm/defaults.confÎļþ£¬È·±£ÀïÃæÓÐÒÔϼ¸ÐУº
Enable=true
DisplaysPerHost=10
Port=177
ÔÙÐÞ¸Ä/etc/inittabÎļþ£¬°ÑĬÈϼ¶±ð¸ÄΪ5,ÔÙ¼ÓÈëÒÔÏÂÐ ......