* [PATCH] xfs: mark the xfssyncd workqueue as non-reentrant
@ 2011-12-05 8:53 Christoph Hellwig
2011-12-19 0:02 ` Dave Chinner
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2011-12-05 8:53 UTC (permalink / raw)
To: xfs
On a system with lots of memory pressure that is stuck on synchronous inode
reclaim the workqueue code will run one instance of the inode reclaim work
item on every CPU. which is not what we want. Make sure to mark the
xfssyncd workqueue as non-reentrant to make sure there only is one instace
of each running globally. Also stop using special paramater for the
workqueue; now that we guarantee each fs has only running one of each works
at a time there is no need to artificially lower max_active and compensate
for that by setting the WQ_CPU_INTENSIVE flag.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: xfs/fs/xfs/xfs_super.c
===================================================================
--- xfs.orig/fs/xfs/xfs_super.c 2011-12-02 19:39:38.190494354 +0100
+++ xfs/fs/xfs/xfs_super.c 2011-12-02 19:42:28.527160003 +0100
@@ -1641,12 +1641,12 @@ STATIC int __init
xfs_init_workqueues(void)
{
/*
- * max_active is set to 8 to give enough concurency to allow
- * multiple work operations on each CPU to run. This allows multiple
- * filesystems to be running sync work concurrently, and scales with
- * the number of CPUs in the system.
+ * We never want to the same work item to run twice, reclaiming inodes
+ * or idling the log is not going to get any faster by multiple CPUs
+ * competing for ressources. Use the default large max_active value
+ * so that even lots of filesystems can perform these task in parallel.
*/
- xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_CPU_INTENSIVE, 8);
+ xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_NON_REENTRANT, 0);
if (!xfs_syncd_wq)
return -ENOMEM;
return 0;
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: mark the xfssyncd workqueue as non-reentrant
2011-12-05 8:53 [PATCH] xfs: mark the xfssyncd workqueue as non-reentrant Christoph Hellwig
@ 2011-12-19 0:02 ` Dave Chinner
2011-12-20 16:45 ` Ben Myers
0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2011-12-19 0:02 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Mon, Dec 05, 2011 at 03:53:21AM -0500, Christoph Hellwig wrote:
> On a system with lots of memory pressure that is stuck on synchronous inode
> reclaim the workqueue code will run one instance of the inode reclaim work
> item on every CPU. which is not what we want. Make sure to mark the
> xfssyncd workqueue as non-reentrant to make sure there only is one instace
> of each running globally. Also stop using special paramater for the
> workqueue; now that we guarantee each fs has only running one of each works
> at a time there is no need to artificially lower max_active and compensate
> for that by setting the WQ_CPU_INTENSIVE flag.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Ok, I've had a look in detail at what the WQ_NON_REENTRANT flag does
and I agree that this is the correct behaviour for the xfssyncd -
only one instance per filesystem should run at any given time.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: mark the xfssyncd workqueue as non-reentrant
2011-12-19 0:02 ` Dave Chinner
@ 2011-12-20 16:45 ` Ben Myers
0 siblings, 0 replies; 3+ messages in thread
From: Ben Myers @ 2011-12-20 16:45 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Mon, Dec 19, 2011 at 11:02:27AM +1100, Dave Chinner wrote:
> On Mon, Dec 05, 2011 at 03:53:21AM -0500, Christoph Hellwig wrote:
> > On a system with lots of memory pressure that is stuck on synchronous inode
> > reclaim the workqueue code will run one instance of the inode reclaim work
> > item on every CPU. which is not what we want. Make sure to mark the
> > xfssyncd workqueue as non-reentrant to make sure there only is one instace
> > of each running globally. Also stop using special paramater for the
> > workqueue; now that we guarantee each fs has only running one of each works
> > at a time there is no need to artificially lower max_active and compensate
> > for that by setting the WQ_CPU_INTENSIVE flag.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Ok, I've had a look in detail at what the WQ_NON_REENTRANT flag does
> and I agree that this is the correct behaviour for the xfssyncd -
> only one instance per filesystem should run at any given time.
>
> Reviewed-by: Dave Chinner <dchinner@redhat.com>
FWICS this seems reasonable...
Reviewed-by: Ben Myers <bpm@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-20 16:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-05 8:53 [PATCH] xfs: mark the xfssyncd workqueue as non-reentrant Christoph Hellwig
2011-12-19 0:02 ` Dave Chinner
2011-12-20 16:45 ` Ben Myers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox