Mount operation is happening very slow in linux 2.6
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Mount operation is happening very slow in linux 2.6
Hi folks,
I’m having a doubt in the mounting of floppy in my application.
mount(“/dev/sdc”(source dir), ”/fdHD/0/”(Our dest dir) "vfat", l_uReadWrite | MS_SYNCHRONOUS, NULL);
This is the system call which we are using to mount to mount he floppy to our desired folder. When I use this system call it is taking much time in linux 2.6. But we are using the same code in Linux 2.4, at that time the mount operation is happening very fast.
So what I did I replaced the mount system call by system(“mount –t vfat /dev/sdc /fdHD/0/”) . Now when we transfer, the operation is happening very fast. So what is did I removed the MS_SYNCHRONOUS flag from the mount system call. So now it is working fine in 2.6 kernel.
Now my doubt is what the use of MS_SYNCHRONOUS flag is? Why removing the flag making the transfer operation very fast? whatis the effect of this flag in mounting?
What might be the reason for this? Please help me friends?
What MS_SYNCHRONOUS will do is make sure every write operation is individually carried out one at a time, and not return to whatever requested the write until after it is completed. This will include the writing steps the kernel does to carry out the mount operation itself (such as writing the last known mount date to every superblock on the file system).
Without MS_SYNCHRONOUS, write requests, along with the written data, will be queued up in kernel buffer space. This can allow smarter ordering of data blocks for more speed, as well as writing data blocks quickly enough that adjacent sectors might be written in one pass.
You might want to try your timing tests with MS_DIRSYNC, too.
But my doubt is we are using the same mount system call code in the 2.4 linux kernel and also in 2.6 linux kernel. why the mount operation is fast in 2.4 and not in 2.6?
And i'm having another doubt. when i insert my floppy into my machine with 2.6 kernel the time take to prepare the floppy takes 45 seconds of time, but in 2.4 kernel i took only 2-5 sec of time. where i'm doing mistake i don't know. whether i need to do any changes for the configuration.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.