From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 3/3] xfs: allocate xfs_da_args to reduce stack footprint
Date: Thu, 20 Feb 2014 06:56:01 -0800 [thread overview]
Message-ID: <20140220145601.GC8366@infradead.org> (raw)
In-Reply-To: <1392783402-4726-4-git-send-email-david@fromorbit.com>
On Wed, Feb 19, 2014 at 03:16:42PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> The struct xfs_da_args used to pass directory/attribute operation
> information to the lower layers is 128 bytes in size and is
> allocated on the stack. Dynamically allocate them to reduce the
> stack footprint of directory operations.
Are we having stack space problems in the directory code as well,
without all the VM code above it? I'm defintively a bit scared about
adding another memory allocation to every single directory operation.
> + args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS);
> + if (!args)
> + return ENOMEM;
KM_SLEEP is the default when KM_NOFS is set. Also KM_SLEEP will never
return a NULL pointer, either remove the handling or make it an
KM_MAYFAIL allocation.
> + /*
> + * If we don't use KM_NOFS here, lockdep will through false positive
> + * deadlock warnings when we come through here of the non-transactional
> + * lookup path because the allocation can recurse into inode reclaim.
> + * Doing this avoids having to add a bunch of lockdep class
> + * annotations into the reclaim patch for the ilock.
> + */
> + args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS);
I don't understand that comment. We do use KM_NOFS here unlike what the
comment claims, and the comment seems to explain why we actually need
KM_NOFS as far as I can tell.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-02-20 14:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 4:16 [PATCH 0/3] xfs: lockdep and stack reduction fixes Dave Chinner
2014-02-19 4:16 ` [PATCH 1/3] xfs: always do log forces via the workqueue Dave Chinner
2014-02-19 18:24 ` Brian Foster
2014-02-20 0:23 ` Dave Chinner
2014-02-20 14:51 ` Mark Tinguely
2014-02-20 22:07 ` Dave Chinner
2014-02-20 22:35 ` Mark Tinguely
2014-02-21 0:02 ` Dave Chinner
2014-02-21 15:04 ` Brian Foster
2014-02-21 22:21 ` Dave Chinner
2014-02-24 13:35 ` Brian Foster
2014-02-19 4:16 ` [PATCH 2/3] xfs: fix directory inode iolock lockdep false positive Dave Chinner
2014-02-19 18:25 ` Brian Foster
2014-02-20 0:13 ` mmap_sem -> isec->lock lockdep issues with shmem (was Re: [PATCH 2/3] xfs: fix directory inode iolock lockdep false positive) Dave Chinner
2014-02-20 14:51 ` [PATCH 2/3] xfs: fix directory inode iolock lockdep false positive Christoph Hellwig
2014-02-19 4:16 ` [PATCH 3/3] xfs: allocate xfs_da_args to reduce stack footprint Dave Chinner
2014-02-19 18:25 ` Brian Foster
2014-02-20 14:56 ` Christoph Hellwig [this message]
2014-02-20 21:09 ` 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=20140220145601.GC8366@infradead.org \
--to=hch@infradead.org \
--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