1

Operating System question:

Say we have a process running in a paged memory system, and we want to track which pages it accesses in the specific order it does so. How could we do this?

I was thinking we could write the page to the string every time it needs to be loaded into the TLB, but then my OS wouldn't be able to track the ordering of references (and number of references) to each page in the TLB, unless somehow every every memory access I could check the TLB. Overall I'm finding the problem to be a bit confusing...

Assume each page table entry is 64 bits, 20 bits for the virtual page, and 20 bits for the corresponding physical frame. A couple of bits are status/privilege, but there are a few "free" bits to work with.

Thanks.

EDIT - an example: if the operating system has page sizes of 1000, and the process accesses some addresses like 1234, 5660, 1220, 7442, ... then the page reference string would look like 1,5,1,7,...

4

1 に答える 1

1

1 つのオプションは、プロセスのすべてのページをアクセス不可としてマークし、ページ フォールトが発生するたびに、フォールト ページをアクセス可能としてマークし、ページ番号を「文字列」に記録してから、プロセスに 1 つの命令を実行させ、最初からすべてを繰り返します (すべてをアクセス不可としてマークするなど)。

このすべてを実行しているコードがカーネルで実行されていない場合、常に上記を実行できるとは限りません。これは、ハードウェアと OS に大きく依存します。ただし、Windowsでそれに近づくかもしれません。この質問とそれに対する私の回答を参照してください。

于 2012-03-07T03:04:39.860 に答える