System Calls for Synchronization Control

The kernel synchronization mechanisms can be enabled from within userspace by various system calls to ensure full or partial data integrity between memory and block devices. Three basic options are available:

1. The entire cache contents can be flushed using the sync system call; in certain circumstances, this can be very time-consuming.

2. The contents of individual files (as well as the associated metadata of the inode) can be transferred to the underlying block device. The kernel provides the fsync and fdatasync system calls for this purpose. Whereas sync is normally used in conjunction with the sync system tool mentioned above, fsync and fdatasync are reserved for particular applications because the files to be flushed are selected by means of the process-specific file descriptors introduced in Chapter 8. There are therefore no generic userspace tools for writing back specific files.

3. msync is used to synchronize memory mappings.

Continue reading here: Full Synchronization

Was this article helpful?

0 0