From c909ca65bfeae678d3ea5c1e3ed1513cb55ae95b Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 7 Sep 2008 13:58:49 +0000 Subject: [PATCH] Patch by Zhao Shuai: Updated documentation regarding the use of the radix tree. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27356 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- docs/develop/kernel/swap_file_support | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/develop/kernel/swap_file_support b/docs/develop/kernel/swap_file_support index 9300bb9906..899c50f299 100644 --- a/docs/develop/kernel/swap_file_support +++ b/docs/develop/kernel/swap_file_support @@ -72,14 +72,12 @@ swap file is: 0-99, 101-200, 202-301) Why leave a page gap between swap files? Because in this way, we can easily tell if two adjacent pages are in a same swap file. (See the code in VMAnonymousCache::Read()). - Each swap file has a linear bitmap, and all pages in the swap file are -associated with a bit in the bitmap. When the page is used, the corresponding -bit is set to 1 and when free, it is set to 0. The linear bitmap is different -from FreeBSD. FreeBSD uses a radix bitmap and it's more efficient than linear -bitmap especially when swap space is fragmented. The reason why I did not use -a radix bitmap is I do not get a total understanding of radix tree structure -currently. But I will replace the linear bitmap with radix bitmap in the -future. + The efficiency of the FreeBSD swap system lies in a special data structure: +radix bitmap(i.e. bitmap using radix tree for hinting.) It can operate well no +matter how much fragmentation there is and no matter how large a bitmap is +used. I have ported the radix bitmap structure to Haiku, so our swap system +will have a good performance. More information on radix bitmap, please look +at the source code. Swap space allocation takes place when we swap anonymous pages out. In order to make the allocation less probable to fail, anonymous cache will