Approach to the RSS

看板DFBSD_kernel作者時間15年前 (2010/06/20 11:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
Hello, I came up with the following approach. I went through the code and the book named "Implementation of free BSD system" for some detail understanding. There is a vmspace structure embedding vm_map structure. The vm_map structure in turn points to the head of vm_map_entry. The vm_map_entry points to the vm_object. The structure vm_object contains the reference count of the number of vm_map_entry or other objects referencing it. Also, the vm_object structure has count of the number of resident pages. struct vm_object { ..... int ref_count; ..... int resident_page_count; ..... }; Suppose their are 2 process, proc_A and proc_B. proc_A has three references to a object and proc_B has 2. Thus, now their are five references and if we divide the resident_page_count by ref_count, we can then multiply it by 3 to get/calculate proportional RSS for proc_A and multiplying by 2 will give it for proc_B. Thus, we can get it without going very deep into the convoluted chain. And which will be fast. If you guys think its a feasible solution, I can carry it and test it. After the testing if the results are weird we can just move forward till the depth of the chain. Thanks, Pratyush Kshirsagar.
文章代碼(AID): #1C7OHn3H (DFBSD_kernel)
文章代碼(AID): #1C7OHn3H (DFBSD_kernel)