Date: Thu, 09 Dec 2010 16:19:05 +0100 From: Luca Pizzamiglio <l.pizzamiglio@bally-wulff.de> To: freebsd-fs@freebsd.org Subject: Softupdate on UFS and "sometimes" slow flash disk Message-ID: <4D00F369.90004@bally-wulff.de>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------010503030304070507020702 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi list, I'm writing here, hoping this is the right list. We're using a PC with a Flash PATA module (4GB, non properly a SSD). The disk is 2.8 GB used (more or less) and the root partition is around 3.8 GB. During the update/restore procedure (based on restore(8)) I encountered a "disk full message" when the procedure is around 1 GB. After this message, the procedure continues without any other problem. At the end, disk has, as usual, 1 GB available space. I investigate deeply the problem and I monitored the softdep_request_cleanup() function that frees pending blocks. In one case of my scenario it return without freeing nothing, but there are a lot of free pending blocks. After further analysis I discovered that my flash module sometimes is dramatically slow (I don't know what the controller is doing...). softdep_request_cleanup() implements a time control system. Before to free blocks, it invokes ffs_update() in a blocking manner. On my "sometimes" slow flash module this ffs_update() takes more than 2 seconds and softdep_request_cleanup() return without freeing. Other invocations are not so slow and everything is fine. I know that probably there is some problem inside my flash module, but I guess that the initialization of the time control mechanism should be made after the ffs_update(). I propose here a patch, that should correct that behavior. Best regards Luca Pizzamiglio --------------010503030304070507020702 Content-Type: text/plain; name="ffs_softdep.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ffs_softdep.c.patch" Index: ffs_softdep.c =================================================================== --- ffs_softdep.c (revision 3162) +++ ffs_softdep.c (working copy) @@ -5796,7 +5796,6 @@ ump = VTOI(vp)->i_ump; mtx_assert(UFS_MTX(ump), MA_OWNED); needed = fs->fs_cstotal.cs_nbfree + fs->fs_contigsumsize; - starttime = time_second + tickdelay; /* * If we are being called because of a process doing a * copy-on-write, then it is not safe to update the vnode @@ -5809,6 +5808,7 @@ if (error != 0) return (0); } + starttime = time_second + tickdelay; while (fs->fs_pendingblocks > 0 && fs->fs_cstotal.cs_nbfree <= needed) { if (time_second > starttime) return (0); --------------010503030304070507020702--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D00F369.90004>