<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-7">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Den me mperdepses katholou (isws ligo - apo tin apopsi tou giati to
sxediasan etsi :-).<br>
<br>
Oraios. OK. Eftaristw poly gia to xrono pou dietheses.<br>
Twra ksekatharizoun merika pragmata..<br>
<br>
A.<br>
<br>
V13 wrote:<br>
<blockquote type="cite" cite="mid200309180006.40493.v13@priest.com">
<pre wrap="">On Wednesday 17 September 2003 14:13, Antonis Sidiropoulos wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Mia pou efere i koubenta prin sxetika me to top:
Ti akribws einai to cached memory kai buffered memory pou dixnei?
Ypothetw oti to cache einai h klasiki cache tou file system
kai to buffered einai to synolo twn buffers pou exoun oi diafores
processes (pou prokyptoun apo printf kai tetoia, pou pernoun apo buffer).
</pre>
</blockquote>
<pre wrap=""><!---->
Oxi.. Ta stixia poy blepeis stin free einai toy kernel. Oi buffers poy
anafereis gia ta processes (tis printf klp) ylopoioyntai meso tis glibc kai
einai
a) proeretikoi (sxetiko ayto),
b) user-level / per-process
Ta parakato mporei na einai anakribi:
Oi buffers einai ta raw blocks poy diabazei apo toys diskoys. An p.x. baleis
mesa ena CD kai to diabaseis olo sector by sector oi buffers soy tha
ayksithoyn.
H cache xorizetai se 2: Sthn 'geniki' cache kai sthn swap cache.
H 'geniki' cache exei na kanei me arxeia pleon kai oxi me raw blocks.
H swap cache einai h cache toy swap. Otan yparxoyn dedomena mesa sto swap ta
opoia yparxoyn kai stin mnimi kai DEN einai 'dirty' (se polla eisagogika
ayto) (diladi otan ston disko kai sti mnimi exei akribos ta idia), tote h
mnimi ayti onomazetai swap cache kai einai apla boithitiki.. mporei na
apodesmeytei xoris deyteri skepsi.
=====
Stin praksi tora... (poio low-level)
Min nomiseis oti paei disk -> buffers -> cache -> user....
Paei disk -> cache/buffers -> user
Otidipote diabazeis apo to disko einai cache/buffers... (ston kernel
onomazetai page cache)
Oti exei na kanei me to swap einai swapcache.
Oti exei na kanei me arxeia, opos read, mmap klp klp onomazetai cache.
Stin cache apothikevontai kai alla pragmata opos h cache gia ta inodes, ta
dirs k.a. (Den ksero pia akribos, alla nomizo einai otidipote thelei na kanei
kapoioy eidoys caching)
=====
one more time:
Otan diabazeis kati apo to disko einai page cache gia ton kernel kai
taytoxrona kai buffers. An prokeitai gia file read h kati allo to opoio kanei
caching (ektos apo raw block i/o) to metonomazei se cache.
p.x:
* An kaneis dd if=/dev/hda of=/dev/null tote h cache soy den tha alaksei
katholoy eno oi buffers soy tha ayksithoyn.
* An kaneis cat /vmlinuz > /dev/null tote tha megalosei h cache soy.
An deis to linux/fs/proc/proc_misc.c ayta poy anaferei to /proc/meminfo einai:
buffers: i.bufferram,
cache: get_page_cache_size()-total_swapcache_pages-i.bufferram
swapcache: total_swapcache_pages
ap'opoy fainetai oti yparxei h page cache kai san cache anaferetai h
page_cache meion tin swapcache kai toys buffers.
Gia toy logoy to alithes, sto linux/Documentation/filesystems/proc.txt leei:
(perigrafontas to /proc/meminfo)
Buffers: Relatively temporary storage for raw disk blocks
shouldn't get tremendously large (20MB or so)
Cached: in-memory cache for files read from the disk (the
pagecache). Doesn't include SwapCached
SwapCached: Memory that once was swapped out, is swapped back in but
still also is in the swapfile (if memory is needed it
doesn't need to be swapped out AGAIN because it is already
in the swapfile. This saves I/O)
</pre>
<blockquote type="cite">
<pre wrap="">Se ena allo omws mixanaki me 2 CPUs, koitakste:
4:42pm up 1 day, 2:12, 4 users, load average: 0.07, 0.04, 0.01
85 processes: 83 sleeping, 1 running, 1 zombie, 0 stopped
CPU states: 0.1% user, 1.2% system, 0.0% nice, 98.5% idle
Mem: 776728K av, 744988K used, 31740K free, 30936K shrd, *410828K buff*
Swap: 1004020K av, 6008K used, 998012K free 185044K cached
410MB buffered.... Poso fysiologiko einai auto re paidia?
kai malista se katastasi ousiastika ypnou, xwris na trexei kati sobaro,
ektos apo
ena http,mysql kai sendmail ...
</pre>
</blockquote>
<pre wrap=""><!---->
To mixanima ayto exei poly mnimi kai den tin xrisimopoiei.. oi buffers poy
fainontai mporei na einai etsi gia poly kairo. Mipos etrekse kanena fsck otan
ekane boot ?
</pre>
<blockquote type="cite">
<pre wrap="">A.
</pre>
</blockquote>
<pre wrap=""><!----><<V13>>
p.s. Elpizo na min se mperdepsa
</pre>
</blockquote>
<br>
</body>
</html>