From: Alex Tomas <alex@clusterfs.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: ext4-block-reservation.patch
Date: Tue, 19 Jun 2007 14:42:02 +0400 [thread overview]
Message-ID: <4677B2FA.1060807@clusterfs.com> (raw)
In-Reply-To: <4677B00A.3010600@linux.vnet.ibm.com>
I considered situation when few CPUs get out of blocks at same time rare.
thanks, Alex
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++)
> + if (rs[i].rs_reserved || i == smp_processor_id())
> + used_slots++;
> +
> + /* chunk is a number of block every used
> + * slot will get. make sure it isn't 0 */
> + chunk = free + used_slots - 1;
> + do_div(chunk, used_slots);
> +
> + for (i = 0; i < NR_CPUS; i++) {
> + if (free < chunk)
> + chunk = free;
> + if (rs[i].rs_reserved || i == smp_processor_id()) {
> + rs[i].rs_reserved = chunk;
> + free -= chunk;
> + BUG_ON(free < 0);
> + }
> + }
> + BUG_ON(free);
> +}
>
>
> -aneesh
> -
> 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
next prev parent reply other threads:[~2007-06-19 10:42 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 ` Alex Tomas [this message]
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 ` ext4-block-reservation.patch Aneesh Kumar K.V
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=4677B2FA.1060807@clusterfs.com \
--to=alex@clusterfs.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
/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.