HDF5  1.12.0
H5PBprivate.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*-------------------------------------------------------------------------
15  *
16  * Created: H5PBprivate.h
17  * June 2014
18  * Mohamad Chaarawi
19  *
20  *-------------------------------------------------------------------------
21  */
22 
23 #ifndef _H5PBprivate_H
24 #define _H5PBprivate_H
25 
26 /* Include package's public header */
27 #ifdef NOT_YET
28 #include "H5PBpublic.h"
29 #endif /* NOT_YET */
30 
31 /* Private headers needed by this header */
32 #include "H5private.h" /* Generic Functions */
33 #include "H5Fprivate.h" /* File access */
34 #include "H5FLprivate.h" /* Free Lists */
35 #include "H5SLprivate.h" /* Skip List */
36 
37 
38 /**************************/
39 /* Library Private Macros */
40 /**************************/
41 
42 
43 /****************************/
44 /* Library Private Typedefs */
45 /****************************/
46 
47 /* Forward declaration for a page buffer entry */
48 struct H5PB_entry_t;
49 
50 /* Typedef for the main structure for the page buffer */
51 typedef struct H5PB_t {
52  size_t max_size; /* The total page buffer size */
53  size_t page_size; /* Size of a single page */
54  unsigned min_meta_perc; /* Minimum ratio of metadata entries required before evicting meta entries */
55  unsigned min_raw_perc; /* Minimum ratio of raw data entries required before evicting raw entries */
56  unsigned meta_count; /* Number of entries for metadata */
57  unsigned raw_count; /* Number of entries for raw data */
58  unsigned min_meta_count; /* Minimum # of entries for metadata */
59  unsigned min_raw_count; /* Minimum # of entries for raw data */
60 
61  H5SL_t *slist_ptr; /* Skip list with all the active page entries */
62  H5SL_t *mf_slist_ptr; /* Skip list containing newly allocated page entries inserted from the MF layer */
63 
64  size_t LRU_list_len; /* Number of entries in the LRU (identical to slist_ptr count) */
65  struct H5PB_entry_t *LRU_head_ptr; /* Head pointer of the LRU */
66  struct H5PB_entry_t *LRU_tail_ptr; /* Tail pointer of the LRU */
67 
68  H5FL_fac_head_t *page_fac; /* Factory for allocating pages */
69 
70  /* Statistics */
71  unsigned accesses[2];
72  unsigned hits[2];
73  unsigned misses[2];
74  unsigned evictions[2];
75  unsigned bypasses[2];
77 
78 /*****************************/
79 /* Library-private Variables */
80 /*****************************/
81 
82 
83 /***************************************/
84 /* Library-private Function Prototypes */
85 /***************************************/
86 
87 /* General routines */
88 H5_DLL herr_t H5PB_create(H5F_shared_t *f_sh, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc);
92 H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf);
94 H5_DLL herr_t H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/);
95 H5_DLL herr_t H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
96 
97 /* Statistics routines */
99 H5_DLL herr_t H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2],
100  unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]);
101 H5_DLL herr_t H5PB_print_stats(const H5PB_t *page_buf);
102 
103 #endif /* !_H5PBprivate_H */
104 
H5PB_read
H5_DLL herr_t H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf)
Definition: H5PB.c:690
H5PB_update_entry
H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf)
Definition: H5PB.c:592
H5PB_t::bypasses
unsigned bypasses[2]
Definition: H5PBprivate.h:75
H5SL_t
Definition: H5SL.c:557
size
iblock size
Definition: H5EAcache.c:787
H5PB_t::min_raw_perc
unsigned min_raw_perc
Definition: H5PBprivate.h:55
H5PB_write
H5_DLL herr_t H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf)
Definition: H5PB.c:987
H5PB_t::min_meta_count
unsigned min_meta_count
Definition: H5PBprivate.h:58
H5PB_t::min_raw_count
unsigned min_raw_count
Definition: H5PBprivate.h:59
H5PB_t::evictions
unsigned evictions[2]
Definition: H5PBprivate.h:74
haddr_t
CATCH haddr_t
Definition: H5EAdblock.c:162
H5PB_dest
H5_DLL herr_t H5PB_dest(H5F_shared_t *f_sh)
Definition: H5PB.c:475
H5PB_t::max_size
size_t max_size
Definition: H5PBprivate.h:52
H5PB_print_stats
H5_DLL herr_t H5PB_print_stats(const H5PB_t *page_buf)
Definition: H5PB.c:250
H5PB_entry_t
Definition: H5PBpkg.h:35
H5FL_fac_head_t
Definition: H5FLprivate.h:354
H5PB_t::accesses
unsigned accesses[2]
Definition: H5PBprivate.h:71
H5F_shared_t
Definition: H5Fpkg.h:242
H5PB_flush
H5_DLL herr_t H5PB_flush(H5F_shared_t *f_sh)
Definition: H5PB.c:403
H5SLprivate.h
H5PB_t::raw_count
unsigned raw_count
Definition: H5PBprivate.h:57
H5PB_t::hits
unsigned hits[2]
Definition: H5PBprivate.h:72
H5Fprivate.h
H5PB_entry_t::type
H5F_mem_page_t type
Definition: H5PBpkg.h:38
H5PB_t::misses
unsigned misses[2]
Definition: H5PBprivate.h:73
H5PB_t::LRU_list_len
size_t LRU_list_len
Definition: H5PBprivate.h:64
H5PB_t::page_size
size_t page_size
Definition: H5PBprivate.h:53
H5PB_t
Definition: H5PBprivate.h:51
H5FD_mem_t
enum H5F_mem_t H5FD_mem_t
Definition: H5FDpublic.h:28
H5PB_create
H5_DLL herr_t H5PB_create(H5F_shared_t *f_sh, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc)
Definition: H5PB.c:292
H5PB_t::meta_count
unsigned meta_count
Definition: H5PBprivate.h:56
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5PB_t::mf_slist_ptr
H5SL_t * mf_slist_ptr
Definition: H5PBprivate.h:62
H5PB_add_new_page
H5_DLL herr_t H5PB_add_new_page(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t page_addr)
Definition: H5PB.c:532
H5PB_t
struct H5PB_t H5PB_t
H5FLprivate.h
H5PB_t::page_fac
H5FL_fac_head_t * page_fac
Definition: H5PBprivate.h:68
herr_t
int herr_t
Definition: H5public.h:128
H5PB_t::LRU_head_ptr
struct H5PB_entry_t * LRU_head_ptr
Definition: H5PBprivate.h:65
H5PB_reset_stats
H5_DLL herr_t H5PB_reset_stats(H5PB_t *page_buf)
Definition: H5PB.c:170
H5PB_t::slist_ptr
H5SL_t * slist_ptr
Definition: H5PBprivate.h:61
H5PB_entry_t::addr
haddr_t addr
Definition: H5PBpkg.h:37
H5PB_t::LRU_tail_ptr
struct H5PB_entry_t * LRU_tail_ptr
Definition: H5PBprivate.h:66
H5PB_t::min_meta_perc
unsigned min_meta_perc
Definition: H5PBprivate.h:54
H5PB_get_stats
H5_DLL herr_t H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2], unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2])
Definition: H5PB.c:212
H5private.h
H5PB_remove_entry
H5_DLL herr_t H5PB_remove_entry(const H5F_shared_t *f_sh, haddr_t addr)
Definition: H5PB.c:640