From: Mingming Cao <cmm@us.ibm.com>
To: Theodore Tso <tytso@MIT.EDU>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: mballoc avoid use root reserved blocks for non root allocation
Date: Fri, 06 Jun 2008 11:59:24 -0700 [thread overview]
Message-ID: <1212778764.22102.6.camel@localhost.localdomain> (raw)
In-Reply-To: <20080606023345.GH30272@mit.edu>
On Thu, 2008-06-05 at 22:33 -0400, Theodore Tso wrote:
> On Sun, Jun 01, 2008 at 02:06:53PM -0700, Mingming Cao wrote:
> > ext4: mballoc avoid use root reserved blocks for non root allocation
> >
> > From: Mingming Cao <cmm@us.ibm.com>
> >
> > mballoc allocation missed check for blocks reserved for root users. Add
> > ext4_has_free_blocks() check before allocation. Also modified
> > ext4_has_free_blocks() to support multiple block allocation request.
>
> This was discovered by a Gentoo user who tried compiling on a UP system.....
>
> > Index: linux-2.6.26-rc4/fs/ext4/balloc.c
> > ....
> > + if (free_blocks - root_blocks < FBC_BATCH)
> > + free_blocks =
> > + percpu_counter_sum_positive(&sbi->s_freeblocks_counter);
>
>
> FBC_BATCH is only defined if CONFIG_SMP is defined. I believe the
> simplest fix is surround the above if statement with an "#ifdef
> CONFIG_SMP", since on UP systems, the percpu counters are always
> exactly correct.
>
Works for me. One up system the counter is always accurate.
FBC_BATCH is just some value to trigger sum up from per cpu counters to
get the accurate value, we don't need to do this for single UP.
Mingming
> - Ted
prev parent reply other threads:[~2008-06-06 18:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-01 21:06 [PATCH] ext4: mballoc avoid use root reserved blocks for non root allocation Mingming Cao
2008-06-06 2:33 ` Theodore Tso
2008-06-06 18:59 ` Mingming Cao [this message]
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=1212778764.22102.6.camel@localhost.localdomain \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox