Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ././../../../../../../usr/include/vm/dedup_impl.h
Real path: /usr/include/vm/dedup_impl.h
Zurück
/* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. */ #ifndef _VM_DEDUP_IMPL_H #define _VM_DEDUP_IMPL_H #include <sys/types.h> #include <sys/avl.h> #include <sys/kstat2.h> #include <sys/list.h> #include <sys/time.h> #include <sys/kom.h> #include <sys/vnode.h> #include <vm/types.h> #include <vm/page.h> #include <vm/dedup.h> #ifdef __cplusplus extern "C" { #endif #include <sys/sha2.h> /* * The dd_hash_node is embedded in the KOM object payload of the dedup page * object, and provides the linkage between the dedup page object and the * dd_hash AVL tree indexed by the SHA512 hash of its contents. Each consumer * of a dedup page has a unique handle to the object in a dd_page structure. * The KOM framework will call the hash callback to remove the linkage from * the AVL tree when the last reference to the dedup page is dropped by the * last consumer which referenced it before freeing the dedup page object. */ typedef struct dd_hash_node { uchar_t ddhn_hash[SHA512_DIGEST_LENGTH]; avl_node_t ddhn_avl_node; } dd_hash_node_t; #define DD_SEG_MAGIC 0xfeedbeeffeedbeefULL /* * There is a tag structure for each reference to a dd_page structure from a * segment. So for example if a one large page segment is shared by four * segments, and three of them are using the same vnode/offset but the other * is sharing by virtue of contents only, there will be two dd_page structures * with one having three references and the other having one reference. The * taglist of the first dd_page will point to three segments with the same * vnode/offset being mapped, and the fourth will point to a different * vnode/offset but the same pagesize and contents appearing there. */ typedef struct dd_tag { list_node_t ddt_list_node; dd_seg_t *ddt_seg; dd_page_t *ddt_page; } dd_tag_t; /* * Each segment which uses dedup pages references an array of dd_page * structures. Each dd_page has a handle which references the dedup page * object, and the vnode/offset/pagesize of the original page this page is * deduplicating. Each dd_page is linked in the dd_vn AVL tree for fast lookup * by vnode/offset; the lookup only goes to the dd_hash AVL tree if an existent * dd_page is not found for the given vnode/offset. */ struct dd_page { kmutex_t ddp_mtx; kom_handle_t *ddp_handle; /* owner field points to dd_page */ pfn_t ddp_pfn; page_t *ddp_bpp; size_t ddp_refcnt; list_t ddp_taglist; vnode_t *ddp_vnode; u_offset_t ddp_offset; /* must be after vnode */ size_t ddp_pgsz; /* must be after offset */ avl_node_t ddp_avl_node; kmutex_t *ddp_content_mtx; }; /* * When we use KOM objects we need to pass sufficient information to the * EVENT_DESTROY callback to be able to reverse any operations done to the KOM * object and its payload. * * The dd_hash_node MUST be the first element of the structure as the hash * lookup code needs to perform kom_payload operations based on the address of * the dd_hash_node_t retrieved from the dd_hash AVL tree. */ typedef struct dd_kom_payload { dd_hash_node_t ddkp_ddhn; pfn_t ddkp_pfn; pgcnt_t ddkp_npgs; } dd_kom_payload_t; /* * Each segment which uses dedup pages has a dd_seg structure which is pointed * at by the opaque svd->dedup_data pointer. This contains an array of all of * the dedup pages which are referenced by the segment. */ struct dd_seg { uint64_t dds_magic; /* 0xfeedbeeffeedbeef */ kmutex_t dds_mtx; caddr_t dds_addr; size_t dds_len; size_t dds_pgsz; vnode_t *dds_vp; u_offset_t dds_offset; dd_page_t **dds_pages; pgcnt_t dds_npgs; pgcnt_t dds_pgs_inuse; }; struct dedup_pgcnt { kstat2_named_t dd_pagesize; /* number of bytes in lgpgsz */ kstat2_named_t dd_hash_found; /* found in dedup hash */ kstat2_named_t dd_hash_misses; /* dedup hash misses */ kstat2_named_t dd_pages_hashed; /* # pages hashed */ kstat2_named_t dd_pages_inuse; /* # dedup pages in use */ kstat2_named_t dd_pages_failed; /* total # dedup pages failed */ }; /* * Maximum number of page sizes greater than PAGESIZE supported. * * Each index is a supported large page size as reported by the processor. * * At present, this is set to 3, based on the number of large text page sizes * supported on SPARC: 64K, 4M and 256M. * * At present, x64 supports only a single large page size, 2M. */ #define DEDUP_MAX_NLPGSZS_SUPPORTED 3 struct dedupcnt { kstat2_named_t dd_vnode_hits; /* found in AVL tree */ kstat2_named_t dd_vnode_misses; /* not found in AVL tree */ kstat2_named_t dd_bytes_deduped; /* total bytes deduped */ struct dedup_pgcnt dd_pagecounts[DEDUP_MAX_NLPGSZS_SUPPORTED]; }; #ifdef __cplusplus } #endif #endif /* _VM_DEDUP_IMPL_H */