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

linux½ø³ÌͨÐÅ£º¹²ÏíÄڴ棨ת£©

²ÉÓù²ÏíÄÚ´æͨÐŵÄÒ»¸öÏÔ¶øÒ×¼ûµÄºÃ´¦ÊÇЧÂʸߣ¬ÒòΪ½ø³Ì¿ÉÒÔÖ±½Ó¶ÁдÄڴ棬¶ø²»ÐèÒªÈκÎÊý¾ÝµÄ¿½±´¡£¶ÔÓÚÏñ¹ÜµÀºÍÏûÏ¢¶ÓÁеÈͨÐÅ·½Ê½£¬ÔòÐèÒªÔÚÄÚ
ºËºÍÓû§¿Õ¼ä½øÐÐËĴεÄÊý¾Ý¿½±´£¬¶ø¹²ÏíÄÚ´æÔòÖ»¿½±´Á½´ÎÊý¾Ý[1]£ºÒ»´Î´ÓÊäÈëÎļþµ½¹²ÏíÄÚ´æÇø£¬ÁíÒ»´Î´Ó¹²ÏíÄÚ´æÇøµ½Êä³öÎļþ¡£Êµ¼ÊÉÏ£¬½ø³ÌÖ®¼äÔÚ¹²
ÏíÄÚ´æʱ£¬²¢²»×ÜÊǶÁдÉÙÁ¿Êý¾Ýºó¾Í½â³ýÓ³É䣬ÓÐеÄͨÐÅʱ£¬ÔÙÖØн¨Á¢¹²ÏíÄÚ´æÇøÓò¡£¶øÊDZ£³Ö¹²ÏíÇøÓò£¬Ö±µ½Í¨ÐÅÍê±ÏΪֹ£¬ÕâÑù£¬Êý¾ÝÄÚÈÝÒ»Ö±±£´æÔÚ¹²
ÏíÄÚ´æÖУ¬²¢Ã»ÓÐд»ØÎļþ¡£¹²ÏíÄÚ´æÖеÄÄÚÈÝÍùÍùÊÇÔÚ½â³ýÓ³Éäʱ²Åд»ØÎļþµÄ¡£Òò´Ë£¬²ÉÓù²ÏíÄÚ´æµÄͨÐÅ·½Ê½Ð§ÂÊÊǷdz£¸ßµÄ¡£
LinuxµÄ2.2.xÄÚºËÖ§³Ö¶àÖÖ¹²ÏíÄڴ淽ʽ£¬Èçmmap()ϵͳµ÷Óã¬Posix¹²ÏíÄڴ棬ÒÔ¼°ÏµÍ³V¹²ÏíÄÚ´æ¡£linux·¢Ðа汾Èç
Redhat
8.0Ö§³Ömmap()ϵͳµ÷Óü°ÏµÍ³V¹²ÏíÄڴ棬µ«»¹Ã»ÊµÏÖPosix¹²ÏíÄڴ棬±¾ÎĽ«Ö÷Òª½éÉÜmmap()ϵͳµ÷Óü°ÏµÍ³V¹²ÏíÄÚ´æAPIµÄÔ­Àí¼°Ó¦

Ò»¡¢ÄÚºËÔõÑù±£Ö¤¸÷¸ö½ø³ÌÑ°Ö·µ½Í¬Ò»¸ö¹²ÏíÄÚ´æÇøÓòµÄÄÚ´æÒ³Ãæ
1¡¢
page cache¼°swap cacheÖÐÒ³ÃæµÄÇø·Ö£ºÒ»¸ö±»·ÃÎÊÎļþµÄÎïÀíÒ³Ã涼פÁôÔÚpage cache»òswap
cacheÖУ¬Ò»¸öÒ³ÃæµÄËùÓÐÐÅÏ¢ÓÉstruct pageÀ´ÃèÊö¡£struct pageÖÐÓÐÒ»¸öÓòΪָÕëmapping £¬ËüÖ¸ÏòÒ»¸östruct
address_spaceÀàÐͽṹ¡£page cache»òswap
cacheÖеÄËùÓÐÒ³Ãæ¾ÍÊǸù¾Ýaddress_space½á¹¹ÒÔ¼°Ò»¸öÆ«ÒÆÁ¿À´Çø·ÖµÄ¡£
2¡¢ÎļþÓëaddress_space½á¹¹µÄ¶ÔÓ¦£ºÒ»¸ö¾ßÌåµÄÎļþÔÚ´ò¿ªºó£¬Äں˻áÔÚÄÚ´æÖÐΪ֮½¨Á¢Ò»¸östruct
inode½á¹¹£¬ÆäÖеÄi_mappingÓòÖ¸ÏòÒ»¸öaddress_space½á¹¹¡£ÕâÑù£¬Ò»¸öÎļþ¾Í¶ÔÓ¦Ò»¸öaddress_space½á¹¹£¬Ò»¸ö
address_spaceÓëÒ»¸öÆ«ÒÆÁ¿Äܹ»È·¶¨Ò»¸öpage cache »òswap
cacheÖеÄÒ»¸öÒ³Ãæ¡£Òò´Ë£¬µ±ÒªÑ°Ö·Ä³¸öÊý¾Ýʱ£¬ºÜÈÝÒ׸ù¾Ý¸ø¶¨µÄÎļþ¼°Êý¾ÝÔÚÎļþÄÚµÄÆ«ÒÆÁ¿¶øÕÒµ½ÏàÓ¦µÄÒ³Ãæ¡£
3¡¢½ø³Ìµ÷ÓÃmmap()ʱ£¬Ö»ÊÇÔÚ½ø³Ì¿Õ¼äÄÚÐÂÔöÁËÒ»¿éÏàÓ¦´óСµÄ»º³åÇø£¬²¢ÉèÖÃÁËÏàÓ¦µÄ·ÃÎʱêʶ£¬µ«²¢Ã»Óн¨Á¢½ø³Ì¿Õ¼äµ½ÎïÀíÒ³ÃæµÄÓ³Éä¡£Òò´Ë£¬µÚÒ»´Î·ÃÎʸÿռäʱ£¬»áÒý·¢Ò»¸öȱҳÒì³£¡£
4¡¢¶ÔÓÚ¹²ÏíÄÚ´æÓ³ÉäÇé¿ö£¬È±Ò³Òì³£´¦Àí³ÌÐòÊ×ÏÈÔÚswap
cacheÖÐÑ°ÕÒÄ¿±êÒ³£¨·ûºÏaddress_spaceÒÔ¼°Æ«ÒÆÁ¿µÄÎïÀíÒ³£©£¬Èç¹ûÕÒµ½£¬ÔòÖ±½Ó·µ»ØµØÖ·£»Èç¹ûûÓÐÕÒµ½£¬ÔòÅжϸÃÒ³ÊÇ·ñÔÚ½»»»Çø
(swap area)£¬Èç¹ûÔÚ£¬ÔòÖ´ÐÐÒ»¸ö»»Èë²Ù×÷£»Èç¹ûÉÏÊöÁ½ÖÖÇé¿ö¶¼²»Âú×㣬´¦Àí³ÌÐò½«·ÖÅäеÄÎïÀíÒ³Ã棬²¢°ÑËü²åÈëµ½page
cacheÖС£½ø³Ì×îÖÕ½«¸üн


Ïà¹ØÎĵµ£º

AdeosÔÚLinuxÖеÄʵÏÖ·ÖÎö

Ô­ÎÄ£ºhttp://linux.chinaunix.net/bbs/thread-793613-1-1.html
±¾ÎÄÀ´×ÔÓÚÔ­ÎÄÄÚÈÝ£¬µ«ÊǶÔÎÄÕµÄÄÚÈÝÓë½á¹¹×öÁ˼òµ¥µ÷Õû¡£
1  ½éÉÜ
¿¼Âǵ½´ÓÓ²¼þ²ã¿ªÊ¼¹¹½¨Ò»¸ö²Ù×÷ϵͳµÄÄѶȣ¬Adeos²¢Ã»Óв¢Ã»ÓдÓÁ㿪ʼ¹¹½¨Ò»¸öÓ²¼þ³éÏó²ã£»Ä¿Ç°£¬AdeosÊÇ»ùÓÚLinuxÄÚºËʵÏֵģ¬ÕâÑùµÄ»°£¬¾Í¿ÉÒÔ½«ÏµÍ³µÄÆô¶¯ºÍ³õʼ»¯¹¤×÷¶¼ÓÉLi ......

linux shell pid

¼ÙÉèÊÇÆô¶¯Ò»¸ö rails ³ÌÐò£º
ruby script/server
ͨ³£»áÕâÑù£º
nohup ruby script/server &
°Ñ´íÎóÊä³öÁ÷Ò²¶¨Ïòµ½Õý³£Êä³öÁ÷ÖУº
nohup ruby script/server & 2 > 1 &
Òª¼Ç¼Ï pid £º
nohup ruby script/server & 2 > 1 & echo $! > tmp/pid &
¾­¹ý·´¸´µ÷ÊÔ£¬ÉÏÃæµÄÓï¾äËƺõ²»Í ......

linux ϵͳÏÂʹÓÃC³ÌÐòʵÏÖʱÖӵĺ¯Êý

#include "stdio.h"
#include "math.h"
#include "time.h"
#define INTERVAL 1  ¶¨ÒåºêµÄʱ¼ä¼ä¸ôΪ1Ãë
//
void On_Time()  //ÿһÃ뼤·¢µÄʼþ
{
   printf("now=%s\n","JJK"); 
}
void Timer()  //ʱÖӵĺ¯Êý
{  time_t newclk,oldclk;
   while(1)
 &nb ......

Linux ÅäÖÃÎļþ

·ÃÎÊÎļþ
/etc/host.conf
¸æËßÍøÂçÓòÃû·þÎñÆ÷ÈçºÎ²éÕÒÖ÷»úÃû¡££¨Í¨³£ÊÇ /etc/hosts£¬È»ºó¾ÍÊÇÃû³Æ·þÎñÆ÷£»¿Éͨ¹ý netconf ¶ÔÆä½øÐиü¸Ä£©
/etc/hosts
°üº¬£¨±¾µØÍøÂçÖУ©ÒÑÖªÖ÷»úµÄÒ»¸öÁÐ±í¡£Èç¹ûϵͳµÄ IP ²»ÊǶ¯Ì¬Éú³É£¬¾Í¿ÉÒÔʹÓÃËü¡£¶ÔÓÚ¼òµ¥µÄÖ÷»úÃû½âÎö£¨µã·Ö±íʾ·¨£©£¬ÔÚÇëÇó DNS »ò NIS ÍøÂçÃû³Æ·þÎñÆ÷֮ǰ£¬ ......

ǶÈëʽLinuxÎïÀíÄÚ´æÓ³Éä

The physical memory map for Linux is completely independent from the virtual map and is designed to maximize contiguous space. Given that the kernel image will always be at the start of DRAM, the Linux kernel maximizes contiguous space by allocating runtime memory from the end of physical DRAM movin ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ