public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Nathan Scott <nscott@aconex.com>
Cc: David Chinner <dgc@sgi.com>, xfs-dev <xfs-dev@sgi.com>,
	xfs-oss <xfs@oss.sgi.com>
Subject: Re: review: allocate bmapi args
Date: Thu, 19 Apr 2007 18:23:31 +1000	[thread overview]
Message-ID: <20070419082331.GW48531920@melbourne.sgi.com> (raw)
In-Reply-To: <1176969062.6273.169.camel@edge>

On Thu, Apr 19, 2007 at 05:51:02PM +1000, Nathan Scott wrote:
> On Thu, 2007-04-19 at 17:25 +1000, David Chinner wrote:
> > 
> > +       bma = kmem_zalloc(sizeof(xfs_bmalloca_t), KM_SLEEP);
> > +       if (!bma)
> > +               return XFS_ERROR(ENOMEM); 
> 
> I guess you meant KM_NOSLEEP? 

No, I meant a sleeping allocation. I guess that mea I don't
need the error handling....

> Are you sure this is legit though?

It *must* be. We already rely on being able to do substantial
amounts of allocation in this path....

> (are all callers going to be able to handle this?)  I'm thinking
> of the writeout paths where we're doing space allocation (unwritten
> extent conversion comes through here too) in order to free up some
> page cache so other memory allocs elsewhere can proceed.  I don't
> see any other memory allocations in this area of the code, so I
> guess I'd be treading really carefully here..

We modify the incore extent list as it grows and shrinks in this
path. It is critical that we are able to allocate at least small
amounts of memory in these writeback paths, and we currently do that
with kmem_alloc(KM_SLEEP). A quick search of the xfs_iext_*
functions shows lots of allocations are done in manipulating
the incore extents....

Then there's needing new pages in the page cache and xfs_buf_t's
if we trigger a btree split duringthe allocation, and so on.

IOWS, there's plenty of far larger allocations down through this
path already, and if any one of them doesn't succeed we are
pretty much fscked. given that we haven't had any reports of
writeback deadlocks since the new incore extent handling went
in, I think small allocations like this are not a problem.

FWIW, I have done low memory testing and I wasn't about to trigger
any problems.....

> (Oh, and why the _zalloc?  Could just do an _alloc, since previous
> code was using non-zeroed memory - so, should have been filling in
> all fields).

Habit. And it doesn't hurt performance at all - we've got to take
that cache miss somewhere along the line....

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  reply	other threads:[~2007-04-19  8:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-19  7:25 review: allocate bmapi args David Chinner
2007-04-19  7:51 ` Nathan Scott
2007-04-19  8:23   ` David Chinner [this message]
2007-04-20  4:41     ` Nathan Scott
2007-04-20  5:34       ` David Chinner

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=20070419082331.GW48531920@melbourne.sgi.com \
    --to=dgc@sgi.com \
    --cc=nscott@aconex.com \
    --cc=xfs-dev@sgi.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