linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: cmm@us.ibm.com, tytso@mit.edu, sandeen@redhat.com
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: Don't allow lg prealloc list to be grow large.
Date: Tue, 22 Jul 2008 18:06:41 +0530	[thread overview]
Message-ID: <20080722123641.GB17860@skywalker> (raw)
In-Reply-To: <1216725016-22855-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Tue, Jul 22, 2008 at 04:40:16PM +0530, Aneesh Kumar K.V wrote:
> Currently locality group prealloc list is freed only when there is a block allocation
> failure. This can result in large number of per cpu locality group prealloc space
> and also make the ext4_mb_use_preallocated expensive. Convert the locality group
> prealloc list to a hash list. The hash index is the order of number of blocks
> in the prealloc space with a max order of 9. When adding prealloc space to the
> list we make sure total entries for each order does not exceed 8. If it is more
> than 8 we discard few entries and make sure the we have only <= 5 entries.
> 
> 

small update to fix the wrong usage of list APIs


diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index e058509..f8da1a2 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3348,7 +3348,7 @@ static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac,
 		if (!added && pa->pa_free < tmp_pa->pa_free) {
 			/* Add to the tail of the previous entry */
 			list_add_tail_rcu(&pa->pa_inode_list,
-					tmp_pa->pa_inode_list.prev);
+						&tmp_pa->pa_inode_list);
 			added = 1;
 			/* we want to count the total
 			 * number of entries in the list
@@ -3357,7 +3357,7 @@ static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac,
 		lg_prealloc_count++;
 	}
 	if (!added)
-		list_add_tail_rcu(&pa->pa_inode_list, &tmp_pa->pa_inode_list);
+		list_add_tail_rcu(&pa->pa_inode_list, &lg->lg_prealloc_list[order]);
 
 	/* Now trim the list to be not more than 8 elements */
 	if (lg_prealloc_count > 8) {

  reply	other threads:[~2008-07-22 12:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-22 11:10 [PATCH] ext4: Don't allow lg prealloc list to be grow large Aneesh Kumar K.V
2008-07-22 12:36 ` Aneesh Kumar K.V [this message]
2008-07-22 17:42 ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2008-07-23 17:10 Patches for patchqueue Aneesh Kumar K.V
2008-07-23 17:10 ` [PATCH] ext4: Improve error handling in mballoc Aneesh Kumar K.V
2008-07-23 17:10   ` [PATCH] ext4: Convert the usage of NR_CPUS to nr_cpu_ids Aneesh Kumar K.V
2008-07-23 17:10     ` [PATCH] ext4: Don't allow lg prealloc list to be grow large Aneesh Kumar K.V
2008-07-23 18:13       ` Theodore Tso
2008-07-21  9:40 Aneesh Kumar K.V
2008-07-21 19:37 ` Eric Sandeen

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=20080722123641.GB17860@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).