HPC.ru lite - Все форумы
Форум: КПК и смартфоны на Linux: Zaurus, планшеты Nokia, прочее
Тема: Проблемы завруса
Страницы: 1 2 3 4 [5]
Executier [18.11.2004 15:20] :
Тааак, я, конечно, извиняюсь за оффтопик, как это async io выкинули? Вообще везде выкинули? Т.е. я, например, напишу прогу с неблокируемыми сокетами, а она во время работы возмет и заблокируется ядром? Или в cacko это пофиксили? Кроме того, висит же bdflush, разве не этот процесс все и вся синхронизирует?
maslovsky [18.11.2004 15:20] :
Кстати, Вадим, Вы на меня потратили больше времени чем требуется на доработку этого аплета или вправления ядерной таблицы. Осталось только подправить вышеуказанную мной функцию и делов-то. Я думаю, последний шаг не вызывает сомнений в свое простате?
Конечно, удивительно даже, что никто до сих пор этого не сделал. Похоже, все вокруг лохи, а ни какие не настоящие линуксоиды...
ВадимП [18.11.2004 15:32] :
Executier писал(а):
Кроме того, висит же bdflush, разве не этот процесс все и вся синхронизирует?
Скорее kupdated.
ВадимП [18.11.2004 15:48] :
ВадимП писал(а):
[quote:0832270bce="Executier"]Кроме того, висит же bdflush, разве не этот процесс все и вся синхронизирует?
Скорее kupdated.
Маленькая цитата, чтобы лучше это понимать:
When a process writes to disk, the kernel does not necessarily write the data to disk immediately. Instead, it updates its in memory copy of the block, but defers the disk update until later (an exception to this is files that are open for synchronous writing). There are two kernel threads that handle these deferred updates: bdflush and kupdate.
The bdflush thread writes updates to disk when either of two conditions occur. One condition that can cause bdflush to update the disk is when the virtual memory system is having trouble finding enough free memory to satisfy allocation requests. In this case, the VM system will ask bdflush to free pages by flushing the written data to disk (thereby freeing the buffer space used by that data). The other event that will cause bdflush to update the disk is when the fraction of dirty buffers (those containing modified data which has not been updated on disk) in the buffer cache exceeds a threshold. This is described in Documentation/filesystems/proc.txt.
The other kernel thread that deals with flushing modified data to disk is kupdate. In normal usage, kupdate periodically writes modified buffers to disk. The period is set using the fifth field in /proc/sys/vm/bdflush. The value is specified in hertz. So on most Linux systems, which use a hertz value of 100, a value of 500 in the fifth field of /proc/sys/vm/bdflush would means that kupdate will flush dirty buffers to disk every 5 seconds.
The kupdate thread supports another mode of operation as well. It listens for SIGSTOP and SIGCONT signals. On receiving a SIGSTOP signal, kupdate stops its periodic operation, and instead, waits for SIGCONT. When it receives SIGCONT, it will flush dirty buffers. A similar effect can be achieved by setting the period for kupdate to 0 instead of sending the thread SIGSTOP. This mechanism enables a user space process to implement some other policy for when buffers are flushed.
In addition to these methods for flushing buffers, processes can specifically request that buffers be flushed to disk by using the sync(), fsync(), and fdatasync() system calls.
[Тема закрыта модератором]
[< Назад]