tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

systems hangs with slow disk - how does FS locking work?




Hi,

I have a file system on a very slow storage (eeprom-based).
Access to the underlying eeprom happens in chunks of few hundred bytes, yet when I access the storage and copy some kB of data to the storage, the whole system hangs for many seconds.

The system uses a kernel thread to write the data passed from the eeprom-"disk"-driver to the eeprom. Communication between the driver and the kernel thread is synchronized with a mutex variable, the kernel thread is marked as MP_SAFE,

I'm trying to understand where the hanging of the system comes from:

My assumption is that the "big" data block written is devided in several small chunks (disk blocks, 512 bytes), which will then be written to disk sequentially, and with the system preempting if there's other work to do. The preemption would further delay the writes, but write speed not an issue.

Hanging of the whole system's userland while I/O is going on is, though. I haven't dived into the file system code (yet), but maybe someone familiar can give me an answer to the following question:

        Is it possible that the kernel / file system layer locks the whole
        system until *all* blocks are written to disk, instead of
        doing writes in small chunks?

FWIW, I currently use a msdos filesystem on the storage (due to less overhead than FFS), codebase is NetBSD 5.

Thanks!


 - Hubert


Home | Main Index | Thread Index | Old Index