All of lore.kernel.org
 help / color / mirror / Atom feed
From: mru@kth.se (Måns Rullgård)
To: linux-kernel@vger.kernel.org
Subject: Re: Improved file handling mechanisms for 64-bit architectures
Date: Sun, 08 Feb 2004 19:48:22 +0100	[thread overview]
Message-ID: <yw1x4qu1s8zt.fsf@kth.se> (raw)
In-Reply-To: 001b01c3ee72$a5d5a3b0$0301a8c0@mojeime

"Vijolicni.oblak" <un.info@gmx.net> writes:

> I would like to make a suggestion how to best use the new AMD64 architecture
> in the new kernel version for 64-bit architectures. You are making new sets
> of functions and optimizing new compilers anyway so I think that now is also
> the time to introduce new file handling mechanisms that can be fully
> implemented only in 64-bit environment.
>
> Currently, the AMD64 architecture defines a mechanism for translating 48-bit
> virtual addresses to 52-bit physical addresses.
>
> I will make a suggestion on how to improve file handling performance:
>
> Currently if you want to work with files, you have to:
>
> 1) assign file a handle; 2) read wanted portions of file into memory 3) if
> there is not enough physical memory, save the contents of the file to disk
>
> With AMD64 you are able to make 48-bit addresses, which amount to 256000
> gigabytes of virtual memory. When working with large (eg. 10GB) video or
> database files, Linux kernel could map the whole file into the virtual
> memory using processor's Page Translation Mechanism.
>
> Those 10GB would then be mapped to a certain memory range. If a portion of
> file that is currently requested is in physical RAM the processor would
> handle it without OS intervention; if not, then a page fault (#PF, 14)
> exception would occur and read a missing page (a missing portion of file).
>
> The application would see the file as a 10GB large array (or a string), or
> perhaps could map its own data structures into this memory space.
>
> When writing to file, i.e. modifying the data in the array, a #PF would
> occur and mark this page as dirty and write modified data to the disk (or
> schedule writing to a later time)

Did you have something different from mmap in mind?  What you are
saying look very much like the existing mmap functionality.

> There is also one addition benefit to this: when inserting data into the
> middle of the 10GB file - a new video frame or enlarging a table in SQL only
> a remapping of virtual memory and the cooperation of file system is needed.
>
> Let's say that AAAAAAAAAAAAAAAAAAAAAAAA is the original file. You want to
> insert B somewhere in the middle of the file. AAAAAAAAABAAAAAAAAAAAAAAA is
> done by calling a function increasefile(startoffset,length) that moves a few
> hundred bytes in Page Table or in Page directory table and by adding an
> additional segment to the file chain (eg. FAT chain). The length must just
> be a multiplier of 4KB.

This is non-trivial.  It would require support from all the various
filesystems.  Surely there's some filesystem using an on-disk layout
making such things difficult or impossible.

-- 
Måns Rullgård
mru@kth.se


  reply	other threads:[~2004-02-08 18:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-08 18:37 Improved file handling mechanisms for 64-bit architectures Vijolicni.oblak
2004-02-08 18:48 ` Måns Rullgård [this message]
2004-02-08 18:53 ` Valdis.Kletnieks
2004-02-08 19:24   ` Kevin P. Fleming

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=yw1x4qu1s8zt.fsf@kth.se \
    --to=mru@kth.se \
    --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 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.