linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Al Boldi <a1426z@gawab.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] VM: I have a dream...
Date: Wed, 1 Feb 2006 14:38:40 +0000	[thread overview]
Message-ID: <20060201143840.GA19134@mail.shareable.org> (raw)
In-Reply-To: <200602011658.10418.a1426z@gawab.com>

Al Boldi wrote:
> > Presumably you will want access to more data than you have RAM,
> > because RAM is still limited to a few GB these days, whereas a typical
> > personal data store is a few 100s of GB.
> >
> > 64-bit architecture doesn't change this mismatch.  So how do you
> > propose to avoid swapping to/from a disk, with all the time delays and
> > I/O scheduling algorithms that needs?
> 
> This is exactly what a linear-mapped memory model avoids.
> Everything is already mapped into memory/disk.

Having everything mapped to memory/disk *does not* avoid time delays
and I/O scheduling.  At some level, whether it's software or hardware,
something has to schedule the I/O to disk because there isn't enough RAM.

How do you propose to avoid those delays?

In my terminology, I/O of pages between disk and memory is called
swapping.  (Or paging, or loading, or virtual memory I/O...)

Perhaps you have a different terminology?

> Would you call reading and writing to memory/disk swapping?

Yes, if it involves the disk and heuristic paging decisions.  Whether
that's handled by software or hardware.

> > Applications don't currently care if they are swapped to disk or in
> > physical memory.  That is handled by the OS and is transparent to the
> > application.
> 
> Yes, a linear-mapped memory model extends this transparency to the OS.

Yes, that is possible.  It's slow in practice because that
transparency comes at the cost of page faults (when the OS accesses
that linear-mapped memory), which is slow on the kinds of CPU we are
talking about - i.e. commodity 64-bit chips.

> > > If you didn't understand it's meaning.  The shortest path meaning
> > > accessing hw w/o running workarounds; using 64bits+ to fly over past
> > > limitations.
> >
> > THe OS still has to map the address space to where it physically exists.
> > Mapping all disk space into the address space may actually be a lot less
> > efficient than using the filesystem interface for a block device.
> 
> Did you try tmpfs?

Actually, mmap() to read a tmpfs file can be slower than just calling
read(), for some access patterns.  It's because page faults, which are
used to map the file, can be slower than copying data.  However,
copying uses more memory.  Today we leave it to the application to
decide which method to use.

> > If so, then it actually makes *less* sense to me than before -- with
> > your scheme, you've reduced the speed of main memory by 100x or more,
> > then you try to compensate with a huge cache. IOW, you've reduced the
> > speed of *main* memory to (more or less) the speed of today's swap!
> > Suddenly it doesn't sound so good anymore...
> 
> There really isn't anything new here; we do swap and access the fs on disk 
> and compensate with a huge dcache now.  All this idea implies, is to remove 
> certain barriers that could not be easily passed before, thus move swap and 
> fs into main memory.
> 
> Can you see how removing barriers would aid performance?

I suspect that, despite possibly simplifying code, removing those
barriers would make it run slower.

If I understand your scheme, you're suggesting the kernel accesses
disks, filesystems, etc. by simply reading and writing somewhere in
the 64-bit address space.

At some level, that will involve page faults to move data between RAM and disk.

Those page faults are relatively slow - governed by the CPU's page
fault mechanism.  Probably slower than what the kernel does now:
testing flags and indirecting through "struct page *".

However, do feel free to try out your idea.  If it is actually notably
faster, or if it makes no difference to speed but makes a lot of code
simpler, well then surely it will be interesting.

-- Jamie

  reply	other threads:[~2006-02-01 14:38 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-01 13:58 [RFC] VM: I have a dream Al Boldi
2006-02-01 14:38 ` Jamie Lokier [this message]
2006-02-02 12:26   ` Al Boldi
  -- strict thread matches above, loose matches on Subject: below --
2006-01-21 18:08 Al Boldi
2006-01-21 18:42 ` Jamie Lokier
2006-01-21 18:46 ` Avi Kivity
2006-01-23 19:52   ` Bryan Henderson
2006-01-25 22:04     ` Al Boldi
2006-01-26 19:18       ` Bryan Henderson
2006-01-27 16:12         ` Al Boldi
2006-01-27 19:17           ` Bryan Henderson
2006-01-30 13:21             ` Al Boldi
2006-01-30 13:35               ` Kyle Moffett
2006-01-31 15:56                 ` Al Boldi
2006-01-31 16:34                   ` Kyle Moffett
2006-01-31 23:14                     ` Bryan Henderson
2006-01-31 16:34                   ` Lennart Sorensen
2006-01-31 19:23                   ` Jamie Lokier
2006-02-01  4:06                   ` Barry K. Nathan
2006-02-02 15:11                   ` Alan Cox
2006-02-02 18:59                     ` Al Boldi
2006-02-02 22:33                       ` Bryan Henderson
2006-02-03 14:46                       ` Alan Cox
2006-01-30 16:49               ` Bryan Henderson
2006-01-26  0:03     ` Jon Smirl
2006-01-26 19:48       ` Bryan Henderson
2006-01-22  8:16 ` Pavel Machek
2006-01-22 12:33 ` Robin Holt
2006-01-23 18:03   ` Al Boldi
2006-01-23 18:40     ` Valdis.Kletnieks
2006-01-23 19:26       ` Benjamin LaHaise
2006-01-23 19:40         ` Valdis.Kletnieks
2006-01-23 22:26     ` Pavel Machek
2006-01-22 19:55 ` Barry K. Nathan
2006-01-23  5:23   ` Michael Loftis
2006-01-23  5:46     ` Chase Venters
2006-01-23  8:20       ` Barry K. Nathan
2006-01-23 13:17       ` Jamie Lokier
2006-01-23 20:21         ` Peter Chubb
2006-01-23 15:05     ` Ram Gupta
2006-01-23 15:26       ` Diego Calleja
2006-01-23 16:11         ` linux-os (Dick Johnson)
2006-01-23 16:50           ` Jamie Lokier
2006-01-24  2:08           ` Horst von Brand
2006-01-25  6:13             ` Jamie Lokier
2006-01-25  9:23             ` Bernd Petrovitsch
2006-01-25  9:42               ` Lee Revell
2006-01-25 15:02                 ` Jamie Lokier
2006-01-25 23:24                   ` Lee Revell
2006-01-25 15:05               ` Jamie Lokier
2006-01-25 15:47                 ` Bernd Petrovitsch
2006-01-25 16:09                 ` Diego Calleja
2006-01-25 17:26                   ` Jamie Lokier
2006-01-26 19:13                     ` Bryan Henderson
2006-01-25 23:28                 ` Lee Revell
2006-01-26  1:29                   ` Diego Calleja
2006-01-26  5:01                   ` Jamie Lokier
2006-01-26  5:11                     ` Lee Revell
2006-01-26 14:46                       ` Dave Kleikamp
2006-01-24  2:10           ` Horst von Brand
2006-01-25 22:27         ` Nix
2006-01-26 15:13           ` Denis Vlasenko
2006-01-26 16:23             ` Nix
2006-01-23 20:43       ` Michael Loftis
2006-01-23 22:42         ` Nikita Danilov
2006-01-24 14:36           ` Ram Gupta
2006-01-24 15:04             ` Diego Calleja
2006-01-24 20:59               ` Bryan Henderson
2006-01-24 15:11             ` Nikita Danilov
2006-01-23 22:57         ` Ram Gupta

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=20060201143840.GA19134@mail.shareable.org \
    --to=jamie@shareable.org \
    --cc=a1426z@gawab.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).