All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: cmm@us.ibm.com, tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH -V3 04/11] ext4: Add percpu dirty block accounting.
Date: Thu, 09 Oct 2008 23:58:27 -0500	[thread overview]
Message-ID: <48EEE0F3.8060006@redhat.com> (raw)
In-Reply-To: <20081010045211.GC4301@skywalker>

Aneesh Kumar K.V wrote:

> Can you test this patch

This does fix my 10G-fallocate testcase.

-Eric

> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 64eeb9a..6e81c38 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -2800,7 +2800,7 @@ void exit_ext4_mballoc(void)
>   */
>  static noinline_for_stack int
>  ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
> -				handle_t *handle)
> +				handle_t *handle, unsigned long reserv_blks)
>  {
>  	struct buffer_head *bitmap_bh = NULL;
>  	struct ext4_super_block *es;
> @@ -2893,7 +2893,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
>  	/*
>  	 * Now reduce the dirty block count also. Should not go negative
>  	 */
> -	percpu_counter_sub(&sbi->s_dirtyblocks_counter, ac->ac_b_ex.fe_len);
> +	percpu_counter_sub(&sbi->s_dirtyblocks_counter, reserv_blks);
>  	if (sbi->s_log_groups_per_flex) {
>  		ext4_group_t flex_group = ext4_flex_group(sbi,
>  							  ac->ac_b_ex.fe_group);
> @@ -4284,12 +4284,13 @@ static int ext4_mb_discard_preallocations(struct super_block *sb, int needed)
>  ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
>  				 struct ext4_allocation_request *ar, int *errp)
>  {
> +	int freed;
>  	struct ext4_allocation_context *ac = NULL;
>  	struct ext4_sb_info *sbi;
>  	struct super_block *sb;
>  	ext4_fsblk_t block = 0;
> -	int freed;
> -	int inquota;
> +	unsigned long inquota;
> +	unsigned long reserv_blks;
>  
>  	sb = ar->inode->i_sb;
>  	sbi = EXT4_SB(sb);
> @@ -4308,6 +4309,8 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
>  			return 0;
>  		}
>  	}
> +	/* Number of reserv_blks for both delayed an non delayed allocation */
> +	reserv_blks = ar->len;
>  	while (ar->len && DQUOT_ALLOC_BLOCK(ar->inode, ar->len)) {
>  		ar->flags |= EXT4_MB_HINT_NOPREALLOC;
>  		ar->len--;
> @@ -4353,7 +4356,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
>  	}
>  
>  	if (likely(ac->ac_status == AC_STATUS_FOUND)) {
> -		*errp = ext4_mb_mark_diskspace_used(ac, handle);
> +		*errp = ext4_mb_mark_diskspace_used(ac, handle, reserv_blks);
>  		if (*errp ==  -EAGAIN) {
>  			ac->ac_b_ex.fe_group = 0;
>  			ac->ac_b_ex.fe_start = 0;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2008-10-10  4:58 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-27 15:28 [PATCH -V3 01/11] percpu_counters: make fbc->count read atomic on 32 bit architecture Aneesh Kumar K.V
2008-08-27 15:28 ` [PATCH -V3 02/11] ext4: Make sure all the block allocation paths reserve blocks Aneesh Kumar K.V
2008-08-27 15:28   ` [PATCH -V3 03/11] ext4: Retry block reservation Aneesh Kumar K.V
2008-08-27 15:28     ` [PATCH -V3 04/11] ext4: Add percpu dirty block accounting Aneesh Kumar K.V
2008-08-27 15:28       ` [PATCH -V3 05/11] ext4: Switch to non delalloc mode when we are low on free blocks count Aneesh Kumar K.V
2008-08-27 15:28         ` [PATCH -V3 06/11] ext4: Update meta-data reservation with delalloc Aneesh Kumar K.V
2008-08-27 15:28           ` [PATCH -V3 07/11] ext4: request for blocks with ar.excepted_group = -1 Aneesh Kumar K.V
2008-08-27 15:28             ` [PATCH -V3 08/11] ext4: Signed arithematic fix Aneesh Kumar K.V
2008-08-27 15:28               ` [PATCH -V3 09/11] ext4: Fix ext4 nomballoc allocator for ENOSPC Aneesh Kumar K.V
2008-08-27 15:28                 ` [PATCH -V3 10/11] ext4: Add inode to journal handle after block allocation for ordered mode Aneesh Kumar K.V
2008-08-27 15:28                   ` [PATCH -V3 11/11] ext4: Retry block allocation if we have free blocks left Aneesh Kumar K.V
2008-08-28 21:57                 ` [PATCH -V3 09/11] ext4: Fix ext4 nomballoc allocator for ENOSPC Mingming Cao
2008-08-29  3:44                   ` Aneesh Kumar K.V
2008-08-29  4:14                     ` Aneesh Kumar K.V
2008-08-29  5:02                       ` Mingming Cao
2008-08-29  5:06                     ` Mingming Cao
2008-08-29  8:25                       ` Aneesh Kumar K.V
2008-08-28 21:04               ` [PATCH -V3 08/11] ext4: Signed arithematic fix Mingming Cao
2008-08-28 21:03             ` [PATCH -V3 07/11] ext4: request for blocks with ar.excepted_group = -1 Mingming Cao
2008-08-28 21:03           ` [PATCH -V3 06/11] ext4: Update meta-data reservation with delalloc Mingming Cao
2008-08-28 20:57         ` [PATCH -V3 05/11] ext4: Switch to non delalloc mode when we are low on free blocks count Mingming Cao
2008-08-28 20:56       ` [PATCH -V3 04/11] ext4: Add percpu dirty block accounting Mingming Cao
2008-10-09 20:44       ` Eric Sandeen
2008-10-10  4:52         ` Aneesh Kumar K.V
2008-10-10  4:58           ` Eric Sandeen [this message]
2008-10-11 21:10         ` Andreas Dilger
2008-08-28 20:42     ` [PATCH -V3 03/11] ext4: Retry block reservation Mingming Cao
2008-08-28 20:41   ` [PATCH -V3 02/11] ext4: Make sure all the block allocation paths reserve blocks Mingming Cao
2008-08-27 19:05 ` [PATCH -V3 01/11] percpu_counters: make fbc->count read atomic on 32 bit architecture Andrew Morton
2008-08-27 21:01   ` Peter Zijlstra
2008-08-27 21:22     ` Andrew Morton
2008-08-28  3:52       ` Aneesh Kumar K.V
2008-08-28  4:09         ` Andrew Morton
2008-08-28 22:59           ` Mingming Cao
2008-08-28 22:59             ` Mingming Cao
2008-08-28  7:57       ` Peter Zijlstra
2008-08-28  3:48   ` Aneesh Kumar K.V
2008-08-28  4:06     ` Andrew Morton
2008-08-28 14:19       ` Nick Piggin

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=48EEE0F3.8060006@redhat.com \
    --to=sandeen@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.