Skip to content

Commit 4dc2328

Browse files
committed
Update the monitoring code
1 parent 37a5cbf commit 4dc2328

File tree

5 files changed

+64
-55
lines changed

5 files changed

+64
-55
lines changed

build.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ cd $BASE_DIR
1515
if [ "$1" = "--origin" ]; then
1616
# No caching
1717
BUILD_FLAGS=""
18-
elif [ "$1" = "--nc-ol" ]; then
18+
elif [ "$1" = "--nc" ]; then
1919
# Cache New-Orders and Order-Line pages
20-
BUILD_FLAGS="-DUNIV_NVDIMM_CACHE -DUNIV_NVDIMM_CACHE_NO -DUNIV_NVDIMM_CACHE_OL"
20+
BUILD_FLAGS="-DUNIV_NVDIMM_CACHE"
2121
elif [ "$1" = "--nc-st" ]; then
22-
# Cache New-Orders and Stock pages
23-
BUILD_FLAGS="-DUNIV_NVDIMM_CACHE -DUNIV_NVDIMM_CACHE_NO -DUNIV_NVDIMM_CACHE_ST"
24-
elif [ "$1" = "--nc-ol-st" ]; then
2522
# Cache New-Orders, Order-Line and Stock pages
26-
BUILD_FLAGS="-DUNIV_NVDIMM_CACHE -DUNIV_NVDIMM_CACHE_NO -DUNIV_NVDIMM_CACHE_OL -DUNIV_NVDIMM_CACHE_ST"
23+
BUILD_FLAGS="-DUNIV_NVDIMM_CACHE -DUNIV_NVDIMM_CACHE_ST"
24+
elif [ "$1" = "--nc-st-od" ]; then
25+
# Cache New-Orders, Order-Line, Stock and Orders pages
26+
BUILD_FLAGS="-DUNIV_NVDIMM_CACHE -DUNIV_NVDIMM_CACHE_ST -DUNIV_NVDIMM_CACHE_OD"
2727
else
2828
# Cache New-Orders and Order-Line pages (default)
29-
BUILD_FLAGS="-DUNIV_NVDIMM_CACHE -DUNIV_NVDIMM_CACHE_NO -DUNIV_NVDIMM_CACHE_OL"
29+
BUILD_FLAGS="-DUNIV_NVDIMM_CACHE"
3030
fi
3131

3232
echo "Start build using $BUILD_FLAGS"

storage/innobase/buf/.buf0buf.cc.swp

232 KB
Binary file not shown.

storage/innobase/buf/buf0buf.cc

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4457,6 +4457,27 @@ buf_page_get_gen(
44574457
goto loop;
44584458
} else {
44594459
fix_block = block;
4460+
4461+
#ifdef UNIV_NVDIMM_CACHE
4462+
/* Buffer Hit */
4463+
if (buf_pool->instance_no >= 8) {
4464+
if (page_id.space() == 30) {
4465+
srv_stats.nvdimm_pages_read_ol.inc();
4466+
} else if (page_id.space() == 28) {
4467+
srv_stats.nvdimm_pages_read_no.inc();
4468+
}
4469+
#ifdef UNIV_NVDIMM_CACHE_OD
4470+
else if (page_id.space() == 29) {
4471+
srv_stats.nvdimm_pages_read_od.inc();
4472+
}
4473+
#endif /* UNIV_NVDIMM_CACHE_OD */
4474+
#ifdef UNIV_NVDIMM_CACHE_ST
4475+
else if (page_id.space() == 32) {
4476+
srv_stats.nvdimm_pages_read_st.inc();
4477+
}
4478+
#endif /* UNIV_NVDIMM_CACHE_ST */
4479+
}
4480+
#endif /* UNIV_NVDIMM_CACHE */
44604481
}
44614482

44624483
if (fsp_is_system_temporary(page_id.space())) {
@@ -5317,14 +5338,6 @@ buf_page_init(
53175338
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
53185339
page_id.fold(), &block->page);
53195340

5320-
#ifdef UNIV_NVDIMM_CACHE
5321-
#ifdef UNIV_NVDIMM_CACHE_NO
5322-
if (page_id.space() == 28 /* New-Orders table */) {
5323-
srv_stats.nvdimm_pages_stored_no.inc();
5324-
}
5325-
#endif /* UNIV_NVDIMM_CACHE_NO */
5326-
#endif /* UNIV_NVDIMM_CACHE */
5327-
53285341
if (page_size.is_compressed()) {
53295342
page_zip_set_size(&block->page.zip, page_size.physical());
53305343
}
@@ -5362,7 +5375,11 @@ buf_page_init_for_read(
53625375

53635376
#ifdef UNIV_NVDIMM_CACHE
53645377
if (mode == BUF_MOVE_TO_NVDIMM) {
5365-
if (page_id.space() == 30 || page_id.space() == 29) {
5378+
if (page_id.space() == 30
5379+
#ifdef UNIV_NVDIMM_CACHE_OD
5380+
|| page_id.space() == 29
5381+
#endif /* UNIV_NVDIMM_CACHE_OD */
5382+
) {
53665383
buf_pool = &nvdimm_buf_pool_ptr[0];
53675384
}
53685385
#ifdef UNIV_NVDIMM_CACHE_ST
@@ -6127,27 +6144,26 @@ buf_page_io_complete(
61276144
}
61286145

61296146
#ifdef UNIV_NVDIMM_CACHE
6130-
if (buf_pool->instance_no >= 8) {
6147+
if (buf_pool->instance_no >= 8
6148+
&& !bpage->cached_in_nvdimm) {
61316149
bpage->cached_in_nvdimm = true;
61326150

6133-
#ifdef UNIV_NVDIMM_CACHE_OL
61346151
if (bpage->id.space() == 30) {
6135-
srv_stats.nvdimm_pages_read_ol.inc();
6136-
} else if (bpage->id.space() == 29) {
6137-
srv_stats.nvdimm_pages_read_od.inc();
6152+
srv_stats.nvdimm_pages_stored_ol.inc();
6153+
} else if (bpage->id.space() == 28) {
6154+
srv_stats.nvdimm_pages_stored_no.inc();
6155+
}
6156+
#ifdef UNIV_NVDIMM_CACHE_OD
6157+
else if (bpage->id.space() == 29) {
6158+
srv_stats.nvdimm_pages_stored_od.inc();
61386159
}
6139-
#endif /* UNIV_NVDIMM_CACHE_OL */
6160+
#endif /* UNIV_NVDIMM_CACHE_OD */
61406161
#ifdef UNIV_NVDIMM_CACHE_ST
6141-
if (bpage->id.space() == 32) {
6142-
srv_stats.nvdimm_pages_read_st.inc();
6162+
else if (bpage->id.space() == 32) {
6163+
srv_stats.nvdimm_pages_stored_st.inc();
61436164
}
61446165
#endif /* UNIV_NVDIMM_CACHE_ST */
6145-
#ifdef UNIV_NVDIMM_CACHE_NO
6146-
if (bpage->id.space() == 28) {
6147-
srv_stats.nvdimm_pages_read_no.inc();
6148-
}
6149-
#endif /* UNIV_NVDIMM_CACHE_NO */
6150-
6166+
61516167
/* ulint remains = UT_LIST_GET_LEN(buf_pool->free);
61526168
61536169
if (!wakeup_nvdimm_cleaner
@@ -6187,23 +6203,21 @@ buf_page_io_complete(
61876203

61886204
#ifdef UNIV_NVDIMM_CACHE
61896205
if (bpage->cached_in_nvdimm) {
6190-
#ifdef UNIV_NVDIMM_CACHE_OL
61916206
if (bpage->id.space() == 30) {
61926207
srv_stats.nvdimm_pages_written_ol.inc();
6193-
} else if (bpage->id.space() == 29) {
6208+
} else if (bpage->id.space() == 28) {
6209+
srv_stats.nvdimm_pages_written_no.inc();
6210+
}
6211+
#ifdef UNIV_NVDIMM_CACHE_OD
6212+
else if (bpage->id.space() == 29) {
61946213
srv_stats.nvdimm_pages_written_od.inc();
61956214
}
6196-
#endif /* UNIV_NVDIMM_CACHE_OL */
6215+
#endif /* UNIV_NVDIMM_CACHE_OD */
61976216
#ifdef UNIV_NVDIMM_CACHE_ST
6198-
if (bpage->id.space() == 32) {
6217+
else if (bpage->id.space() == 32) {
61996218
srv_stats.nvdimm_pages_written_st.inc();
62006219
}
6201-
#endif /* UNIV_NVDIMM_CACHE_ST */
6202-
#ifdef UNIV_NVDIMM_CACHE_NO
6203-
if (bpage->id.space() == 28) {
6204-
srv_stats.nvdimm_pages_written_no.inc();
6205-
}
6206-
#endif /* UNIV_NVDIMM_CACHE_NO */
6220+
#endif /* UNIV_NVDIMM_CACHE_ST */
62076221
}
62086222
#endif /* UNIV_NVDIMM_CACHE */
62096223

@@ -7309,15 +7323,11 @@ buf_print_io(
73097323
#ifdef UNIV_NVDIMM_CACHE
73107324
/** Checks whether this page should be moved to the NVDIMM buffer. */
73117325
bool buf_block_will_be_moved_to_nvdimm(const page_id_t& page_id) {
7312-
#ifdef UNIV_NVDIMM_CACHE_NO
73137326
if (page_id.space() == 28 /* New-Orders table */) {
73147327
return (true);
73157328
} else {
73167329
return (false);
73177330
}
7318-
#else
7319-
return (false);
7320-
#endif /* UNIV_NVDIMM_CACHE_NO */
73217331
}
73227332
#endif /* UNIV_NVDIMM_CACHE */
73237333

storage/innobase/buf/buf0flu.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,6 @@ buf_flush_page(
12921292
++buf_pool->n_flush[flush_type];
12931293

12941294
#ifdef UNIV_NVDIMM_CACHE
1295-
#ifdef UNIV_NVDIMM_CACHE_OL
12961295
/* Separate Order-Line leaf page from the other pages. */
12971296
if (bpage->id.space() == 30 /* Order-Line tablespace */
12981297
&& bpage->buf_fix_count == 0 /* Not fixed */
@@ -1307,11 +1306,10 @@ buf_flush_page(
13071306
&& page_is_leaf(frame) /* Leaf page */) {
13081307
//ib::info() << bpage->id.space() << " " << bpage->id.page_no() << " ol " << bpage->flush_type;
13091308
bpage->moved_to_nvdimm = true;
1310-
srv_stats.nvdimm_pages_stored_ol.inc();
13111309
}
13121310
}
1313-
1314-
/* Separate Orders leaf page from the other pages. */
1311+
#ifdef UNIV_NVDIMM_CACHE_OD
1312+
/* Separate Orders leaf page from the other pages. */
13151313
if (bpage->id.space() == 29 /* Order-Line tablespace */
13161314
&& bpage->buf_fix_count == 0 /* Not fixed */
13171315
&& !bpage->cached_in_nvdimm) { /* Not cached in NVDIMM */
@@ -1325,10 +1323,9 @@ buf_flush_page(
13251323
&& page_is_leaf(frame) /* Leaf page */) {
13261324
//ib::info() << bpage->id.space() << " " << bpage->id.page_no() << " od " << bpage->flush_type;
13271325
bpage->moved_to_nvdimm = true;
1328-
srv_stats.nvdimm_pages_stored_od.inc();
13291326
}
13301327
}
1331-
#endif /* UNIV_NVDIMM_CACHE_OL */
1328+
#endif /* UNIV_NVDIMM_CACHE_OD */
13321329
#ifdef UNIV_NVDIMM_CACHE_ST
13331330
if (bpage->id.space() == 32 /* Stock tablespace */
13341331
&& bpage->buf_fix_count == 0 /* Not fixed */
@@ -1342,7 +1339,6 @@ buf_flush_page(
13421339
//ib::info() << bpage->id.space() << " " << bpage->id.page_no()
13431340
// << " st " << bpage->flush_type << " " << lsn_gap;
13441341
bpage->moved_to_nvdimm = true;
1345-
srv_stats.nvdimm_pages_stored_st.inc();
13461342
}
13471343
}
13481344
#endif /* UNIV_NVDIMM_CACHE_ST */

storage/innobase/include/buf0buf.ic

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,14 +1033,17 @@ buf_pool_get(
10331033
if (buf_block_will_be_moved_to_nvdimm(page_id)) {
10341034
return(&nvdimm_buf_pool_ptr[0]);
10351035
}
1036-
#ifdef UNIV_NVDIMM_CACHE_OL
1037-
if ((page_id.space() == 30 || page_id.space() == 29)
1036+
1037+
if ((page_id.space() == 30
1038+
#ifdef UNIV_NVDIMM_CACHE_OD
1039+
|| page_id.space() == 29
1040+
#endif /* UNIV_NVDIMM_CACHE_OD */
1041+
)
10381042
&& buf_page_hash_get_low(&nvdimm_buf_pool_ptr[0], page_id)) {
10391043
return(&nvdimm_buf_pool_ptr[0]);
10401044
}
1041-
#endif /* UNIV_NVDIMM_CACHE_OL */
10421045
#ifdef UNIV_NVDIMM_CACHE_ST
1043-
if (page_id.space() == 32
1046+
else if (page_id.space() == 32
10441047
&& buf_page_hash_get_low(&nvdimm_buf_pool_ptr[1], page_id)) {
10451048
return(&nvdimm_buf_pool_ptr[1]);
10461049
}

0 commit comments

Comments
 (0)