mmlr (distracted) + bonefish:
* Turn VMCache::consumers C list into a DoublyLinkedList. * Use object caches for the different VMCache types and the VMCacheRefs. The purpose is to reduce slab area fragmentation. * Requires the introduction of a pure virtual VMCache::DeleteObject() method, implemented in the derived classes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43133 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <debug.h>
|
||||
#include <kernel.h>
|
||||
#include <util/list.h>
|
||||
#include <util/DoublyLinkedList.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_types.h>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
|
||||
struct kernel_args;
|
||||
class ObjectCache;
|
||||
|
||||
|
||||
enum {
|
||||
@@ -34,6 +35,14 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
extern ObjectCache* gCacheRefObjectCache;
|
||||
extern ObjectCache* gAnonymousCacheObjectCache;
|
||||
extern ObjectCache* gAnonymousNoSwapCacheObjectCache;
|
||||
extern ObjectCache* gVnodeCacheObjectCache;
|
||||
extern ObjectCache* gDeviceCacheObjectCache;
|
||||
extern ObjectCache* gNullCacheObjectCache;
|
||||
|
||||
|
||||
struct VMCachePagesTreeDefinition {
|
||||
typedef page_num_t KeyType;
|
||||
typedef vm_page NodeType;
|
||||
@@ -63,7 +72,10 @@ struct VMCachePagesTreeDefinition {
|
||||
typedef IteratableSplayTree<VMCachePagesTreeDefinition> VMCachePagesTree;
|
||||
|
||||
|
||||
struct VMCache {
|
||||
struct VMCache : public DoublyLinkedListLinkImpl<VMCache> {
|
||||
public:
|
||||
typedef DoublyLinkedList<VMCache> ConsumerList;
|
||||
|
||||
public:
|
||||
VMCache();
|
||||
virtual ~VMCache();
|
||||
@@ -163,10 +175,12 @@ public:
|
||||
|
||||
virtual void Dump(bool showPages) const;
|
||||
|
||||
protected:
|
||||
virtual void DeleteObject() = 0;
|
||||
|
||||
public:
|
||||
VMArea* areas;
|
||||
list_link consumer_link;
|
||||
list consumers;
|
||||
ConsumerList consumers;
|
||||
// list of caches that use this cache as a source
|
||||
VMCachePagesTree pages;
|
||||
VMCache* source;
|
||||
|
||||
Reference in New Issue
Block a user