<div dir="ltr">Hi All,<div><br></div><div>We are running a pretty (rather a very old kernel) 2.6.32. Nevertheless we do see huge latency on disk IO once system starts using swap.</div><div><br></div><div>Tweaking of various swap related variables under /proc/sys/vm did not make a big difference.</div><div>The idea is we are having big memory requirement, hence using swap is expected. Unexpected thing is that this is causing very high latency.</div><div>The precise latency happens as follows</div><div><br></div><div>swap_readpage () invokes lock_page() and then the process(thread) of interest gets scheduled out through io_schedule(), it does not run again for several seconds.</div><div><br></div><div>This occurs due to the fact another thread is writing to disk using ext3 functions, wherein it</div><div>took lock_page() and spends lot of time to write data to disk before finally invoking unlock_page().</div><div><br></div><div>top shows huge iowaits (nr_iowait). </div><div><br></div><div>Is it expected design behavior that Linux performs bad with swap particularly for disk operations?</div><div><br></div><div>Tweaking elevator algorithm, io size, block size also did not help.</div><div><br></div><div>Now we are changing ext3 mounts from data=ordered to data=writeback to see if it helps to reduce disk latency when we run into swap usage.</div><div><br></div><div>We use RAID along with LVM. We are also experimenting by removing LVM to see if improves the behaviour.</div><div><br></div><div>Any inputs will be immense help</div><div><br></div><div>Thanks,</div><div>Sudharsan</div></div>