Virtual paging?
Virtual paging?
Something occured to me. On current "64-bit" systems the available memory space is a lot bigger than the 4Gb a program is allowed to use. Does this open the way for paging memory out to other memory areas? Essentially the same operation as paging to a hard drive but much much faster going in and out. Would be relatively simply to remap memory to just include the source and destination, copy, and then switch back to the application's memory space. Of course, I'm assuming this is a case where an app needs more than the (4Gb - OSSpace) that is available, if you manage to go over physical memory it'd obviously still be back to disk paging.
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
Re:Virtual paging?
Wouldn't it be easier to just port apps to use 64-bit pointers and thereby use more of the address space...?
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
Re:Virtual paging?
I can't see how this is similar to paging memory out to disk, I mean, when you do swapping, the app itself won't notice that a page has been swapped out - the virtual page is still there. When it is accessed then, the OS has to fetch it back from disk and make it accessible - again the app won't notice.Kemp wrote: Essentially the same operation as paging to a hard drive but much much faster going in and out.
When you want to reuse virtual pages (when the app needs more than 4Gb of address space), the app itself will have to notify the OS when it wants to swap a page, so that's an entirely different thing to me.
And, btw, I would also say that an app which needs more virtual memory than the OS can provide in 32bit mode should be ported to run in 64bit mode. Especially when it relies on a 64bit OS to run underneath.
cheers Joe
Re:Virtual paging?
it wouldn't be paged: the pages (while in physical memory) can be located anywhere in physical memory -- you can't 'page' out to ram because if its in ram its accessable (and therefore unswapped)
you can have several apps entirely within physical memory (in 32bit mode under a 32bit OS) if you have enough physical memory: pages can be mapped anywhere -- not just to a 4GB block at bottom_of_mem
if an app needs more than the availible virtual address space, most OSs (incl. windows, and, eventually, JaaOS), allow it to swap out portions of its address space this normally is swapped to disk but i would imagine that it could be done within physical memory -- but you would need to set up a method of tracking it since it would not exist within any address space (however i will be creating a special class of address spaces that contain 'overflow' from another address space)
-- note this technique of swapping virtual memory (to enlarge an address space) is normally called 'banking' not 'paging' (which normally refers to swapping physical memory -- to increase physical memory)
you can have several apps entirely within physical memory (in 32bit mode under a 32bit OS) if you have enough physical memory: pages can be mapped anywhere -- not just to a 4GB block at bottom_of_mem
if an app needs more than the availible virtual address space, most OSs (incl. windows, and, eventually, JaaOS), allow it to swap out portions of its address space this normally is swapped to disk but i would imagine that it could be done within physical memory -- but you would need to set up a method of tracking it since it would not exist within any address space (however i will be creating a special class of address spaces that contain 'overflow' from another address space)
-- note this technique of swapping virtual memory (to enlarge an address space) is normally called 'banking' not 'paging' (which normally refers to swapping physical memory -- to increase physical memory)
Re:Virtual paging?
Yeah, the intention wasn't that you should fixate on the term 'paging', I just used that as it was the closest analogy I come think of off the top of my head.
The last I heard was that even under 64-bit mode a single virtual address space could only be 4Gb maximum still. Obviously if I heard wrong then this discussion is kinda moot.
The last I heard was that even under 64-bit mode a single virtual address space could only be 4Gb maximum still. Obviously if I heard wrong then this discussion is kinda moot.
Re:Virtual paging?
no, under LMode, your address space is much larger
however this is still valid question under PMode, as any CPU in the last 10 years can support up to 64GB ram (and the newer ones allow 1TB -- even in PMode)
this has been a common technique as far back as RMode programs running under DOS can use more than the RMode limit, using banking (where a 64KB (or smaller) block of data/code is 'swapped' to extended memory (through an extended memory manager) and then can be restored later, to increase the total memory availible within a true RMode environment
there was even a standardized driver for this (which worked with both extended and expanded memory depending on which was installed and the application didn't even need to know which was being used) the most popular of which is emm386 (because it came bundled with most computers -- bundled with both DOS and win3)
however this is still valid question under PMode, as any CPU in the last 10 years can support up to 64GB ram (and the newer ones allow 1TB -- even in PMode)
this has been a common technique as far back as RMode programs running under DOS can use more than the RMode limit, using banking (where a 64KB (or smaller) block of data/code is 'swapped' to extended memory (through an extended memory manager) and then can be restored later, to increase the total memory availible within a true RMode environment
there was even a standardized driver for this (which worked with both extended and expanded memory depending on which was installed and the application didn't even need to know which was being used) the most popular of which is emm386 (because it came bundled with most computers -- bundled with both DOS and win3)
Re:Virtual paging?
You heard that wrong. An address space is at least 40 bits (1024 GB), and iirc it was 48 bits (262144GB) in all AMD implementations of AMD64.Kemp wrote: Yeah, the intention wasn't that you should fixate on the term 'paging', I just used that as it was the closest analogy I come think of off the top of my head.
The last I heard was that even under 64-bit mode a single virtual address space could only be 4Gb maximum still. Obviously if I heard wrong then this discussion is kinda moot.
Re:Virtual paging?
Hmmm.... must have been a communication issue somewhere along the line then. I'll see if I can find the threads where I remember reading it, see if I accidently took something out of context.
Re:Virtual paging?
*cough* for AMD64, you might just want the AMD manuals.JAAman wrote: or get an updated copy of the holy bible intel manuals
Re:Virtual paging?
Hi,
Cheers,
Brendan
Does AMD actually have proper programmer's manuals? All I've seen are documents that describe differences between AMD CPUs and the Intel manuals (e.g. 3DNOW extensions, AMD64 extensions, CPU datasheets, BIOS developers manuals, optimization, etc)...Candy wrote:*cough* for AMD64, you might just want the AMD manuals.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:Virtual paging?
Yes. See image for proof (picture of my own hardcopy).Brendan wrote: Hi,
Does AMD actually have proper programmer's manuals? All I've seen are documents that describe differences between AMD CPUs and the Intel manuals (e.g. 3DNOW extensions, AMD64 extensions, CPU datasheets, BIOS developers manuals, optimization, etc)...Candy wrote:*cough* for AMD64, you might just want the AMD manuals.
Re:Virtual paging?
For links: Volume 1, Volume 2, Volume 3, Volume 4, Volume 5.
The photo is of volume two, which is of course the System Programming manual. The picture was taken with my telephone on night mode, which of course doesn't give a very good image. You should still be able to recognise it.
Let's add the pacifica virtualization manual to the list.
[edit] you can't add an image in modify? that's wrong. [/edit]
The photo is of volume two, which is of course the System Programming manual. The picture was taken with my telephone on night mode, which of course doesn't give a very good image. You should still be able to recognise it.
Let's add the pacifica virtualization manual to the list.
[edit] you can't add an image in modify? that's wrong. [/edit]
Re:Virtual paging?
Where did you get a hardcopy? You didn't go to USA or Canada just to order one, did you? ;D
Re:Virtual paging?
bubach wrote: Where did you get a hardcopy? You didn't go to USA or Canada just to order one, did you? ;D
Just be an arse and fill in Saskatchewan, Canada and put in the comment field "NOT SASKATCHEWAN BUT HOLLAND, EUROPE" with full address. Does increase the delivery time though... mine took 3 months...* Available only in the US and Canada.
International users, please download the documents