Skip to contentSkip to conversation

ptes flags in compressed cache

DISCUSSION Rodrigo S. de Castro 8 participants 10 messages Oct 26, 2000 – Oct 30, 2000 1 message not in the archive Memory management

lore
Share & tools
lore
#0 lore raw

Hello,

I am working on a compressed cache for 2.2.16 and I am
currently in a cache with no compression implementation. Well, at this step, I gotta a doubt of how can I mark the pages (actually, ptes) that are in my cache and neither present in memory nor in swap. This is essential when I have a page fault, and this page is not present in memory. It is (in a normal kernel) assumed to be in swap, but it can, now, be in my cache. In order to mark the pte, I first thought of a flag (in the style of _PAGE_*), and I defined _PAGE_COMPRESSED with 0x200, because all before were used. However, I got into a big trouble. An address like 0xe00 is a valid swap address, and returns true when I and it with 0x200. Thus, my question is: is there an offset in swap address that allows me to use this part of address to put a flag of mine in that free space? And, even more importante, do you have any other idea to solve that? Maybe a better solution, that does not depend on swap implementation and any future change would not screw my current solution up. I don't have any idea of what might have been changed on 2.4, so that's the main reason of asking you and be trying to avoid possible troubles! :-)

PS: There's a simple page of my project. Give a look at:

    http://tutu.ime.usp.br

[]'s

Signature · 7 lines
Rodrigo S. de Castro   <[email protected]>
Computer Science undergraduate student - University of Sao Paulo

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
#1 lore raw

Hi,

Quoted 7 lines · Rodrigo S. de Castro

I am working on a compressed cache for 2.2.16 and I am
currently in a cache with no compression implementation. Well, at this step, I gotta a doubt of how can I mark the pages (actually, ptes) that are in my cache and neither present in memory nor in swap. This is essential when I have a page fault, and this page is not present in memory.

Reserve a SWP_ENTRY for compressed pages. There's precedent for that:
SHM in 2.2 already uses that mechanism for swapped-out shared memory pages.

--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#2 lore raw

page fault.

hello,
Is there any way in which i can know when the pagefault occured, i mean at what instruction of my program execution.
Does OS provide any support. This would help me to improve my program. thanx
jagadish

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#3 lore raw

Re: page fault.

Quoted 6 lines · M.Jagadish Kumar

hello,
Is there any way in which i can know when the pagefault occured, i mean at what instruction of my program execution.
Does OS provide any support. This would help me to improve my program. thanx
jagadish

The way I use is to use oops message and System.map to locate the subroutine where the oops occured. To find the exact line where the oops occured, you need to either check assemble code or use more complicated kernel debug technique. I think Rik covered some in his kernel debug slides.

Fei

Quoted 7 lines

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#4 lore raw

Re: page fault.

Quoted 11 lines · On Thu, 26 Oct 2000 [email protected] wrote:
Quoted 3 lines · M.Jagadish Kumar

Is there any way in which i can know when the pagefault occured, i mean at what instruction of my program execution.
Does OS provide any support. This would help me to improve my program.

The way I use is to use oops message and System.map to locate the subroutine where the oops occured. To find the exact line where the oops occured, you need to either check assemble code or use more complicated kernel debug technique. I think Rik covered some in his kernel debug slides.

You're confusing issues. A pagefault has NOTHING to do with an oops...

Rik
--
"What you're running that piece of shit Gnome?!?!"
-- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/ http://www.surriel.com/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#5 lore raw

Re: page fault.

You are right. I misunderstood what he wants. To know when the pagefault occured, one simply can work on the pagefault handler. It is trivial.

Fei

Quoted 16 lines · Rik van Riel
Quoted 11 lines · On Thu, 26 Oct 2000 [email protected] wrote:
Quoted 3 lines · M.Jagadish Kumar

Is there any way in which i can know when the pagefault occured, i mean at what instruction of my program execution.
Does OS provide any support. This would help me to improve my program.

The way I use is to use oops message and System.map to locate the subroutine where the oops occured. To find the exact line where the oops occured, you need to either check assemble code or use more complicated kernel debug technique. I think Rik covered some in his kernel debug slides.

You're confusing issues. A pagefault has NOTHING to do with an oops...

Quoted 7 lines

Rik
--
"What you're running that piece of shit Gnome?!?!"
-- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/ http://www.surriel.com/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#6 lore raw

Re: page fault.

Hi,

Quoted 2 lines · On Thu, Oct 26, 2000 at 10:14:23PM -0400, [email protected] wrote:

You are right. I misunderstood what he wants. To know when the pagefault occured, one simply can work on the pagefault handler. It is trivial.

Page faults already produce a SIGSEGV which gets passed a sigcontext struct describing where the fault occurred.

--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Re: page fault.

Quoted 10 lines · Stephen C. Tweedie

Hi,

Quoted 2 lines · On Thu, Oct 26, 2000 at 10:14:23PM -0400, [email protected] wrote:

You are right. I misunderstood what he wants. To know when the pagefault occured, one simply can work on the pagefault handler. It is trivial.

Page faults already produce a SIGSEGV which gets passed a sigcontext struct describing where the fault occurred.

Isn't it that only unsatisfied pagefaults generate SIGSEGV? The original question was whether there is a way to track all pagefaults in a given program. Please correct if I'm wrong: the answer to this latter question is no. Unless one modifies do_pagefault to generate such a signal on all faults ...

--------------------------------------------------------------------------
Rajagopal Ananthanarayanan ("ananth")
Member Technical Staff, SGI.
--------------------------------------------------------------------------
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#9 lore raw

Re: page fault.

In reply to M.Jagadish Kumar

I was interested in that too :)) So far the best I came up with was a loadable module that prints out all pages in active memory. Perhaps you can use it together with debugger to step through the program and see what happens.

Vladimir Dergachev

Quoted 8 lines · M.Jagadish Kumar

hello,
Is there any way in which i can know when the pagefault occured, i mean at what instruction of my program execution.
Does OS provide any support. This would help me to improve my program. thanx
jagadish

Quoted 5 lines

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#10 lore raw
In reply to Stephen C. Tweedie
Quoted 9 lines · Stephen C. Tweedie
Quoted 7 lines · Rodrigo S. de Castro

I am working on a compressed cache for 2.2.16 and I am
currently in a cache with no compression implementation. Well, at this step, I gotta a doubt of how can I mark the pages (actually, ptes) that are in my cache and neither present in memory nor in swap. This is essential when I have a page fault, and this page is not present in memory.

Quoted 3 lines

Reserve a SWP_ENTRY for compressed pages. There's precedent for that:
SHM in 2.2 already uses that mechanism for swapped-out shared memory pages.

No, shm does not use a SWP_TYPE. It only pretends to do ;-)

Greetings
Christoph

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/