From: Nikolay Igotti <nike@lyola.com>
To: Rik van Riel <riel@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: memmove syscall
Date: Fri, 06 Feb 2004 07:45:33 +0300 [thread overview]
Message-ID: <40231BED.8060100@lyola.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0402052252130.5933-100000@chimarrao.boston.redhat.com>
Rik van Riel wrote:
>On Wed, 4 Feb 2004, Nikolay Igotti wrote:
>
>
>
>> Maybe this is kinda crazy (or known) idea, but why don't we create
>>syscall allowing large copies by just manipulating MMU page table, i.e.
>>
>>
>
>
>
>> return mmu_remap_pages(src, dst, size / PAGE_SIZE);
>>
>>
>
>Did you look at mremap(2) ?
>
>
If I get it correctly:
mremap expands (or shrinks) an existing memory mapping,
potentially
moving it at the same time (controlled by the flags argument
and the
available virtual address space).
And this syscall can be only used for realloc() kind of stuff, as you're
not allowed to change
virtual address of some page to desired value, but whole point is to
allow very fast page-aligned
memory moving (or to be exact - swapping, as I guess dst pages should be
mapped where src ones was
mapped before, to keep things sane).
Obvious applications for this syscall - Large Object Spaces in
different memory management systems
- if space is allocated in pages, defragmentation becomes very cheap.
Also there could be other applications, like execution-time program
obfuscators, just shuffling
program stack and data in fancy way :), or tools for improvment of
interactive behavior of
KDE/Gnome by putting images (or other location-neutral(pointerless)
data) into nearby virtual
memory locations (so they'll be swapped in and out together, as they
should).
If it can be achieved with existing syscalls, I'd be happy to know how
to do that :).
Thanks,
Nikolay
next prev parent reply other threads:[~2004-02-06 4:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-04 12:32 memmove syscall Nikolay Igotti
2004-02-06 3:52 ` Rik van Riel
2004-02-06 4:45 ` Nikolay Igotti [this message]
2004-02-07 1:23 ` Jamie Lokier
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=40231BED.8060100@lyola.com \
--to=nike@lyola.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@redhat.com \
/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