From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Eric Sandeen <sandeen@redhat.com>,
alex@clusterfs.com, linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: ext4-block-reservation.patch
Date: Tue, 19 Jun 2007 22:46:48 +0530 [thread overview]
Message-ID: <46780F80.8030003@linux.vnet.ibm.com> (raw)
In-Reply-To: <46780D76.9040706@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]
Aneesh Kumar K.V wrote:
>
>
> Eric Sandeen wrote:
>> Aneesh Kumar K.V wrote:
>>> Hi,
>>>
>>> In block reservation code while rebalancing the free blocks why are
>>> we not looking at the reservation slots that have no free blocks
>>> left. Rebalancing
>>> the free blocks equally across all the reservation slots will make sure
>>> we have less chances of failure later when we try to reserve blocks.
>>>
>>> I understand that we consider the CPU slot on which reservation
>>> failed while
>>> rebalancing. But what is preventing considering other CPU slot that
>>> might have
>>> zero blocks left ?
>>>
>>>
>>>
>>>
>>> +void ext4_rebalance_reservation(struct ext4_reservation_slot *rs,
>>> __u64 free)
>>> +{
>>> + int i, used_slots = 0;
>>> + __u64 chunk;
>>> +
>>> + /* let's know what slots have been used */
>>> + for (i = 0; i < NR_CPUS; i++)
>>
>> BTW... I think you really want:
>>
>> + for_each_possible_cpu(i) {
>>
>> in this and other similar places.
>>
>> NR_CPUS is a config-time option that may be much more than your actual
>> count of runtime possible CPUs... on ia64 it's 512 by default, for
>> example. That's a lot of pointlessness on a 2, 4 or 8 cpu box :)
>>
>> I can whip up a proper patch for current code to send (again)...
>>
>
> This is what i have modified. I am yet to build test it. I am looking at
> forward porting the
> mballoc patches and was planning to send it together.
>
I build tested the patch. I guess we need the below small patch on top of the previous
patch.
-aneesh
[-- Attachment #2: k --]
[-- Type: text/plain, Size: 432 bytes --]
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index ad3f57c..df6b83c 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -1981,7 +1981,7 @@ int ext4_reserve_init(struct super_block *sb)
struct ext4_reservation_slot *rs;
int i;
- rs = percpu_alloc(sizeof(struct ext4_reservation_slot), GFP_KERNEL);
+ rs = alloc_percpu(struct ext4_reservation_slot);
if (rs == NULL)
return -ENOMEM;
sbi->s_reservation_slots = rs;
next prev parent reply other threads:[~2007-06-19 17:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-19 10:29 ext4-block-reservation.patch Aneesh Kumar K.V
2007-06-19 10:42 ` ext4-block-reservation.patch Alex Tomas
2007-06-19 15:05 ` ext4-block-reservation.patch Eric Sandeen
2007-06-19 17:08 ` ext4-block-reservation.patch Aneesh Kumar K.V
2007-06-19 17:16 ` Aneesh Kumar K.V [this message]
2007-06-19 22:10 ` ext4-block-reservation.patch Andreas Dilger
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=46780F80.8030003@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=alex@clusterfs.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.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