summaryrefslogtreecommitdiff
path: root/dist/serial.py
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@wiredtiger.com>2011-07-08 11:35:20 -0400
committerKeith Bostic <keith.bostic@wiredtiger.com>2011-07-08 11:35:20 -0400
commit4d044df4baef631b6cc6182ade269bd68fe19a3f (patch)
tree1b29a3a45c8b89e32501289a0b9b41be9fe2a901 /dist/serial.py
parent0773fda0ad87cad4396ae2d92c97af89e1e41ae4 (diff)
downloadmongo-4d044df4baef631b6cc6182ade269bd68fe19a3f.tar.gz
Add memory-footprint field to the in-memory page structure, it's used
to track the memory in use by that page. (Delete the page's cache-counted flag, if the page has memory associated with it, it's treated as cache counted.) The workQ now has its own pages/bytes allocated fields so we can track memory use when pages are created in memory. Couple workq setting/incrementing the memory allocated to an in-memory page to the serialization functions: if you pass in a chunk of malloc'd memory, you have to pass in its logical size as well, and that size is added to the page's memory footprint if the chunk is used. Now that we allocate new pages in memory, we have to check to see if the eviction server needs to run regardless of whether or not we've read from the backing file. Split "evict" verbose keyword into "evictserver" and "reconcile". Include btree.i and cell.i in wt_internal.in. --HG-- rename : src/include/api.h => src/include/cursor.h extra : rebase_source : 0f24170ef1eee54dd7a34be45d65e96b69461af5
Diffstat (limited to 'dist/serial.py')
-rw-r--r--dist/serial.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/dist/serial.py b/dist/serial.py
index a00e953da95..86ae31e6ae1 100644
--- a/dist/serial.py
+++ b/dist/serial.py
@@ -99,6 +99,7 @@ def output(entry, f):
for l in entry[1].args:
f.write('\t' + decl(l) + ';\n')
if l[2]:
+ f.write('\tint ' + l[1] + '_size;\n')
f.write('\tint ' + l[1] + '_taken;\n')
f.write('} __wt_' + entry[0] + '_args;\n\n')
@@ -107,7 +108,7 @@ def output(entry, f):
o = 'WT_SESSION_IMPL *session'
for l in entry[1].args:
if l[2]:
- o += ', ' + decl_p(l)
+ o += ', ' + decl_p(l) + ', uint32_t ' + l[1] + '_size'
else:
o += ', ' + decl(l)
o += ')'
@@ -123,13 +124,15 @@ def output(entry, f):
f.write('\telse {\n')
f.write('\t\targs->' + l[1] + ' = *' + l[1] + 'p;\n')
f.write('\t\t*' + l[1] + 'p = NULL;\n')
+ f.write('\t\targs->' +
+ l[1] + '_size = ' + l[1] + '_size;\n')
f.write('\t}\n')
- f.write('\targs->' + l[1] + '_taken = 0;\n')
+ f.write('\targs->' + l[1] + '_taken = 0;\n\n')
else:
- f.write('\targs->' + l[1] + ' = ' + l[1] + ';\n')
+ f.write('\targs->' + l[1] + ' = ' + l[1] + ';\n\n')
f.write('\tret = __wt_session_serialize_func(session,\n')
f.write('\t ' + entry[1].op + ', ' + str(entry[1].spin) +
- ', __wt_' + entry[1].key + '_serial_func, args);\n')
+ ', __wt_' + entry[1].key + '_serial_func, args);\n\n')
for l in entry[1].args:
if l[2]:
f.write('\tif (!args->' + l[1] + '_taken)\n')
@@ -148,7 +151,7 @@ def output(entry, f):
f.write('\t' + l + '\n')
f.write('{\n')
f.write('\t__wt_' + entry[0] + '_args *args =\n ')
- f.write('(__wt_' + entry[0] + '_args *)session->wq_args;\n')
+ f.write('(__wt_' + entry[0] + '_args *)session->wq_args;\n\n')
for l in entry[1].args:
f.write('\t*' + l[1] + 'p = args->' + l[1] + ';\n')
f.write('}\n')
@@ -158,13 +161,18 @@ def output(entry, f):
if l[2]:
f.write('\n')
f.write('static inline void\n__wt_' + entry[0] +
- '_' + l[1] + '_taken(WT_SESSION_IMPL *session)\n')
+ '_' + l[1] +
+ '_taken(WT_SESSION_IMPL *session, WT_PAGE *page)\n')
f.write('{\n')
f.write('\t__wt_' +
entry[0] + '_args *args =\n ')
f.write('(__wt_' +
entry[0] + '_args *)session->wq_args;\n\n')
- f.write('\targs->' + l[1] + '_taken = 1;\n')
+ f.write('\targs->' + l[1] + '_taken = 1;\n\n')
+ f.write('\tWT_ASSERT(session, args->' +
+ l[1] + '_size != 0);\n')
+ f.write('\t__wt_cache_page_workq_incr(' +
+ 'session, page, args->' + l[1] + '_size);\n')
f.write('}\n')
#####################################################################