Skip to content

Commit 1cc3cd1

Browse files
committed
Modify the codes for the NC-ST mode
1 parent 361591c commit 1cc3cd1

File tree

5 files changed

+43
-19
lines changed

5 files changed

+43
-19
lines changed

my.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ innodb_page_cleaners=8
5656

5757
#nvdimm settings
5858
innodb_use_nvdimm_buffer=true
59-
innodb_nvdimm_buffer_pool_size=1G
60-
innodb_nvdimm_buffer_pool_instances=1
59+
innodb_nvdimm_buffer_pool_size=2G
60+
innodb_nvdimm_buffer_pool_instances=2
6161
innodb_nvdimm_pc_threshold_pct=15
6262

6363
#transaction log settings

storage/innobase/buf/.buf0flu.cc.swp

16 KB
Binary file not shown.

storage/innobase/buf/buf0buf.cc

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ my_bool srv_numa_interleave = FALSE;
7878
#ifdef UNIV_NVDIMM_CACHE
7979
#include "buf0nvdimm.h"
8080
ulint nvdimm_pc_threshold;
81-
81+
//bool wakeup_nvdimm_cleaner = FALSE;
82+
/*#ifdef UNIV_NVDIMM_CACHE_ST
83+
bool wakeup_nvdimm_stock_cleaner = FALSE;
84+
#endif*/ /* UNIV_NVDIMM_CACHE_ST */
8285
/** The NVDIMM buffer pools of the database */
8386
buf_pool_t* nvdimm_buf_pool_ptr;
8487
#endif /* UNIV_NVDIMM_CACHE */
@@ -6143,16 +6146,23 @@ buf_page_io_complete(
61436146
}
61446147
#endif /* UNIV_NVDIMM_CACHE_NO */
61456148

6146-
/*ulint remains = UT_LIST_GET_LEN(buf_pool->free);
6149+
/* ulint remains = UT_LIST_GET_LEN(buf_pool->free);
61476150
6148-
if (buf_pool->instance_no == 8
6151+
if (!wakeup_nvdimm_cleaner
6152+
&& buf_pool->instance_no == 8
61496153
&& remains < nvdimm_pc_threshold) {
61506154
os_event_set(buf_flush_nvdimm_event);
6151-
} else
6152-
if (buf_pool->instance_no == 9
6153-
&& remains < nvdimm_pc_threshold * 2) {
6155+
wakeup_nvdimm_cleaner = TRUE;
6156+
}
6157+
*/
6158+
/*#ifdef UNIV_NVDIMM_CACHE_ST
6159+
if (!wakeup_nvdimm_stock_cleaner
6160+
&& buf_pool->instance_no == 9
6161+
&& remains < nvdimm_pc_threshold * 2) {
61546162
os_event_set(buf_flush_nvdimm_stock_event);
6155-
}*/
6163+
wakeup_nvdimm_stock_cleaner = TRUE;
6164+
}
6165+
#endif*/ /* UNIV_NVDIMM_CACHE_ST */
61566166
}
61576167
#endif /* UNIV_NVDIMM_CACHE */
61586168

storage/innobase/buf/buf0flu.cc

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,14 @@ buf_flush_write_block_low(
11151115
} else {
11161116
bpage->moved_to_nvdimm = false;
11171117

1118+
ib::info() << bpage->id.space() << " " << bpage->id.page_no()
1119+
<< " is batch written. cached? " << bpage->cached_in_nvdimm
1120+
<< " moved? " << bpage->moved_to_nvdimm
1121+
<< " flush-type: " << flush_type
1122+
<< " buf-fix: " << bpage->buf_fix_count
1123+
<< " with oldest: " << bpage->oldest_modification
1124+
<< " newest: " << bpage->newest_modification;
1125+
11181126
if (!srv_use_doublewrite_buf
11191127
|| buf_dblwr == NULL
11201128
|| srv_read_only_mode
@@ -1128,12 +1136,6 @@ buf_flush_write_block_low(
11281136

11291137
IORequest request(type);
11301138

1131-
/*ib::info() << bpage->id.space() << " " << bpage->id.page_no()
1132-
<< " is batch written from " << bpage->cached_in_nvdimm
1133-
<< " flush-type: " << flush_type
1134-
<< " with oldest: " << bpage->oldest_modification
1135-
<< " newest: " << bpage->newest_modification;*/
1136-
11371139
fil_io(request,
11381140
sync, bpage->id, bpage->size, 0, bpage->size.physical(),
11391141
frame, bpage);
@@ -1186,8 +1188,8 @@ buf_flush_write_block_low(
11861188
ut_ad(!sync);
11871189
buf_dblwr_add_to_batch(bpage);
11881190
}
1189-
1190-
/* When doing single page flushing the IO is done synchronously
1191+
1192+
/* When doing single page flushing the IO is done synchronously
11911193
and we flush the changes to disk only for the tablespace we
11921194
are working on. */
11931195
if (sync) {
@@ -1306,7 +1308,7 @@ buf_flush_page(
13061308
lsn_t lsn_gap = bpage->oldest_modification - before_lsn;
13071309

13081310
/* FIXME: Ad-hoc method */
1309-
if (250000000 < lsn_gap && lsn_gap < 750000000) {
1311+
if (0 < lsn_gap && lsn_gap < 10000000000) {
13101312
//if (0 < lsn_gap && lsn_gap < 500000000) {
13111313
//ib::info() << "stock in " << bpage->id.space()
13121314
// << " " << bpage->id.page_no() << " " << bpage->flush_type << " " << lsn_gap;
@@ -1352,6 +1354,18 @@ buf_flush_page(
13521354
oldest_modification != 0. Thus, it cannot be relocated in the
13531355
buffer pool or removed from flush_list or LRU_list. */
13541356

1357+
if (bpage->id.space() == 32) {
1358+
lsn_t before_lsn = mach_read_from_8(reinterpret_cast<const buf_block_t *>(bpage)->frame + FIL_PAGE_LSN);
1359+
lsn_t lsn_gap = bpage->oldest_modification - before_lsn;
1360+
1361+
ib::info() << bpage->id.space() << " " << bpage->id.page_no()
1362+
<< " is written with flush-type: " << flush_type
1363+
<< " with oldest: " << bpage->oldest_modification
1364+
<< " newest: " << bpage->newest_modification
1365+
<< " lsn-gap: " << lsn_gap
1366+
<< " fix-count: " << bpage->buf_fix_count
1367+
<< " moved? " << bpage->moved_to_nvdimm;
1368+
}
13551369
buf_flush_write_block_low(bpage, flush_type, sync);
13561370
}
13571371

storage/innobase/buf/buf0lru.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,7 @@ nvdimm_buf_LRU_old_ratio_update(
25612561
#ifdef UNIV_NVDIMM_CACHE_ST
25622562
buf_pool = &nvdimm_buf_pool_ptr[1];
25632563
new_ratio = buf_LRU_old_ratio_update_instance(
2564-
buf_pool, 100 * 5 / 8, adjust);
2564+
buf_pool, 100 * 3 / 8, adjust);
25652565
#endif /* UNIV_NVDIMM_CACHE_ST */
25662566

25672567
return(new_ratio);

0 commit comments

Comments
 (0)