public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Increase the default size of the reserved blocks pool
@ 2008-09-29  8:54 Lachlan McIlroy
  2008-09-30  3:26 ` Mark Goodwin
  2008-09-30  4:11 ` Dave Chinner
  0 siblings, 2 replies; 9+ messages in thread
From: Lachlan McIlroy @ 2008-09-29  8:54 UTC (permalink / raw)
  To: xfs-dev, xfs-oss

The current default size of the reserved blocks pool is easy to deplete
with certain workloads, in particular workloads that do lots of concurrent
delayed allocation extent conversions.  If enough transactions are running
in parallel and the entire pool is consumed then subsequent calls to
xfs_trans_reserve() will fail with ENOSPC.  Also add a rate limited
warning so we know if this starts happening again.

--- a/fs/xfs/xfs_mount.c	2008-09-29 18:30:26.000000000 +1000
+++ b/fs/xfs/xfs_mount.c	2008-09-29 18:27:37.000000000 +1000
@@ -1194,7 +1194,7 @@ xfs_mountfs(
 	 */
 	resblks = mp->m_sb.sb_dblocks;
 	do_div(resblks, 20);
-	resblks = min_t(__uint64_t, resblks, 1024);
+	resblks = min_t(__uint64_t, resblks, 16384);
 	error = xfs_reserve_blocks(mp, &resblks, NULL);
 	if (error)
 		cmn_err(CE_WARN, "XFS: Unable to allocate reserve blocks. "
@@ -1483,6 +1483,7 @@ xfs_mod_incore_sb_unlocked(
 	int		scounter;	/* short counter for 32 bit fields */
 	long long	lcounter;	/* long counter for 64 bit fields */
 	long long	res_used, rem;
+	static int	depleted = 0;
 
 	/*
 	 * With the in-core superblock spin lock held, switch
@@ -1535,6 +1536,9 @@ xfs_mod_incore_sb_unlocked(
 				if (rsvd) {
 					lcounter = (long long)mp->m_resblks_avail + delta;
 					if (lcounter < 0) {
+						if ((depleted % 100) == 0)
+							printk(KERN_DEBUG "XFS reserved blocks pool depleted.\n");
+						depleted++;
 						return XFS_ERROR(ENOSPC);
 					}
 					mp->m_resblks_avail = lcounter;

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-09-30  6:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-29  8:54 [PATCH] Increase the default size of the reserved blocks pool Lachlan McIlroy
2008-09-30  3:26 ` Mark Goodwin
2008-09-30  4:25   ` Dave Chinner
2008-09-30  6:08     ` Lachlan McIlroy
2008-09-30  6:37       ` Dave Chinner
2008-09-30  4:11 ` Dave Chinner
2008-09-30  4:29   ` Dave Chinner
2008-09-30  6:19   ` Lachlan McIlroy
2008-09-30  6:40     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox