public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] [RFC] xfs: introduce an allocation workqueue
Date: Thu, 14 Apr 2011 14:29:34 -0500	[thread overview]
Message-ID: <1302809374.2608.73.camel@doink> (raw)
In-Reply-To: <1302616337-29894-1-git-send-email-david@fromorbit.com>

On Tue, 2011-04-12 at 23:52 +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> We currently have significant issues with the amount of stack that
> allocation in XFS uses, especially in the writeback path. We can
> easily consume 4k of stack between mapping the page, manipulating
> the bmap btree and allocating blocks from the free list. Not to
> mention btree block readahead and other functionality that issues IO
> in the allocation path.
> 
> As a result, we can no longer fit allocation in the writeback path
> in the stack space provided on x86_64. To alleviate this problem,
> introduce an allocation workqueue and move all allocations to a
> seperate context. This can be easily added as an interposing layer
> into xfs_alloc_vextent(), which takes a single argument structure
> and does not return until the allocation is complete or has failed.
> 
> To do this, add a work structure and a completion to the allocation
> args structure. This allows xfs_alloc_vextent to queue the args onto
> the workqueue and wait for it to be completed by the worker. This
> can be done completely transparently to the caller.
> 
> The worker function needs to ensure that it sets and clears the
> PF_MEMALLOC flag appropriately as it is being run in an active
> tranѕaction context. Work can also be queued in a memory reclaim
> context, so a rescuer is needed for the workqueue.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>

Interesting.

I guess I don't see anything inherently wrong with this.
At first glance it seems like workqueue abuse.  But it's
better than rolling our own daemon to do the same thing.
(There's nothing to stop you from doing this generically
either...)

Will it shift some accounting of CPU time from user to
system?

The code looks OK to me. The idea of it makes me pause
a little, though I don't object.

					-Alex

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-04-14 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 13:52 [PATCH] [RFC] xfs: introduce an allocation workqueue Dave Chinner
2011-04-14 19:29 ` Alex Elder [this message]
2011-04-15  1:49   ` Dave Chinner
2011-06-16 17:14     ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302809374.2608.73.camel@doink \
    --to=aelder@sgi.com \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox