From: Anton Altaparmakov <aia21@cantab.net>
To: vda@port.imtp.ilyichevsk.odessa.ua
Cc: Rusty Russell <rusty@rustcorp.com.au>,
torvalds@transmeta.com, linux-kernel@vger.kernel.org,
k-suganuma@mvj.biglobe.ne.jp, Andrew Morton <akpm@zip.com.au>
Subject: Re: [PATCH] 2.5.21 Nonlinear CPU support
Date: Wed, 12 Jun 2002 16:08:21 +0100 [thread overview]
Message-ID: <5.1.0.14.2.20020612155646.048fd520@pop.cus.cam.ac.uk> (raw)
In-Reply-To: <200206121431.g5CEV6L20571@Port.imtp.ilyichevsk.odessa.ua>
At 20:32 12/06/02, Denis Vlasenko wrote:
>On 11 June 2002 12:54, Anton Altaparmakov wrote:
> > > > This is crazy! It means you are allocating 2MiB of memory instead of
> > > > just 128kiB on a 2 CPU system, which will be about 99% of the SMP
> > > > systems in use, at my guess. So your change is throwing away 1920kiB of
> > > > kernel ram for no reason at all. And that is just ntfs...
> > >
> > >Wait a minute.
> > >These buffers are allocated per CPU. Can we allocate additional ones when
> > >new CPU is added?
> >
> > Of course, see my suggestion for how to handle this in the post after the
> > one you replied to.
> >
> > >I do hope these buffers aren't allocated an boot time but at mount time,
> > >are they?
> >
> > At mount time and only if the volume supports compression. And they are
> > ntfs global, i.e. not per mount point. That is still a big ram waste.
>
>It's optimal to allocate buffers when they are needed.
>Thnk about an NTFS volume without any compressed files at all.
No buffers are allocated if the volume doesn't support compression at all.
But if it does support them then we allocate them, even if then there are
no compressed files as there is no quick way to tell the difference.
Buffer allocation at use time is NOT an option because the buffers are
allocated using vmalloc() which is extremely expensive and we would need to
allocate at every single initial ->readpage() call of a compressed file.
>CPU hotswap higlights the fact that per CPU allocation needs to be smarter
>about doing its job (i.e. don't allocate if it won't be used ever,
>defer allocation to CPU hotswap event).
The former is not possible for ntfs as there is no quick way to tell if use
will use decompression or not. And the latter creates a lot of complexity.
I gave an example using a callback of how it could be done in a previous
post but I don't like introducing complexity for a minority group of users.
>OTOH, smarter code is longer, more difficult code. One have to weigh
>memory benefits for small population of 'hot swappers' versus code simplicity.
Exactly. However all is well, if you have read the whole thread you will
have seen the cpu_possible() optimization which allows allocating for
actual existing CPU slots which means there is no wasted RAM or at least
very little... On a 32 CPU machine I agree that it is irrelevant if you are
wasting a few MiB of ram, you probably have multiple GiB of the stuff anyway...
Anton
--
"I've not lost my mind. It's backed up on tape somewhere." - Unknown
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
next prev parent reply other threads:[~2002-06-12 15:07 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-11 7:08 Rusty Russell
2002-06-11 7:42 ` Andrew Morton
2002-06-11 9:09 ` Rusty Russell
2002-06-11 9:10 ` David S. Miller
2002-06-12 6:58 ` Rusty Russell
2002-06-12 9:26 ` David S. Miller
2002-06-13 5:01 ` Rusty Russell
2002-06-13 5:55 ` David S. Miller
2002-06-11 9:27 ` Andrew Morton
2002-06-11 11:22 ` Anton Altaparmakov
2002-06-12 5:57 ` Rusty Russell
2002-06-12 7:54 ` Anton Altaparmakov
2002-06-12 8:06 ` Rusty Russell
2002-06-12 8:25 ` Anton Altaparmakov
2002-06-12 19:32 ` Linus Torvalds
2002-06-12 13:10 ` Mikael Pettersson
2002-06-13 2:42 ` Rusty Russell
2002-06-12 0:53 ` Rusty Russell
2002-06-12 8:36 ` Helge Hafting
2002-06-11 10:57 ` Anton Altaparmakov
2002-06-11 17:59 ` Robert Love
2002-06-12 4:11 ` Rusty Russell
2002-06-11 19:29 ` Denis Vlasenko
2002-06-11 14:54 ` Anton Altaparmakov
2002-06-12 19:32 ` Denis Vlasenko
2002-06-12 15:08 ` Anton Altaparmakov [this message]
2002-06-12 17:36 ` Andreas Dilger
2002-06-12 18:34 ` Anton Altaparmakov
2002-06-12 19:39 ` Andreas Dilger
2002-06-12 20:41 ` Anton Altaparmakov
2002-06-12 21:03 ` Andreas Dilger
2002-06-12 21:15 ` Anton Altaparmakov
2002-06-12 20:03 ` H. Peter Anvin
2002-06-12 20:54 ` Robert Love
2002-06-12 20:57 ` Anton Altaparmakov
2002-06-12 22:21 ` H. Peter Anvin
2002-06-13 1:33 ` Anton Altaparmakov
2002-06-13 1:38 ` H. Peter Anvin
2002-06-13 1:45 ` Anton Altaparmakov
2002-06-13 2:13 ` H. Peter Anvin
2002-06-13 2:21 ` Anton Altaparmakov
2002-06-13 8:43 ` Helge Hafting
2002-06-11 18:01 ` Robert Love
2002-06-12 7:57 ` Alan Cox
2002-06-12 8:01 ` Rusty Russell
[not found] <Pine.LNX.4.33.0206121226550.1533-100000@penguin.transmeta. com>
2002-06-12 21:29 ` Anton Altaparmakov
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=5.1.0.14.2.20020612155646.048fd520@pop.cus.cam.ac.uk \
--to=aia21@cantab.net \
--cc=akpm@zip.com.au \
--cc=k-suganuma@mvj.biglobe.ne.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@transmeta.com \
--cc=vda@port.imtp.ilyichevsk.odessa.ua \
/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®