From: Matthew Wilcox <willy@debian.org>
To: Alex Tomas <bzzz@tmi.comex.ru>
Cc: Andreas Dilger <adilger@clusterfs.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
ext2-devel@lists.sourceforge.net, Andrew Morton <akpm@digeo.com>
Subject: Re: [Ext2-devel] [PATCH] distributed counters for ext2 to avoid group scaning
Date: Mon, 17 Mar 2003 15:11:08 +0000 [thread overview]
Message-ID: <20030317151108.GC28607@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <m3bs0bugca.fsf@lexa.home.net>
On Mon, Mar 17, 2003 at 12:55:17AM +0300, Alex Tomas wrote:
> > Also, while your goal is to reduce cache ping-pong between CPUs, we will
> > now have cache ping-pong for the "diff" array. We need to do per-cpu
> > values or make each value cacheline aligned to avoid ping-pong.
>
> yes, you're right. fixed
Um. But ... let's say I'm on a P4 box running a distro kernel. I suspect
most distros will set NR_CPUs to 8. So that's 128 byte cachelines * 8 CPUs
gives 1024 bytes -- 1k. Per dcounter (never mind the size of seqlock or
dc_base/dc_min):
> +struct dcounter_diff {
> + long dd_value;
> +} ____cacheline_aligned_in_smp;
> +
> +struct dcounter {
> + long dc_base;
> + long dc_min;
> + struct dcounter_diff dc_diff[NR_CPUS];
> + seqlock_t dc_lock;
> +};
> +++ edited/include/linux/ext2_fs_sb.h Mon Mar 17 00:12:00 2003
> struct ext2_bg_info *s_bgi;
> + struct dcounter free_blocks_dc;
> + struct dcounter free_inodes_dc;
> + struct dcounter dirs_dc;
And then we have 3 of these (an additional 3k..). Per blockgroup.
My 4GB / has 30 blockgroups; my 30GB /home has 232. So that's a little
under 8 per GB. My _laptop_ has a 40GB drive, so that's on the order
of 320 blockgroups -- almost an additional megabyte of ram consumed for
these counters.
Maybe it makes big boxes go faster, but this makes my dual CPU desktop
go slower, and that's not acceptable.
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
next prev parent reply other threads:[~2003-03-17 15:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-16 15:01 Alex Tomas
2003-03-16 17:44 ` [Ext2-devel] " Andreas Dilger
2003-03-16 21:55 ` Alex Tomas
2003-03-17 15:11 ` Matthew Wilcox [this message]
2003-03-17 15:09 ` Alex Tomas
2003-03-17 15:27 ` Matthew Wilcox
2003-03-17 15:25 ` Alex Tomas
2003-03-17 20:23 ` Andrew Morton
2003-03-17 20:27 ` Matthew Wilcox
2003-03-17 20:40 ` Alex Tomas
2003-03-17 9:37 ` William Lee Irwin III
2003-03-17 9:48 ` William Lee Irwin III
2003-03-17 10:41 ` Alex Tomas
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=20030317151108.GC28607@parcelfarce.linux.theplanet.co.uk \
--to=willy@debian.org \
--cc=adilger@clusterfs.com \
--cc=akpm@digeo.com \
--cc=bzzz@tmi.comex.ru \
--cc=ext2-devel@lists.sourceforge.net \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®