public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: Ben Myers <bpm@sgi.com>, Alex Elder <elder@kernel.org>,
	David Chinner <dchinner@redhat.com>,
	xfs@oss.sgi.com
Subject: Re: [PATCH v2] xfs: Fix overallocation in xfs_buf_allocate_memory()
Date: Wed, 20 Jun 2012 02:39:01 -0400	[thread overview]
Message-ID: <20120620063901.GA14760@infradead.org> (raw)
In-Reply-To: <1338935546-3914-1-git-send-email-jack@suse.cz>

On Wed, Jun 06, 2012 at 12:32:26AM +0200, Jan Kara wrote:
> Commit de1cbee which removed b_file_offset in favor of b_bn introduced a bug
> causing xfs_buf_allocate_memory() to overestimate the number of necessary
> pages. The problem is that xfs_buf_alloc() sets b_bn to -1 and thus effectively
> every buffer is straddling a page boundary which causes
> xfs_buf_allocate_memory() to allocate two pages and use vmalloc() for access
> which is unnecessary.
> 
> Dave says xfs_buf_alloc() doesn't need to set b_bn to -1 anymore since the
> buffer is inserted into the cache only after being fully initialized now.
> So just make xfs_buf_alloc() fill in proper block number from the beginning.

Looks good.  The b_io_length initialization in xfs_buf_get can also be
removed, but as that's a cosmetic change it can way for 3.6.

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

  reply	other threads:[~2012-06-20  6:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05 22:32 [PATCH v2] xfs: Fix overallocation in xfs_buf_allocate_memory() Jan Kara
2012-06-20  6:39 ` Christoph Hellwig [this message]
2012-06-20  6:41 ` 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=20120620063901.GA14760@infradead.org \
    --to=hch@infradead.org \
    --cc=bpm@sgi.com \
    --cc=dchinner@redhat.com \
    --cc=elder@kernel.org \
    --cc=jack@suse.cz \
    --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