public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alex Lyakas" <alex@zadarastorage.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Danny Shavit <danny@zadarastorage.com>,
	Shyam Kaushik <shyam@zadarastorage.com>,
	bfoster@redhat.com, Yair Hershko <yair@zadarastorage.com>,
	xfs@oss.sgi.com, Christoph Hellwig <hch@infradead.org>
Subject: Re: xfs_iext_realloc_indirect and "XFS: possible memory allocation deadlock"
Date: Tue, 5 Apr 2016 21:10:06 +0300	[thread overview]
Message-ID: <77693FFEB62A474DA7F039FD92CC5304@alyakaslap> (raw)
In-Reply-To: <20150723230912.GE3902@dastard>

Hello Dave, Brian, Christoph,

We are still encountering cases, in which different IO patterns beat XFS 
preallocation schemes, resuling in highly fragmented files, having 100s of 
thousands and sometimes millions of extents. In these cases XFS tries to 
allocate large arrays of xfs_ext_irec_t structure with kmalloc, and this 
often gets into numerous retries, and sometimes triggers hung task panic 
(due to some other thread wanting to access the same file).

We made a change to call kmem_zalloc_large, which resorts to __vmalloc in 
case kmalloc fails. kmem_free is already handling vmalloc addresses 
correctly. The change is only for the allocation done in 
xfs_iext_realloc_indirect, as this is the only place, in which we have seen 
the issue.

Final code, as usual, will be in 
https://github.com/zadarastorage/zadara-xfs-pushback

Thanks,
Alex.


-----Original Message----- 
From: Dave Chinner
Sent: Friday, July 24, 2015 2:09 AM
To: Alex Lyakas
Cc: Christoph Hellwig ; Danny Shavit ; bfoster@redhat.com ; Yair Hershko ; 
Shyam Kaushik ; xfs@oss.sgi.com
Subject: Re: xfs_iext_realloc_indirect and "XFS: possible memory allocation 
deadlock"

On Thu, Jul 23, 2015 at 05:39:28PM +0200, Alex Lyakas wrote:
> Hi Dave,
> Just for completeness,  XFS speculative preallocation (that is based
> now upon the size of the last extent) can still grow up to 4Gb-8Gb
> (depending on which patches we are pulling). As a result, xfs_iozero
> can still sometimes trigger 1-2GB writes of zeros in one shot. This
> turns out to be a bit unfriendly to the drives in some
> configurations. So we have applied a custom patch to limit the
> speculative preallocation to 32Mb.

It would be much better to change xfs_zero_eof() to convert extents
beyond EOF to unwritten extents rather than zero them. That way you
still get the benefits of the large speculative prealloc but without
the zeroing overhead that wierd sparse write patterns can trigger.

I just haven't got around to doing this because it hasn't been
reported as a significant problem for anyone until now.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com 

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

  reply	other threads:[~2016-04-05 18:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23  8:18 xfs_iext_realloc_indirect and "XFS: possible memory allocation deadlock" Alex Lyakas
2015-06-23 20:18 ` Dave Chinner
2015-06-27 21:01   ` Alex Lyakas
2015-06-28 18:19     ` Alex Lyakas
2015-06-29 11:43     ` Brian Foster
2015-06-29 17:59       ` Alex Lyakas
2015-06-29 19:02         ` Brian Foster
2015-06-29 22:26     ` Dave Chinner
2015-07-06 18:47       ` Alex Lyakas
2015-07-07  0:09         ` Dave Chinner
2015-07-07  9:05           ` Christoph Hellwig
2015-07-23 15:39             ` Alex Lyakas
2015-07-23 23:09               ` Dave Chinner
2016-04-05 18:10                 ` Alex Lyakas [this message]
2016-04-05 20:41                   ` Dave Chinner
2016-04-06 16:39                     ` Alex Lyakas
2016-04-06 20:57                       ` Dave 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=77693FFEB62A474DA7F039FD92CC5304@alyakaslap \
    --to=alex@zadarastorage.com \
    --cc=bfoster@redhat.com \
    --cc=danny@zadarastorage.com \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=shyam@zadarastorage.com \
    --cc=xfs@oss.sgi.com \
    --cc=yair@zadarastorage.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