├── .gitignore ├── README.md ├── benchmark ├── application │ ├── linux │ │ ├── kevin │ │ │ ├── linux.sh │ │ │ ├── load_linux.sh │ │ │ └── rsync.sh │ │ ├── linux.sh │ │ ├── load_linux.sh │ │ └── rsync.sh │ └── tpcc │ │ ├── kevin │ │ ├── load_tpcc.sh │ │ └── tpcc.sh │ │ ├── load_tpcc.sh │ │ ├── sql │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── add_fkey_idx.sql │ │ ├── count.sql │ │ ├── create_table.sql │ │ ├── drop_cons.sql │ │ ├── load.sh │ │ ├── load_multi_schema.sh │ │ ├── run.sh │ │ ├── schema2 │ │ │ ├── add_fkey_idx.sql │ │ │ ├── count.sql │ │ │ ├── create_table.sql │ │ │ └── drop_cons.sql │ │ ├── scripts │ │ │ ├── 2instances │ │ │ │ └── run.sh │ │ │ ├── analyze.full.sh │ │ │ ├── analyze.sh │ │ │ ├── analyzeR.sh │ │ │ ├── analyze_checkpoint.sh │ │ │ ├── analyze_checkpoint_xtradb.sh │ │ │ ├── analyze_checkpoint_xtradb1.sh │ │ │ ├── analyze_dirty.sh │ │ │ ├── analyze_evicted.sh │ │ │ ├── analyze_flushed.sh │ │ │ ├── analyze_flushed_innodb.sh │ │ │ ├── analyze_min.sh │ │ │ ├── analyze_modified.sh │ │ │ ├── flashcache_stat.sh │ │ │ ├── innodb_stat.sh │ │ │ ├── memlock │ │ │ ├── memlock.c │ │ │ ├── multi-instances │ │ │ │ └── runX.sh │ │ │ ├── parse_trx.py │ │ │ ├── remote │ │ │ │ └── runX.sh │ │ │ ├── run.sh │ │ │ ├── runX.sh │ │ │ ├── run_no_backup.sh │ │ │ └── virident_stat.sh │ │ ├── src │ │ │ ├── Makefile │ │ │ ├── delivery.c │ │ │ ├── driver.c │ │ │ ├── load.c │ │ │ ├── main.c │ │ │ ├── neword.c │ │ │ ├── ordstat.c │ │ │ ├── parse_port.h │ │ │ ├── payment.c │ │ │ ├── rthist.c │ │ │ ├── rthist.h │ │ │ ├── sb_percentile.c │ │ │ ├── sb_percentile.h │ │ │ ├── sequence.c │ │ │ ├── sequence.h │ │ │ ├── slev.c │ │ │ ├── spt_proc.c │ │ │ ├── spt_proc.h │ │ │ ├── support.c │ │ │ ├── tpc.h │ │ │ └── trans_if.h │ │ ├── total.sh │ │ ├── tpcc_load │ │ └── tpcc_start │ │ └── tpcc.sh ├── cheeze │ ├── Makefile │ ├── b │ ├── blk.c │ ├── cheeze.h │ ├── crc32c.c │ ├── queue.c │ ├── replay.c │ ├── shm.c │ └── user.c ├── example ├── filebench │ ├── example │ │ ├── micro_copyfiles.f │ │ ├── micro_createfiles_empty.f │ │ ├── micro_delete.f │ │ ├── micro_makedirs.f │ │ └── micro_removedirs.f │ ├── filebench_nvme.sh │ ├── filebench_vm.sh │ ├── filebench_vm_kevin.sh │ ├── load_only │ │ ├── micro_copyfiles.f │ │ ├── micro_createfiles.f │ │ ├── micro_createfiles_empty.f │ │ ├── micro_delete.f │ │ ├── micro_delete_empty.f │ │ ├── micro_listdirs_empty.f │ │ ├── micro_makedirs.f │ │ ├── micro_removedirs.f │ │ ├── real_fileserver.f │ │ ├── real_oltp.f │ │ ├── real_varmail.f │ │ ├── real_webproxy.f │ │ └── real_webserver.f │ └── workloads │ │ ├── micro_copyfiles.f │ │ ├── micro_createfiles.f │ │ ├── micro_createfiles_empty.f │ │ ├── micro_delete.f │ │ ├── micro_delete_empty.f │ │ ├── micro_listdirs_empty.f │ │ ├── micro_makedirs.f │ │ ├── micro_removedirs.f │ │ ├── real_fileserver.f │ │ ├── real_oltp.f │ │ ├── real_varmail.f │ │ ├── real_webproxy.f │ │ └── real_webserver.f ├── fio │ ├── fio.sh │ ├── fio_kevin.sh │ ├── global.fio │ ├── randread.fio │ ├── randwrite.fio │ ├── seqread.fio │ └── seqwrite.fio ├── fragmentation │ ├── frag_file.f │ ├── frag_filebench_geriatrix-kevin.sh │ ├── frag_filebench_geriatrix.sh │ ├── load_only │ │ ├── micro_copyfiles.f │ │ ├── micro_createfiles.f │ │ ├── micro_createfiles_empty.f │ │ ├── micro_delete.f │ │ ├── micro_delete_empty.f │ │ ├── micro_listdirs.f │ │ ├── micro_makedirs.f │ │ ├── micro_removedirs.f │ │ ├── real_fileserver.f │ │ ├── real_oltp.f │ │ ├── real_varmail.f │ │ ├── real_webproxy.f │ │ └── real_webserver.f │ └── workloads │ │ ├── micro_copyfiles.f │ │ ├── micro_createfiles.f │ │ ├── micro_createfiles_empty.f │ │ ├── micro_delete.f │ │ ├── micro_delete_empty.f │ │ ├── micro_listdirs_empty.f │ │ ├── micro_makedirs.f │ │ ├── micro_removedirs.f │ │ ├── real_fileserver.f │ │ ├── real_oltp.f │ │ ├── real_varmail.f │ │ ├── real_webproxy.f │ │ └── real_webserver.f ├── general │ ├── blk_map │ │ ├── .nfs0000000000fc177d00000001 │ │ ├── 01_create_map.py │ │ ├── 02_trace_map.py │ │ ├── dump.txt │ │ └── parse.sh │ ├── blktrace.sh │ ├── btrfs.sh │ ├── cutloadtrace.sh │ ├── cuttrace.sh │ ├── dumpfs.sh │ ├── ext4_data_journal.sh │ ├── ext4_metadata_journal.sh │ ├── ext4_no_journal.sh │ ├── ext4_wb_journal.sh │ ├── f2fs.sh │ ├── flush_cache.sh │ ├── genfiostat.sh │ ├── genmasterstat.sh │ ├── genstat.sh │ ├── gentrace.sh │ ├── get_lba_by_inode_number.sh │ ├── io_count_parser.c │ ├── kukasum.sh │ ├── parser.sh │ ├── parser_ext4 │ ├── parser_xfs │ ├── vmsum.sh │ └── xfs.sh ├── setup_cheeze.sh ├── setup_vm.sh ├── ssd-fio.sh └── unused │ ├── filebench_betrfs.sh │ ├── filebench_ext4.sh │ ├── filebench_vm-delay.sh │ ├── filebench_vm-fio-delay.sh │ ├── filebench_vm2vm.sh │ ├── lightfs │ ├── bench.sh │ ├── setup_lightfs.sh │ ├── setup_vm.sh │ ├── tmp │ │ ├── copyfiles_16_gamma_fuse.f │ │ ├── filemicro_createfiles_16_fuse.f │ │ ├── filemicro_delete_16_fuse.f │ │ ├── fileserver_gamma_fuse.f │ │ ├── makedirs_16_fuse.f │ │ ├── micro_copyfiles.f │ │ ├── micro_createfiles.f │ │ ├── micro_createfiles_empty.f │ │ ├── micro_delete.f │ │ ├── micro_makedirs.f │ │ ├── micro_removedirs.f │ │ ├── removedirs_16_fuse.f │ │ ├── tmp.f │ │ ├── tmp_fileserver_gamma_fuse.f │ │ ├── varmail_gamma_fuse.f │ │ ├── webproxy_gamma_fuse.f │ │ └── webserver_gamma_fuse.f │ └── ttest.sh │ └── setup_cheeze_vm2vm.sh ├── bin └── rm ├── env ├── kevinfs ├── .gitignore ├── Makefile ├── bloomfilter.c ├── bloomfilter.h ├── cheeze │ ├── blk.c │ ├── cheeze.h │ ├── queue.c │ └── shm.c ├── db.h ├── dummy.dev ├── lightfs.h ├── lightfs_bstore.c ├── lightfs_cache.c ├── lightfs_cache.h ├── lightfs_db.c ├── lightfs_db.h ├── lightfs_db_env.c ├── lightfs_db_env.h ├── lightfs_debug.h ├── lightfs_fs.h ├── lightfs_io.c ├── lightfs_io.h ├── lightfs_module.c ├── lightfs_queue.c ├── lightfs_queue.h ├── lightfs_reada.c ├── lightfs_reada.h ├── lightfs_super.c ├── lightfs_txn_hdlr.c ├── lightfs_txn_hdlr.h ├── mkinclude ├── murmur3.c ├── murmur3.h ├── rbtreekv.c ├── rbtreekv.h └── run.sh ├── libvirt └── passthru.xml └── patches └── geriatrix.patch /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | RUN apt-get update && apt-get install -y gcc libc6-dev zlib1g-dev make libmysqlclient-dev 4 | 5 | ADD . /tpcc-mysql 6 | ENV PATH /tpcc-mysql:$PATH 7 | WORKDIR /tpcc-mysql 8 | RUN cd src && make 9 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/README.md: -------------------------------------------------------------------------------- 1 | 1. Build binaries 2 | * `cd src ; make` 3 | ( you should have mysql_config available in $PATH) 4 | 5 | 2. Load data 6 | * create database 7 | `mysqladmin create tpcc1000` 8 | * create tables 9 | `mysql tpcc1000 < create_table.sql` 10 | * create indexes and FK ( this step can be done after loading data) 11 | `mysql tpcc1000 < add_fkey_idx.sql` 12 | * populate data 13 | - simple step 14 | `tpcc_load -h127.0.0.1 -d tpcc1000 -u root -p "" -w 1000` 15 | |hostname:port| |dbname| |user| |password| |WAREHOUSES| 16 | ref. tpcc_load --help for all options 17 | - load data in parallel 18 | check load.sh script 19 | 20 | 3. Start benchmark 21 | * `./tpcc_start -h127.0.0.1 -P3306 -dtpcc1000 -uroot -w1000 -c32 -r10 -l10800` 22 | * |hostname| |port| |dbname| |user| |WAREHOUSES| |CONNECTIONS| |WARMUP TIME| |BENCHMARK TIME| 23 | * ref. tpcc_start --help for all options 24 | 25 | Output 26 | =================================== 27 | 28 | With the defined interval (-i option), the tool will produce the following output: 29 | ``` 30 | 10, trx: 12920, 95%: 9.483, 99%: 18.738, max_rt: 213.169, 12919|98.778, 1292|101.096, 1293|443.955, 1293|670.842 31 | 20, trx: 12666, 95%: 7.074, 99%: 15.578, max_rt: 53.733, 12668|50.420, 1267|35.846, 1266|58.292, 1267|37.421 32 | 30, trx: 13269, 95%: 6.806, 99%: 13.126, max_rt: 41.425, 13267|27.968, 1327|32.242, 1327|40.529, 1327|29.580 33 | 40, trx: 12721, 95%: 7.265, 99%: 15.223, max_rt: 60.368, 12721|42.837, 1271|34.567, 1272|64.284, 1272|22.947 34 | 50, trx: 12573, 95%: 7.185, 99%: 14.624, max_rt: 48.607, 12573|45.345, 1258|41.104, 1258|54.022, 1257|26.626 35 | ``` 36 | 37 | Where: 38 | * 10 - the seconds from the start of the benchmark 39 | * trx: 12920 - New Order transactions executed during the gived interval (in this case, for the previous 10 sec). Basically this is the throughput per interval. The more the better 40 | * 95%: 9.483: - The 95% Response time of New Order transactions per given interval. In this case it is 9.483 sec 41 | * 99%: 18.738: - The 99% Response time of New Order transactions per given interval. In this case it is 18.738 sec 42 | * max_rt: 213.169: - The Max Response time of New Order transactions per given interval. In this case it is 213.169 sec 43 | * the rest: `12919|98.778, 1292|101.096, 1293|443.955, 1293|670.842` is throughput and max response time for the other kind of transactions and can be ignored 44 | 45 | 46 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/add_fkey_idx.sql: -------------------------------------------------------------------------------- 1 | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; 2 | SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; 3 | 4 | 5 | CREATE INDEX idx_customer ON customer (c_w_id,c_d_id,c_last,c_first); 6 | CREATE INDEX idx_orders ON orders (o_w_id,o_d_id,o_c_id,o_id); 7 | CREATE INDEX fkey_stock_2 ON stock (s_i_id); 8 | CREATE INDEX fkey_order_line_2 ON order_line (ol_supply_w_id,ol_i_id); 9 | 10 | ALTER TABLE district ADD CONSTRAINT fkey_district_1 FOREIGN KEY(d_w_id) REFERENCES warehouse(w_id); 11 | ALTER TABLE customer ADD CONSTRAINT fkey_customer_1 FOREIGN KEY(c_w_id,c_d_id) REFERENCES district(d_w_id,d_id); 12 | ALTER TABLE history ADD CONSTRAINT fkey_history_1 FOREIGN KEY(h_c_w_id,h_c_d_id,h_c_id) REFERENCES customer(c_w_id,c_d_id,c_id); 13 | ALTER TABLE history ADD CONSTRAINT fkey_history_2 FOREIGN KEY(h_w_id,h_d_id) REFERENCES district(d_w_id,d_id); 14 | ALTER TABLE new_orders ADD CONSTRAINT fkey_new_orders_1 FOREIGN KEY(no_w_id,no_d_id,no_o_id) REFERENCES orders(o_w_id,o_d_id,o_id); 15 | ALTER TABLE orders ADD CONSTRAINT fkey_orders_1 FOREIGN KEY(o_w_id,o_d_id,o_c_id) REFERENCES customer(c_w_id,c_d_id,c_id); 16 | ALTER TABLE order_line ADD CONSTRAINT fkey_order_line_1 FOREIGN KEY(ol_w_id,ol_d_id,ol_o_id) REFERENCES orders(o_w_id,o_d_id,o_id); 17 | ALTER TABLE order_line ADD CONSTRAINT fkey_order_line_2 FOREIGN KEY(ol_supply_w_id,ol_i_id) REFERENCES stock(s_w_id,s_i_id); 18 | ALTER TABLE stock ADD CONSTRAINT fkey_stock_1 FOREIGN KEY(s_w_id) REFERENCES warehouse(w_id); 19 | ALTER TABLE stock ADD CONSTRAINT fkey_stock_2 FOREIGN KEY(s_i_id) REFERENCES item(i_id); 20 | 21 | 22 | 23 | SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; 24 | SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; 25 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/count.sql: -------------------------------------------------------------------------------- 1 | select count(w_id) from warehouse; 2 | select count(d_w_id) from district; 3 | select count(c_w_id) from customer; 4 | select count(h_c_id) from history; 5 | select count(no_w_id) from new_orders; 6 | select count(o_w_id) from orders; 7 | select count(ol_w_id) from order_line; 8 | select count(i_id) from item; 9 | select count(s_w_id) from stock; 10 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/drop_cons.sql: -------------------------------------------------------------------------------- 1 | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; 2 | SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; 3 | 4 | ALTER TABLE district DROP FOREIGN KEY fkey_district_1; 5 | ALTER TABLE customer DROP FOREIGN KEY fkey_customer_1; 6 | ALTER TABLE history DROP FOREIGN KEY fkey_history_1; 7 | ALTER TABLE history DROP FOREIGN KEY fkey_history_2; 8 | ALTER TABLE new_orders DROP FOREIGN KEY fkey_new_orders_1; 9 | ALTER TABLE orders DROP FOREIGN KEY fkey_orders_1; 10 | ALTER TABLE order_line DROP FOREIGN KEY fkey_order_line_1; 11 | ALTER TABLE order_line DROP FOREIGN KEY fkey_order_line_2; 12 | ALTER TABLE stock DROP FOREIGN KEY fkey_stock_1; 13 | ALTER TABLE stock DROP FOREIGN KEY fkey_stock_2; 14 | 15 | SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; 16 | SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; 17 | 18 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/load.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | WAREHOUSE_NR=50 9 | 10 | 11 | sudo mysql -uroot -e "drop database tpcc" 12 | sudo mysql -uroot -e "create database tpcc" 13 | sudo mysql -uroot tpcc < create_table.sql 14 | sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON tpcc.* TO 'tpcc'@'localhost' IDENTIFIED BY 'datalab';" 15 | sudo mysql -uroot -e "set global innodb_flush_log_at_trx_commit = 0; set global sync_binlog = 0;" 16 | 17 | runuser -l $tpcc_owner -c "cd ${tpcc_dir}; \time -v ./tpcc_load -h127.0.0.1 -d tpcc -u tpcc -p datalab -w $WAREHOUSE_NR" 18 | #\time -v ./tpcc_load -h127.0.0.1 -d tpcc -u tpcc -p "datalab" -w $WAREHOUSE_NR 19 | 20 | sudo mysql -uroot -e "set global innodb_flush_log_at_trx_commit = 1; set global sync_binlog = 1;" 21 | sudo mysql -uroot tpcc < add_fkey_idx.sql 22 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/load_multi_schema.sh: -------------------------------------------------------------------------------- 1 | export LD_LIBRARY_PATH=/data/opt/bin/mysql-5.7.11-linux-glibc2.5-x86_64/lib/ 2 | DBNAME=$1 3 | WH=$2 4 | NSCHEMA=$3 5 | HOST=127.0.0.1 6 | STEP=5 7 | 8 | schema=0 9 | 10 | while [ $schema -lt $NSCHEMA ] 11 | do 12 | DBFULLNAME=${DBNAME}_${schema} 13 | echo "Creating schema $DBFULLNAME" 14 | mysqladmin -h $HOST -f drop $DBFULLNAME 15 | mysqladmin -h $HOST create $DBFULLNAME 16 | mysql -h $HOST $DBFULLNAME < create_table.sql 17 | mysql -h $HOST $DBFULLNAME < add_fkey_idx.sql 18 | mkdir -p out 19 | 20 | ./tpcc_load -h $HOST -d $DBFULLNAME -u root -p "" -w $WH -l 1 -m 1 -n $WH >> out/1_$DBFULLNAME.out & 21 | 22 | x=1 23 | 24 | while [ $x -le $WH ] 25 | do 26 | echo $x $(( $x + $STEP - 1 )) 27 | ./tpcc_load -h $HOST -d $DBFULLNAME -u root -p "" -w $WH -l 2 -m $x -n $(( $x + $STEP - 1 )) >> out/2_$DBFULLNAME.$x.out & 28 | ./tpcc_load -h $HOST -d $DBFULLNAME -u root -p "" -w $WH -l 3 -m $x -n $(( $x + $STEP - 1 )) >> out/3_$DBFULLNAME.$x.out & 29 | ./tpcc_load -h $HOST -d $DBFULLNAME -u root -p "" -w $WH -l 4 -m $x -n $(( $x + $STEP - 1 )) >> out/4_$DBFULLNAME.$x.out & 30 | x=$(( $x + $STEP )) 31 | done 32 | 33 | for job in `jobs -p` 34 | do 35 | echo $job 36 | wait $job 37 | done 38 | 39 | schema=$(( $schema + 1 )) 40 | 41 | done 42 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | WAREHOUSE_NR=50 9 | 10 | runuser -l $tpcc_owner -c "cd ${tpcc_dir}; \time -v ./tpcc_start -h127.0.0.1 -d tpcc -u tpcc -p datalab -w $WAREHOUSE_NR -c100 -l300" 11 | #\time -v ./tpcc_start -h127.0.0.1 -d tpcc -u tpcc -p "datalab" -w $WAREHOUSE_NR -c100 -l10800 12 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/schema2/add_fkey_idx.sql: -------------------------------------------------------------------------------- 1 | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; 2 | SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; 3 | 4 | 5 | ALTER TABLE district ADD CONSTRAINT fkey_district_1 FOREIGN KEY(d_w_id) REFERENCES warehouse(w_id); 6 | ALTER TABLE customer ADD CONSTRAINT fkey_customer_1 FOREIGN KEY(c_d_id, c_w_id) REFERENCES district(d_id, d_w_id); 7 | ALTER TABLE history ADD CONSTRAINT fkey_history_1 FOREIGN KEY(h_c_id, h_c_d_id, h_c_w_id) REFERENCES customer(c_id, c_d_id, c_w_id); 8 | ALTER TABLE history ADD CONSTRAINT fkey_history_2 FOREIGN KEY(h_d_id, h_w_id) REFERENCES district(d_id, d_w_id); 9 | ALTER TABLE new_orders ADD CONSTRAINT fkey_new_orders_1 FOREIGN KEY(no_o_id,no_d_id,no_w_id) REFERENCES orders(o_id, o_d_id, o_w_id); 10 | ALTER TABLE orders ADD CONSTRAINT fkey_orders_1 FOREIGN KEY(o_c_id,o_d_id,o_w_id) REFERENCES customer(c_id,c_d_id,c_w_id); 11 | ALTER TABLE order_line ADD CONSTRAINT fkey_order_line_1 FOREIGN KEY(ol_o_id,ol_d_id,ol_w_id) REFERENCES orders(o_id, o_d_id, o_w_id); 12 | ALTER TABLE order_line ADD CONSTRAINT fkey_order_line_2 FOREIGN KEY(ol_i_id,ol_supply_w_id) REFERENCES stock(s_i_id,s_w_id); 13 | ALTER TABLE stock ADD CONSTRAINT fkey_stock_1 FOREIGN KEY(s_w_id) REFERENCES warehouse(w_id); 14 | ALTER TABLE stock ADD CONSTRAINT fkey_stock_2 FOREIGN KEY(s_i_id) REFERENCES item(i_id); 15 | 16 | 17 | CREATE INDEX idx_customer ON customer (c_w_id,c_d_id,c_last,c_first); 18 | CREATE INDEX idx_orders ON orders (o_w_id,o_d_id,o_c_id,o_id); 19 | 20 | 21 | SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; 22 | SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; 23 | 24 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/schema2/count.sql: -------------------------------------------------------------------------------- 1 | select count(w_id) from warehouse; 2 | select count(d_w_id) from district; 3 | select count(c_w_id) from customer; 4 | select count(h_c_id) from history; 5 | select count(no_w_id) from new_orders; 6 | select count(o_w_id) from orders; 7 | select count(ol_w_id) from order_line; 8 | select count(i_id) from item; 9 | select count(s_w_id) from stock; 10 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/schema2/drop_cons.sql: -------------------------------------------------------------------------------- 1 | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; 2 | SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; 3 | 4 | ALTER TABLE district DROP FOREIGN KEY fkey_district_1; 5 | ALTER TABLE customer DROP FOREIGN KEY fkey_customer_1; 6 | ALTER TABLE history DROP FOREIGN KEY fkey_history_1; 7 | ALTER TABLE history DROP FOREIGN KEY fkey_history_2; 8 | ALTER TABLE new_orders DROP FOREIGN KEY fkey_new_orders_1; 9 | ALTER TABLE orders DROP FOREIGN KEY fkey_orders_1; 10 | ALTER TABLE order_line DROP FOREIGN KEY fkey_order_line_1; 11 | ALTER TABLE order_line DROP FOREIGN KEY fkey_order_line_2; 12 | ALTER TABLE stock DROP FOREIGN KEY fkey_stock_1; 13 | ALTER TABLE stock DROP FOREIGN KEY fkey_stock_2; 14 | 15 | SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; 16 | SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; 17 | 18 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze.full.sh: -------------------------------------------------------------------------------- 1 | cat $1 | grep LSN_ratio_expected | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/1.rr 2 | cat $1 | grep -P "LSN_ratio[\s]" | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/2.rr 3 | cat $1 | grep Innodb_log_write_sleeps | awk ' BEGIN {s=0;i=0} { print i,$4-s; s=$4;i++ } ' > /tmp/3.rr 4 | cat $1 | grep -P "Innodb_log_write_sleep_prob" | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/4.rr 5 | cat $1 | grep -P "Innodb_break_ratio" | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/5.rr 6 | cat $1 | grep -P "Innodb_break_value" | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/6.rr 7 | cat $1 | grep -P "Innodb_tacts_to_flush_dirty" | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/7.rr 8 | cat $1 | grep -P "Innodb_tacts_to_fill_target" | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/8.rr 9 | cat $1 | grep -P "Innodb_EMA_lsn_grow" | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/9.rr 10 | cat $1 | grep -P "Innodb_EMA_ckpt_lsn_grow" | awk ' BEGIN {s=0} { print s,$4; s++ } ' > /tmp/10.rr 11 | cat $1 | grep -P "Innodb_buffer_pool_pages_flushed[\s]" | awk ' BEGIN {s=0;i=0} { print i,$4-s; s=$4;i++ } ' > /tmp/11.rr 12 | cat $1 | grep -P "Innodb_buffer_pool_pages_flushed_neighbors[\s]" | awk ' BEGIN {s=0;i=0} { print i,$4-s; s=$4;i++ } ' > /tmp/12.rr 13 | cat $2 | awk ' BEGIN {i=0;sp=0 } /Last checkpoint at/ { st=$4 ; print i, (st)/1024/1024,(st-sp)/1024/1024; i++; sp=st } ' > /tmp/13.rr 14 | 15 | join /tmp/1.rr /tmp/2.rr > /tmp/a2.rr 16 | join /tmp/a2.rr /tmp/3.rr > /tmp/a3.rr 17 | join /tmp/a3.rr /tmp/4.rr > /tmp/a4.rr 18 | join /tmp/a4.rr /tmp/5.rr > /tmp/a5.rr 19 | join /tmp/a5.rr /tmp/6.rr > /tmp/a6.rr 20 | join /tmp/a6.rr /tmp/7.rr > /tmp/a7.rr 21 | join /tmp/a7.rr /tmp/8.rr > /tmp/a8.rr 22 | join /tmp/a8.rr /tmp/9.rr > /tmp/a9.rr 23 | join /tmp/a9.rr /tmp/10.rr > /tmp/a10.rr 24 | join /tmp/a10.rr /tmp/11.rr > /tmp/a11.rr 25 | join /tmp/a11.rr /tmp/12.rr > /tmp/a12.rr 26 | join /tmp/a12.rr /tmp/13.rr > /tmp/a13.rr 27 | echo "time LSN_ratio_expected LSN_ratio sleeps sleep_prob break_ratio break_value tacts_to_flush_dirty tacts_to_fill_target EMA_lsn EMA_ckpt_lsn flushed flushed_neighbors checkpoint checkpoint_delta" 28 | cat /tmp/a13.rr 29 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze.sh: -------------------------------------------------------------------------------- 1 | TIMESLOT=1 2 | 3 | if [ -n "$2" ] 4 | then 5 | TIMESLOT=$2 6 | echo "Defined $2" 7 | fi 8 | 9 | cat $1 | grep -v HY000 | grep -v payment | grep -v neword | awk -v timeslot=$TIMESLOT ' BEGIN { FS="[,():]"; s=0; cntr=0; aggr=0 } /MEASURING START/ { s=1} /STOPPING THREADS/ {s=0} /0/ { if (s==1) { cntr++; aggr+=$2; } if ( cntr==timeslot ) { printf ("%d %3f\n",aggr,$5) ; cntr=0; aggr=0 } } ' 10 | 11 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyzeR.sh: -------------------------------------------------------------------------------- 1 | TIMESLOT=1 2 | 3 | if [ -n "$2" ] 4 | then 5 | TIMESLOT=$2 6 | echo "Defined $2" 7 | fi 8 | 9 | 10 | for i in 1 2 4 8 16 32 64 11 | do 12 | cat tpcc.par$i.log4G.trx2..out | grep -v HY000 | grep -v payment | grep -v neword | awk -v timeslot=$TIMESLOT -v thr=$i ' BEGIN { FS="[,():]"; s=0; cntr=0; aggr=0 } /MEASURING START/ { s=1} /STOPPING THREADS/ {s=0} /0/ { if (s==1) { cntr++; aggr+=$2; } if ( cntr==timeslot ) { printf ("%d %d %d %3f innodb\n",thr,$1,aggr,$5) ; cntr=0; aggr=0 } } ' 13 | done 14 | 15 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_checkpoint.sh: -------------------------------------------------------------------------------- 1 | cat $1 | awk ' BEGIN { } /Log sequence number/ {st=$4 } /Last checkpoint at/ { ed=$4; print (st-ed)/1024/1024 } ' 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_checkpoint_xtradb.sh: -------------------------------------------------------------------------------- 1 | cat $1 | awk ' BEGIN { } /Checkpoint age / {st=$3 ; print (st)/1024/1024 } ' 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_checkpoint_xtradb1.sh: -------------------------------------------------------------------------------- 1 | #cat $1 | awk ' BEGIN { } /Log sequence number/ {st=$4 ; print (st)/1024/1024 } ' 2 | cat $1 | awk ' BEGIN { } /Last checkpoint at/ {st=$4 ; print (st)/1024/1024 } ' 3 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_dirty.sh: -------------------------------------------------------------------------------- 1 | cat $1 | awk ' BEGIN { dt=-1;dr=-1;df=-1 } /Innodb_buffer_pool_pages_data/ { if (dt==-1) { dt=$4} else { dt+=$4 } } /Innodb_buffer_pool_pages_dirty/ { if (dr==-1) { dr=$4} else { dr+=$4 } } /Innodb_buffer_pool_pages_free/ { if (df==-1) { df=$4} else { df+=$4 } ; print (100*dr)/(1+dt+df) } ' 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_evicted.sh: -------------------------------------------------------------------------------- 1 | cat $1 | awk ' BEGIN { df=0 ; dl=0; } /Innodb_buffer_pool_read_ahead_evicted/ { df=$4 } /Innodb_buffer_pool_pages_LRU_flushed/ { dl=$4; print df,dl } ' 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_flushed.sh: -------------------------------------------------------------------------------- 1 | cat $1 | awk ' BEGIN { df=0 ; dl=0; } /Innodb_buffer_pool_pages_flushed[\s]/ { df=$4 } /Innodb_buffer_pool_pages_LRU_flushed/ { dl=$4; print df,dl } ' 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_flushed_innodb.sh: -------------------------------------------------------------------------------- 1 | cat $1 | awk ' BEGIN { df=0 ; dl=0; } /Innodb_buffer_pool_pages_flushed/ { df=$4 ; print df } ' 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_min.sh: -------------------------------------------------------------------------------- 1 | cat $1 | grep -v HY000 | grep -v payment | grep -v neword | awk ' BEGIN { FS="[,(]"; s=0; cntr=0; aggr=0 } /MEASURING START/ { s=1} /STOPPING THREADS/ {s=0} /0/ { if (s==1) { cntr++; aggr+=$2; } if ( cntr==6 ) { printf ("%d\n",aggr) ; cntr=0; aggr=0 } } ' 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/analyze_modified.sh: -------------------------------------------------------------------------------- 1 | cat $1 | awk ' BEGIN { } /Log sequence number/ {st=$4 } /Log flushed up to/ { ed=$5; print (st-ed) } ' 2 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/flashcache_stat.sh: -------------------------------------------------------------------------------- 1 | sysctl -w dev.flashcache.zero_stats=1 2 | 3 | while [ true ] 4 | do 5 | 6 | dmsetup status flashcache 7 | sleep 10 8 | 9 | done 10 | 11 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/innodb_stat.sh: -------------------------------------------------------------------------------- 1 | x=1 2 | end=$1 3 | 4 | while [ [ $x -le $end ] ] 5 | do 6 | 7 | mysql -e "SHOW ENGINE INNODB STATUS\G" 8 | sleep 10 9 | x=$(( $x + 10 )) 10 | 11 | done 12 | 13 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/memlock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgist-datalab/kevin/4f46599a9b1303e0f60f9f114feb302c8d2a00dd/benchmark/application/tpcc/sql/scripts/memlock -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/memlock.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | char * 7 | alloc_workbuf(size_t size) 8 | { 9 | char *ptr; 10 | 11 | /* allocate some memory */ 12 | ptr = malloc(size); 13 | 14 | /* return NULL on failure */ 15 | if (ptr == NULL) 16 | return NULL; 17 | 18 | /* lock this buffer into RAM */ 19 | if (mlock(ptr, size)) { 20 | free(ptr); 21 | return NULL; 22 | } 23 | return ptr; 24 | } 25 | 26 | void 27 | free_workbuf(char *ptr, size_t size) 28 | { 29 | /* unlock the address range */ 30 | munlock(ptr, size); 31 | 32 | /* free the memory */ 33 | free(ptr); 34 | } 35 | 36 | int main() 37 | { 38 | 39 | char *area; 40 | size_t allocz=306535006208LLU; 41 | 42 | area=alloc_workbuf(allocz); 43 | 44 | while(1) 45 | { 46 | sleep(10); 47 | } 48 | 49 | free_workbuf(area,allocz); 50 | 51 | return 0; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -u 3 | set -x 4 | set -e 5 | 6 | export LD_LIBRARY_PATH=/usr/local/mysql/lib/mysql/ 7 | 8 | DR="/mnt/fio320/bench" 9 | BD="/data/back/fio320/bench" 10 | 11 | WT=10 12 | RT=10800 13 | 14 | ROWS=80000000 15 | 16 | #log2="/data/log/" 17 | log2="$DR/" 18 | 19 | # restore from backup 20 | 21 | rm -fr $DR/* 22 | 23 | echo $log2 24 | #for nm in ibdata1 ib_logfile0 ib_logfile1 25 | for nm in ibdata1 26 | do 27 | rm -f $log2/$nm 28 | pagecache-management.sh cp $BD/$nm $log2 29 | done 30 | 31 | 32 | cp -r $BD/mysql $DR 33 | pagecache-management.sh cp -r $BD/tpcc $DR 34 | 35 | sync 36 | echo 3 > /proc/sys/vm/drop_caches 37 | 38 | chown mysql.mysql -R $DR 39 | chown mysql.mysql -R $log2 40 | 41 | 42 | function waitm { 43 | 44 | while [ true ] 45 | do 46 | 47 | mysql -e "set global innodb_max_dirty_pages_pct=0" mysql 48 | 49 | wt=`mysql -e "SHOW ENGINE INNODB STATUS\G" | grep "Modified db pages" | sort -u | awk '{print $4}'` 50 | if [[ "$wt" -lt 100 ]] ; 51 | then 52 | mysql -e "set global innodb_max_dirty_pages_pct=90" mysql 53 | break 54 | fi 55 | 56 | echo "mysql pages $wt" 57 | sleep 10 58 | done 59 | 60 | } 61 | 62 | #for par in 1 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 43 63 | for par in 16 64 | do 65 | 66 | /usr/local/mysql/libexec/mysqld --defaults-file=/etc/my.cnf --datadir=$DR --innodb_data_home_dir=$log2 --innodb_log_group_home_dir=$log2 --innodb_thread_concurrency=0 & 67 | set +e 68 | 69 | while true; 70 | do 71 | mysql -Bse "SELECT 1" mysql 72 | 73 | if [ "$?" -eq 0 ] 74 | then 75 | break 76 | fi 77 | 78 | sleep 30 79 | 80 | echo -n "." 81 | done 82 | set -e 83 | 84 | 85 | ./tpcc_start localhost tpcc root "" 1000 $par 10 7200 | tee -a tpcc.threads${par}.out 86 | 87 | 88 | waitm 89 | 90 | 91 | mysqladmin shutdown 92 | 93 | done 94 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/run_no_backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -u 3 | set -x 4 | set -e 5 | 6 | #export LD_LIBRARY_PATH=/usr/local/mysql/lib/mysql/ 7 | export LD_LIBRARY_PATH=/usr/local/Percona-Server/lib/mysql/ 8 | 9 | ulimit -c unlimited 10 | 11 | #DR="/mnt/fio320" 12 | BD=/mnt/tachion/tpc1000w 13 | #DR=/data/db/bench 14 | DR="/mnt/fio320/tpc1000w" 15 | 16 | WT=10 17 | RT=10800 18 | 19 | ROWS=80000000 20 | 21 | #log2="/data/log/" 22 | log2="$DR/" 23 | 24 | # restore from backup 25 | 26 | 27 | function waitm { 28 | 29 | while [ true ] 30 | do 31 | 32 | mysql -e "set global innodb_max_dirty_pages_pct=0" mysql 33 | 34 | wt=`mysql -e "SHOW ENGINE INNODB STATUS\G" | grep "Modified db pages" | sort -u | awk '{print $4}'` 35 | if [[ "$wt" -lt 100 ]] ; 36 | then 37 | mysql -e "set global innodb_max_dirty_pages_pct=90" mysql 38 | break 39 | fi 40 | 41 | echo "mysql pages $wt" 42 | sleep 10 43 | done 44 | 45 | } 46 | 47 | 48 | 49 | # Determine run number for selecting an output directory 50 | RUN_NUMBER=-1 51 | 52 | if [ -f ".run_number" ]; then 53 | read RUN_NUMBER < .run_number 54 | fi 55 | 56 | if [ $RUN_NUMBER -eq -1 ]; then 57 | RUN_NUMBER=0 58 | fi 59 | 60 | OUTDIR=res$RUN_NUMBER 61 | mkdir -p $OUTDIR 62 | 63 | RUN_NUMBER=`expr $RUN_NUMBER + 1` 64 | echo $RUN_NUMBER > .run_number 65 | 66 | #for par in 1 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 43 67 | for par in 13 26 39 52 65 78 68 | #for par in 24 69 | do 70 | export OS_FILE_LOG_BLOCK_SIZE=4096 71 | /usr/local/mysql/libexec/mysqld --defaults-file=/etc/my.cnf --datadir=$DR --innodb_log_group_home_dir=$log2 --innodb_thread_concurrency=0 --innodb-buffer-pool-size=${par}GB & 72 | 73 | 74 | set +e 75 | 76 | while true; 77 | do 78 | mysql -Bse "SELECT 1" mysql 79 | 80 | if [ "$?" -eq 0 ] 81 | then 82 | break 83 | fi 84 | 85 | sleep 30 86 | 87 | echo -n "." 88 | done 89 | set -e 90 | 91 | 92 | 93 | 94 | iostat -dx 5 2000 >> $OUTDIR/iostat.${par}res & 95 | PID=$! 96 | vmstat 5 2000 >> $OUTDIR/vmstat.${par}res & 97 | PIDV=$! 98 | ./tpcc_start localhost tpcc1000 root "" 1000 24 10 3600 | tee -a $OUTDIR/tpcc.${par}.out 99 | kill -9 $PID 100 | kill -9 $PIDV 101 | 102 | waitm 103 | 104 | 105 | mysqladmin shutdown 106 | rm -fr /mnt/fio320/tpc1000w ; cp -r /mnt/tachion/back/tpc1000w /mnt/fio320/ 107 | sync 108 | 109 | done 110 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/scripts/virident_stat.sh: -------------------------------------------------------------------------------- 1 | echo 0 > /proc/driver/virident/vgcdrivea0/bdev 2 | 3 | while [ true ] 4 | do 5 | 6 | cat /proc/driver/virident/vgcdrivea0/bdev 7 | cat /proc/driver/virident/vgcdrivea0/gc 8 | sleep 10 9 | 10 | done 11 | 12 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # "make all" to build necessary executables. 3 | # 4 | 5 | 6 | 7 | LIBS= `mysql_config --libs_r` -lrt 8 | 9 | INC= -I. `mysql_config --include` 10 | 11 | #DEFS= -DDEBUG 12 | 13 | CFLAGS= -w -O3 -g 14 | 15 | TRANSACTIONS= neword.o payment.o ordstat.o delivery.o slev.o 16 | OBJS= main.o spt_proc.o driver.o support.o sequence.o rthist.o sb_percentile.o $(TRANSACTIONS) 17 | 18 | .SUFFIXES: 19 | .SUFFIXES: .o .c 20 | 21 | .c.o: 22 | $(CC) $(CFLAGS) $(INC) $(DEFS) -c $*.c 23 | 24 | all: ../tpcc_load ../tpcc_start 25 | 26 | ../tpcc_load : load.o support.o 27 | $(CC) load.o support.o $(LIBS) -o ../tpcc_load 28 | 29 | ../tpcc_start : $(OBJS) 30 | $(CC) $(OBJS) $(LIBS) -o ../tpcc_start 31 | 32 | clean : 33 | rm -f *.o 34 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/parse_port.h: -------------------------------------------------------------------------------- 1 | inline void parse_host(char* host, const char* from) 2 | { 3 | const char* port= rindex(from,':'); 4 | size_t length; 5 | if(NULL == port) 6 | length= strlen(from); 7 | else 8 | length= (port - from); 9 | memcpy(host,from, length); 10 | host[length] = '\0'; 11 | } 12 | inline int parse_port(const char* from) 13 | { 14 | const char* port= rindex(from,':'); 15 | if(NULL == port) 16 | return 3306; 17 | else 18 | { 19 | const char* end= NULL; 20 | int result= strtol(port+1,&end,10); 21 | if( (0 == *end) && (0 <= result) && (result <= 0xFFFF) ) 22 | return result; 23 | else 24 | { 25 | printf(stderr,"Incorrect port value: %s\n",end); 26 | exit(-1); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/rthist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * rthist.h 3 | */ 4 | 5 | void hist_init(); 6 | void hist_inc( int transaction, double rtclk ); 7 | double hist_ckp( int transaction ); 8 | void hist_report(); 9 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/sb_percentile.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2011 Alexey Kopytov. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | */ 17 | 18 | #ifndef SB_PERCENTILE_H 19 | #define SB_PERCENTILE_H 20 | 21 | #ifdef HAVE_PTHREAD_H 22 | # include 23 | #endif 24 | 25 | typedef struct { 26 | unsigned long long *values; 27 | unsigned long long *tmp; 28 | unsigned long long total; 29 | unsigned int size; 30 | double range_min; 31 | double range_max; 32 | double range_deduct; 33 | double range_mult; 34 | pthread_mutex_t mutex; 35 | } sb_percentile_t; 36 | 37 | int sb_percentile_init(sb_percentile_t *percentile, 38 | unsigned int size, double range_min, double range_max); 39 | 40 | void sb_percentile_update(sb_percentile_t *percentile, double value); 41 | 42 | double sb_percentile_calculate(sb_percentile_t *percentile, double percent); 43 | 44 | void sb_percentile_reset(sb_percentile_t *percentile); 45 | 46 | void sb_percentile_done(sb_percentile_t *percentile); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/sequence.c: -------------------------------------------------------------------------------- 1 | /* 2 | * sequence.c 3 | * manage sequence shared by threads 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | /* weight */ 11 | static int no; 12 | static int py; 13 | static int os; 14 | static int dl; 15 | static int sl; 16 | static int total; 17 | 18 | static pthread_mutex_t mutex; 19 | static int *seq; 20 | static int next_num; 21 | 22 | static void shuffle() 23 | { 24 | int i,j,rnd,tmp; 25 | 26 | for( i=0, j=0; i < no ; i++, j++ ){ 27 | seq[j]=0; 28 | } 29 | for( i=0; i < py ; i++, j++){ 30 | seq[j]=1; 31 | } 32 | for( i=0; i < os ; i++, j++){ 33 | seq[j]=2; 34 | } 35 | for( i=0; i < dl ; i++, j++){ 36 | seq[j]=3; 37 | } 38 | for( i=0; i < sl ; i++, j++){ 39 | seq[j]=4; 40 | } 41 | for( i=0, j = total - 1; j>0; i++, j--){ 42 | rnd = rand()%(j+1); 43 | tmp = seq[rnd+i]; 44 | seq[rnd+i] = seq[i]; 45 | seq[i] = tmp; 46 | } 47 | } 48 | 49 | void seq_init( int n, int p, int o, int d, int s ) 50 | { 51 | pthread_mutex_init( &mutex, NULL ); 52 | no = n; 53 | py = p; 54 | os = o; 55 | dl = d; 56 | sl = s; 57 | total = n + p + o + d + s; 58 | seq = malloc( sizeof(int) * total ); 59 | shuffle(); 60 | next_num = 0; 61 | } 62 | 63 | 64 | int seq_get() 65 | { 66 | int retval; 67 | 68 | pthread_mutex_lock( &mutex ); 69 | 70 | if(next_num >= total){ 71 | shuffle(); 72 | next_num = 0; 73 | } 74 | 75 | retval = seq[next_num]; 76 | ++next_num; 77 | 78 | pthread_mutex_unlock( &mutex ); 79 | 80 | return(retval); 81 | } 82 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/sequence.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sequence.h 3 | */ 4 | 5 | void seq_init( int n, int p, int o, int d, int s ); 6 | int seq_get(); 7 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/spt_proc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * spt_proc.pc 3 | * support routines for the proc tpcc implementation 4 | */ 5 | 6 | #include 7 | 8 | #include 9 | 10 | /* 11 | * report error 12 | */ 13 | int error( 14 | MYSQL *mysql, 15 | MYSQL_STMT *mysql_stmt 16 | ) 17 | { 18 | /* 19 | if(mysql_stmt) { 20 | printf("\n%d, %s, %s", mysql_stmt_errno(mysql_stmt), 21 | mysql_stmt_sqlstate(mysql_stmt), mysql_stmt_error(mysql_stmt) ); 22 | } 23 | */ 24 | if(mysql){ 25 | fprintf(stderr, "%d, %s, %s\n", mysql_errno(mysql), mysql_sqlstate(mysql), mysql_error(mysql) ); 26 | } 27 | return (0); 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/spt_proc.h: -------------------------------------------------------------------------------- 1 | int error(MYSQL *mysql, MYSQL_STMT *mysql_stmt); 2 | 3 | #define TIMESTAMP_LEN 80 4 | #define STRFTIME_FORMAT "%Y-%m-%d %H:%M:%S" 5 | 6 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/tpc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tpc.h 3 | * definitions for tpcc loading program && transactions 4 | */ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* 11 | * correct values 12 | */ 13 | #define MAXITEMS 100000 14 | #define CUST_PER_DIST 3000 15 | #define DIST_PER_WARE 10 16 | #define ORD_PER_DIST 3000 17 | /* 18 | */ 19 | 20 | /* 21 | * small values 22 | 23 | #define MAXITEMS 1000 24 | #define CUST_PER_DIST 30 25 | #define DIST_PER_WARE 3 26 | #define ORD_PER_DIST 30 27 | 28 | */ 29 | 30 | /* definitions for new order transaction */ 31 | #define MAX_NUM_ITEMS 15 32 | #define MAX_ITEM_LEN 24 33 | 34 | #define swap_int(a,b) {int tmp; tmp=a; a=b; b=tmp;} 35 | 36 | /* 37 | * hack MakeAddress() into a macro so that we can pass Oracle 38 | * VARCHARs instead of char *s 39 | */ 40 | #define MakeAddressMacro(str1,str2,city,state,zip) \ 41 | {int tmp; \ 42 | tmp = MakeAlphaString(10,20,str1.arr); \ 43 | str1.len = tmp; \ 44 | tmp = MakeAlphaString(10,20,str2.arr); \ 45 | str2.len = tmp; \ 46 | tmp = MakeAlphaString(10,20,city.arr); \ 47 | city.len = tmp; \ 48 | tmp = MakeAlphaString(2,2,state.arr); \ 49 | state.len = tmp; \ 50 | tmp = MakeNumberString(9,9,zip.arr); \ 51 | zip.len = tmp;} 52 | 53 | /* 54 | * while we're at it, wrap MakeAlphaString() and MakeNumberString() 55 | * in a similar way 56 | */ 57 | #define MakeAlphaStringMacro(x,y,str) \ 58 | {int tmp; tmp = MakeAlphaString(x,y,str.arr); str.len = tmp;} 59 | #define MakeNumberStringMacro(x,y,str) \ 60 | {int tmp; tmp = MakeNumberString(x,y,str.arr); str.len = tmp;} 61 | 62 | /* 63 | * likewise, for Lastname() 64 | * counts on Lastname() producing null-terminated strings 65 | */ 66 | #define LastnameMacro(num,str) \ 67 | {Lastname(num, str.arr); str.len = strlen(str.arr);} 68 | 69 | extern long count_ware; 70 | 71 | /* Functions */ 72 | 73 | void LoadItems(); 74 | void LoadWare(); 75 | void LoadCust(); 76 | void LoadOrd(); 77 | void LoadNewOrd(); 78 | int Stock(); 79 | int District(); 80 | void Customer(); 81 | void Orders(); 82 | void New_Orders(); 83 | void MakeAddress(); 84 | void Error(); 85 | 86 | #ifdef __STDC__ 87 | void SetSeed (int seed); 88 | int RandomNumber (int min, int max); 89 | int NURand (unsigned A, unsigned x, unsigned y); 90 | int MakeAlphaString (int x, int y, char str[]); 91 | int MakeNumberString (int x, int y, char str[]); 92 | void gettimestamp (char str[], char *format, size_t n); 93 | void InitPermutation (void); 94 | int GetPermutation (void); 95 | void Lastname(int num, char* name); 96 | 97 | #endif /* __STDC__ */ 98 | 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/src/trans_if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * trans_if.h 3 | * 4 | * prototypes for the transaction interface calls 5 | */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | int driver (int t_num); 12 | int neword (int t_num, int w_id_arg, int d_id_arg, int c_id_arg, 13 | int o_ol_cnt_arg, int o_all_local_arg, int itemid[], 14 | int supware[], int qty[]); 15 | int payment (int t_num, int w_id_arg, int d_id_arg, int byname, 16 | int c_w_id_arg, int c_d_id_arg, 17 | int c_id_arg, char c_last_arg[], float h_amount_arg); 18 | int ordstat (int t_num, int w_id, int d_id, int byname, int c_id, 19 | char c_last[]); 20 | int slev (int t_num, int w_id, int d_id, int level); 21 | int delivery (int t_num, int w_id_arg, int o_carrier_id_arg); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/total.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | ./load.sh 9 | ./run.sh 10 | -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/tpcc_load: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgist-datalab/kevin/4f46599a9b1303e0f60f9f114feb302c8d2a00dd/benchmark/application/tpcc/sql/tpcc_load -------------------------------------------------------------------------------- /benchmark/application/tpcc/sql/tpcc_start: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgist-datalab/kevin/4f46599a9b1303e0f60f9f114feb302c8d2a00dd/benchmark/application/tpcc/sql/tpcc_start -------------------------------------------------------------------------------- /benchmark/cheeze/Makefile: -------------------------------------------------------------------------------- 1 | ifneq ($(KERNELRELEASE),) 2 | obj-m := cheeze.o 3 | cheeze-y := blk.o queue.o shm.o 4 | 5 | # EXTRA_CFLAGS += -DDEBUG 6 | else 7 | KERNELDIR ?= /lib/modules/$(shell uname -r)/build 8 | PWD :=$(shell pwd) 9 | TARGET_PATH := kernel/drivers/misc 10 | INBOXDRIVER := $(shell find $(subst build,$(TARGET_PATH),$(KERNELDIR)) -name cheeze.ko.* -type f) 11 | 12 | .PHONY: modules 13 | modules: 14 | $(MAKE) -C $(KERNELDIR) M=$(PWD) modules 15 | 16 | .PHONY: all 17 | all: clean modules install 18 | 19 | .PHONY: clean 20 | clean: 21 | $(MAKE) -C $(KERNELDIR) M=$(PWD) clean 22 | 23 | .PHONY: install 24 | install: 25 | ifneq ($(shell lsmod | grep cheeze),) 26 | rmmod cheeze 27 | endif 28 | ifneq ($(INBOXDRIVER),) 29 | rm -f $(INBOXDRIVER) 30 | endif 31 | $(MAKE) -C $(KERNELDIR) M=$(PWD) INSTALL_MOD_DIR=$(TARGET_PATH) modules_install 32 | modprobe cheeze 33 | 34 | .PHONY: install_rules 35 | install_rules: 36 | install --group=root --owner=root --mode=0644 $(RULEFILE) $(RULEDIR) 37 | 38 | endif 39 | 40 | -------------------------------------------------------------------------------- /benchmark/cheeze/b: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #gcc -O2 -g -Wall -fsanitize=address user.c 4 | gcc -O3 -s -Wall user.c 5 | 6 | -------------------------------------------------------------------------------- /benchmark/cheeze/replay.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | /* 3 | * Copyright (C) 2020 Park Ju Hyung 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | struct cheeze_req_user { 12 | int id; 13 | int op; 14 | unsigned int pos; // sector_t 15 | unsigned int len; 16 | } __attribute__((aligned(8), packed)); 17 | 18 | #define TRACE_TARGET "/trace" 19 | 20 | int main() { 21 | int dumpfd; 22 | unsigned int i; 23 | uint32_t crc; 24 | struct cheeze_req_user ureq; 25 | 26 | dumpfd = open(TRACE_TARGET, O_RDONLY); 27 | if (dumpfd < 0) { 28 | perror("Failed to open " TRACE_TARGET); 29 | return 1; 30 | } 31 | 32 | while (read(dumpfd, &ureq, sizeof(ureq)) == sizeof(ureq)) { 33 | printf("id=%d\n op=%d\n pos=%u\n len=%u\n\n", ureq.id, ureq.op, ureq.pos, ureq.len); 34 | if (ureq.len) { 35 | printf(" crc {\n"); 36 | for (i = 0; i < ureq.len; i += 4096) { 37 | read(dumpfd, &crc, sizeof(crc)); 38 | printf(" 0x%x,\n", crc); 39 | } 40 | printf(" }\n"); 41 | } 42 | } 43 | 44 | close(dumpfd); 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /benchmark/example: -------------------------------------------------------------------------------- 1 | filebench/example -------------------------------------------------------------------------------- /benchmark/filebench/example/micro_copyfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=4000000 28 | set $meandirwidth=100 29 | set $meanfilesize=4k 30 | set $iosize=1m 31 | set $nthreads=16 32 | set $count=28000000 33 | 34 | set mode quit firstdone 35 | 36 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 37 | 38 | define fileset name=bigfileset,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 39 | define fileset name=destfiles,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth 40 | 41 | define process name=filereader,instances=1 42 | { 43 | thread name=filereaderthread,memsize=10m,instances=$nthreads 44 | { 45 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 46 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 47 | flowop createfile name=createfile2,filesetname=destfiles,fd=2 48 | flowop writewholefile name=writefile2,fd=2,iosize=$iosize 49 | flowop closefile name=closefile1,fd=1 50 | flowop closefile name=closefile2,fd=2 51 | flowop finishoncount name=finish,value=$count 52 | } 53 | } 54 | 55 | run 100000000 56 | 57 | echo "Copyfiles Version 3.0 personality successfully loaded" 58 | -------------------------------------------------------------------------------- /benchmark/filebench/example/micro_createfiles_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=24000000 37 | set $filesize=0k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=8000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | define process name=filecreate,instances=1 48 | { 49 | thread name=filecreatethread,memsize=10m,instances=$nthreads 50 | { 51 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 52 | flowop closefile name=closefile1,fd=1 53 | flowop finishoncount name=finish,value=$count 54 | } 55 | } 56 | 57 | run 100000000 58 | 59 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 60 | -------------------------------------------------------------------------------- /benchmark/filebench/example/micro_delete.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=16000000 34 | set $filesize=4k 35 | set $nfiles=8000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | define process name=filedelete,instances=1 44 | { 45 | thread name=filedeletethread,memsize=10m,instances=$nthreads 46 | { 47 | flowop deletefile name=deletefile1, filesetname=bigfileset 48 | flowop opslimit name=limit 49 | flowop finishoncount name=finish,value=$count 50 | } 51 | } 52 | 53 | run 100000000 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/filebench/example/micro_makedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a directory with $ndirs potential leaf directories, than mkdir's them 26 | # 27 | set $dir=/bench 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | 32 | set mode quit firstdone 33 | 34 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth 35 | 36 | define process name=dirmake,instances=1 37 | { 38 | thread name=dirmaker,memsize=1m,instances=$nthreads 39 | { 40 | flowop makedir name=mkdir1,filesetname=bigfileset 41 | } 42 | } 43 | 44 | run 100000000 45 | 46 | echo "MakeDirs Version 1.0 personality successfully loaded" 47 | -------------------------------------------------------------------------------- /benchmark/filebench/example/micro_removedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with $ndirs empty leaf directories then rmdir's all of them 26 | # 27 | set $dir=/bench 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | set $count=16000000 32 | 33 | set mode quit alldone 34 | 35 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth,prealloc 36 | 37 | define process name=remdir,instances=1 38 | { 39 | thread name=removedirectory,memsize=1m,instances=$nthreads 40 | { 41 | flowop removedir name=dirremover,filesetname=bigfileset 42 | flowop opslimit name=limit 43 | flowop finishoncount name=finish,value=$count 44 | } 45 | } 46 | 47 | run 100000000 48 | 49 | echo "RemoveDir Version 1.0 personality successfully loaded" 50 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/micro_copyfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=4000000 28 | set $meandirwidth=100 29 | set $meanfilesize=4k 30 | set $iosize=1m 31 | set $nthreads=16 32 | set $count=28000000 33 | 34 | set mode quit firstdone 35 | 36 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 37 | 38 | define fileset name=bigfileset,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 39 | define fileset name=destfiles,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth 40 | 41 | run 100000000 42 | 43 | echo "Copyfiles Version 3.0 personality successfully loaded" 44 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/micro_createfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=32000000 37 | set $filesize=4k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=8000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | run 100000000 48 | 49 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 50 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/micro_createfiles_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=24000000 37 | set $filesize=0k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=8000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | run 100000000 48 | 49 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 50 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/micro_delete.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=16000000 34 | set $filesize=4k 35 | set $nfiles=8000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | run 100000000 44 | 45 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 46 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/micro_delete_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=16000000 34 | set $filesize=0k 35 | set $nfiles=8000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | run 100000000 44 | 45 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 46 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/micro_listdirs_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with a fairly deep directory tree, then does readdir 26 | # operations on them for a specified amount of time 27 | # 28 | set $dir=/bench 29 | set $nfiles=4000000 30 | set $meandirwidth=5 31 | set $nthreads=16 32 | set $count=8000000 33 | 34 | set mode quit alldone 35 | 36 | define fileset name=bigfileset,path=$dir,size=0,entries=$nfiles,dirwidth=$meandirwidth,prealloc 37 | 38 | create files 39 | system "echo 3 > /proc/sys/vm/drop_caches" 40 | 41 | echo "ListDirs Version 1.0 personality successfully loaded" 42 | 43 | run 44 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/micro_makedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a directory with $ndirs potential leaf directories, than mkdir's them 26 | # 27 | set $dir=/bench 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | 32 | set mode quit firstdone 33 | 34 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth 35 | 36 | run 100000000 37 | 38 | echo "MakeDirs Version 1.0 personality successfully loaded" 39 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/micro_removedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with $ndirs empty leaf directories then rmdir's all of them 26 | # 27 | set $dir=/bench 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | set $count=16000000 32 | 33 | set mode quit alldone 34 | 35 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth,prealloc 36 | 37 | run 100000000 38 | 39 | echo "RemoveDir Version 1.0 personality successfully loaded" 40 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/real_fileserver.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=800000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:131072;gamma:1.5) 30 | set $filesize=131072 31 | set $nthreads=50 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=8000000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:10000;gamma:1.5,min=0,max=19999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | echo "File-server Version 3.0 personality successfully loaded" 43 | 44 | run 100000000 45 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/real_oltp.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $eventrate=0 28 | set $runtime=5 29 | set $iosize=2k 30 | set $nshadows=200 31 | set $ndbwriters=10 32 | set $usermode=200000 33 | set $filesize=10m 34 | set $memperthread=1m 35 | set $workingset=0 36 | set $logfilesize=10m 37 | set $nfiles=3200 38 | set $nlogfiles=1 39 | set $directio=0 40 | set $count=100 41 | 42 | eventgen rate = $eventrate 43 | 44 | #set mode quit alldone 45 | 46 | # Define a datafile and logfile 47 | define fileset name=datafiles,path=$dir,size=$filesize,entries=$nfiles,dirwidth=1024,prealloc=100,reuse 48 | define fileset name=logfile,path=$dir,size=$logfilesize,entries=$nlogfiles,dirwidth=1024,prealloc=100,reuse 49 | 50 | echo "OLTP Version 3.0 personality successfully loaded" 51 | 52 | run 120 53 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/real_varmail.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=3200000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:16384;gamma:1.5) 30 | set $filesize=16384 31 | set $nthreads=16 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=12800000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | echo "Varmail Version 3.0 personality successfully loaded" 43 | 44 | run 100000000 45 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/real_webproxy.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=2000000 28 | set $meandirwidth=1000000 29 | set $meanfilesize=16k 30 | set $nthreads=100 31 | set $meaniosize=16k 32 | set $iosize=1m 33 | set $count=4000000 34 | 35 | set mode quit alldone 36 | 37 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:25000;gamma:1.5,min=0,max=49999) 38 | 39 | define fileset name=bigfileset5,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 40 | 41 | run 100000000 42 | 43 | echo "Web proxy-server Version 3.0 personality successfully loaded" 44 | -------------------------------------------------------------------------------- /benchmark/filebench/load_only/real_webserver.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=1600000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:16384;gamma:1.5) 30 | set $filesize=16384 31 | set $nthreads=100 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=12800000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:20000;gamma:1.5,min=0,max=39999) 39 | 40 | define fileset name=bigfileset1,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,readonly,paralloc 41 | define fileset name=logfiles1,path=$dir,size=$filesize,entries=1,dirwidth=$meandirwidth,prealloc 42 | 43 | echo "Web-server Version 3.1 personality successfully loaded" 44 | 45 | run 100000000 46 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/micro_copyfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=4000000 28 | set $meandirwidth=100 29 | set $meanfilesize=4k 30 | set $iosize=1m 31 | set $nthreads=16 32 | set $count=28000000 33 | 34 | set mode quit firstdone 35 | 36 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 37 | 38 | define fileset name=bigfileset,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 39 | define fileset name=destfiles,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth 40 | 41 | define process name=filereader,instances=1 42 | { 43 | thread name=filereaderthread,memsize=10m,instances=$nthreads 44 | { 45 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 46 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 47 | flowop createfile name=createfile2,filesetname=destfiles,fd=2 48 | flowop writewholefile name=writefile2,fd=2,iosize=$iosize 49 | flowop closefile name=closefile1,fd=1 50 | flowop closefile name=closefile2,fd=2 51 | flowop finishoncount name=finish,value=$count 52 | } 53 | } 54 | 55 | run 100000000 56 | 57 | echo "Copyfiles Version 3.0 personality successfully loaded" 58 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/micro_createfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=32000000 37 | set $filesize=4k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=8000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | define process name=filecreate,instances=1 48 | { 49 | thread name=filecreatethread,memsize=10m,instances=$nthreads 50 | { 51 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 52 | flowop writewholefile name=writefile1,filesetname=bigfileset,fd=1,iosize=$iosize 53 | flowop closefile name=closefile1,fd=1 54 | flowop finishoncount name=finish,value=$count 55 | } 56 | } 57 | 58 | run 100000000 59 | 60 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 61 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/micro_createfiles_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=24000000 37 | set $filesize=0k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=8000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | define process name=filecreate,instances=1 48 | { 49 | thread name=filecreatethread,memsize=10m,instances=$nthreads 50 | { 51 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 52 | flowop closefile name=closefile1,fd=1 53 | flowop finishoncount name=finish,value=$count 54 | } 55 | } 56 | 57 | run 100000000 58 | 59 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 60 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/micro_delete.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=16000000 34 | set $filesize=4k 35 | set $nfiles=8000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | define process name=filedelete,instances=1 44 | { 45 | thread name=filedeletethread,memsize=10m,instances=$nthreads 46 | { 47 | flowop deletefile name=deletefile1, filesetname=bigfileset 48 | flowop opslimit name=limit 49 | flowop finishoncount name=finish,value=$count 50 | } 51 | } 52 | 53 | run 100000000 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/micro_delete_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=16000000 34 | set $filesize=0k 35 | set $nfiles=8000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | define process name=filedelete,instances=1 44 | { 45 | thread name=filedeletethread,memsize=10m,instances=$nthreads 46 | { 47 | flowop deletefile name=deletefile1, filesetname=bigfileset 48 | flowop opslimit name=limit 49 | flowop finishoncount name=finish,value=$count 50 | } 51 | } 52 | 53 | run 100000000 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/micro_listdirs_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with a fairly deep directory tree, then does readdir 26 | # operations on them for a specified amount of time 27 | # 28 | set $dir=/bench 29 | set $nfiles=4000000 30 | set $meandirwidth=5 31 | set $nthreads=16 32 | set $count=8000000 33 | 34 | set mode quit alldone 35 | 36 | define fileset name=bigfileset,path=$dir,size=0,entries=$nfiles,dirwidth=$meandirwidth,prealloc 37 | 38 | create files 39 | system "echo 3 > /proc/sys/vm/drop_caches" 40 | 41 | define process name=lsdir,instances=1 42 | { 43 | thread name=dirlister,memsize=1m,instances=$nthreads 44 | { 45 | flowop listdir name=open1,filesetname=bigfileset 46 | flowop finishoncount name=finish,value=$count 47 | } 48 | } 49 | 50 | echo "ListDirs Version 1.0 personality successfully loaded" 51 | 52 | run 53 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/micro_makedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a directory with $ndirs potential leaf directories, than mkdir's them 26 | # 27 | set $dir=/bench 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | 32 | set mode quit firstdone 33 | 34 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth 35 | 36 | define process name=dirmake,instances=1 37 | { 38 | thread name=dirmaker,memsize=1m,instances=$nthreads 39 | { 40 | flowop makedir name=mkdir1,filesetname=bigfileset 41 | } 42 | } 43 | 44 | run 100000000 45 | 46 | echo "MakeDirs Version 1.0 personality successfully loaded" 47 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/micro_removedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with $ndirs empty leaf directories then rmdir's all of them 26 | # 27 | set $dir=/bench 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | set $count=16000000 32 | 33 | set mode quit alldone 34 | 35 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth,prealloc 36 | 37 | define process name=remdir,instances=1 38 | { 39 | thread name=removedirectory,memsize=1m,instances=$nthreads 40 | { 41 | flowop removedir name=dirremover,filesetname=bigfileset 42 | flowop opslimit name=limit 43 | flowop finishoncount name=finish,value=$count 44 | } 45 | } 46 | 47 | run 100000000 48 | 49 | echo "RemoveDir Version 1.0 personality successfully loaded" 50 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/real_fileserver.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=800000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:131072;gamma:1.5) 30 | set $filesize=131072 31 | set $nthreads=50 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=8000000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:10000;gamma:1.5,min=0,max=19999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 47 | flowop writewholefile name=wrtfile1,srcfd=1,fd=1,iosize=$iosize 48 | flowop closefile name=closefile1,fd=1 49 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 50 | flowop appendfile name=appendfilerand1,iosize=$meanappendsize,fd=1 51 | flowop closefile name=closefile2,fd=1 52 | flowop openfile name=openfile2,filesetname=bigfileset,fd=1 53 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 54 | flowop closefile name=closefile3,fd=1 55 | flowop deletefile name=deletefile1,filesetname=bigfileset 56 | flowop statfile name=statfile1,filesetname=bigfileset 57 | flowop finishoncount name=finish,value=$count 58 | } 59 | } 60 | 61 | echo "File-server Version 3.0 personality successfully loaded" 62 | 63 | run 100000000 64 | -------------------------------------------------------------------------------- /benchmark/filebench/workloads/real_varmail.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=3200000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:16384;gamma:1.5) 30 | set $filesize=16384 31 | set $nthreads=16 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=12800000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop deletefile name=deletefile1,filesetname=bigfileset 47 | flowop createfile name=createfile2,filesetname=bigfileset,fd=1 48 | flowop appendfile name=appendfilerand2,iosize=$meanappendsize,fd=1 49 | flowop fsync name=fsyncfile2,fd=1 50 | flowop closefile name=closefile2,fd=1 51 | flowop openfile name=openfile3,filesetname=bigfileset,fd=1 52 | flowop readwholefile name=readfile3,fd=1,iosize=$iosize 53 | flowop appendfile name=appendfilerand3,iosize=$meanappendsize,fd=1 54 | flowop fsync name=fsyncfile3,fd=1 55 | flowop closefile name=closefile3,fd=1 56 | flowop openfile name=openfile4,filesetname=bigfileset,fd=1 57 | flowop readwholefile name=readfile4,fd=1,iosize=$iosize 58 | flowop closefile name=closefile4,fd=1 59 | flowop finishoncount name=finish,value=$count 60 | } 61 | } 62 | 63 | echo "Varmail Version 3.0 personality successfully loaded" 64 | 65 | run 100000000 66 | -------------------------------------------------------------------------------- /benchmark/fio/global.fio: -------------------------------------------------------------------------------- 1 | ioengine=libaio 2 | filename=/bench/file2 3 | #filename=/dev/cheeze0 4 | 5 | bs=4K 6 | iodepth=128 7 | 8 | size=32GB 9 | #size=3GB 10 | numjobs=1 11 | 12 | #direct=1 13 | #buffered=0 14 | 15 | direct=0 16 | buffered=1 17 | 18 | randrepeat=0 19 | overwrite=0 20 | 21 | fallocate=none 22 | -------------------------------------------------------------------------------- /benchmark/fio/randread.fio: -------------------------------------------------------------------------------- 1 | [global] 2 | include global.fio 3 | 4 | [Random Read] 5 | rw=randread 6 | iodepth=128 7 | 8 | numjobs=16 9 | io_size=32G 10 | io_limit=2G 11 | 12 | -------------------------------------------------------------------------------- /benchmark/fio/randwrite.fio: -------------------------------------------------------------------------------- 1 | [global] 2 | include global.fio 3 | 4 | [Random Write] 5 | rw=randrw 6 | rwmixread=0 7 | 8 | numjobs=16 9 | iodepth=128 10 | io_size=32G 11 | io_limit=2G 12 | 13 | -------------------------------------------------------------------------------- /benchmark/fio/seqread.fio: -------------------------------------------------------------------------------- 1 | [global] 2 | include global.fio 3 | 4 | [Sequenctial Read] 5 | rw=read 6 | bs=128K 7 | iodepth=128 8 | numjobs=1 9 | -------------------------------------------------------------------------------- /benchmark/fio/seqwrite.fio: -------------------------------------------------------------------------------- 1 | [global] 2 | include global.fio 3 | 4 | [Sequential Write] 5 | rw=write 6 | iodepth=128 7 | bs=128k 8 | numjobs=1 9 | -------------------------------------------------------------------------------- /benchmark/fragmentation/frag_file.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with $ndirs empty leaf directories then rmdir's all of them 26 | # 27 | set $dir=/bench 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | set $count=8000000 32 | 33 | set mode quit alldone 34 | 35 | set $fileidx=cvar(type=cvar-gamma,parameters=mean:4000000;gamma:1.5,min=0,max=7999999) 36 | 37 | define fileset name=bigfileset1,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth,prealloc,paralloc 38 | 39 | define process name=remdir,instances=1 40 | { 41 | thread name=removedirectory,memsize=1m,instances=$nthreads 42 | { 43 | flowop removedir name=dirremover,filesetname=bigfileset1,indexed=$fileidx 44 | flowop opslimit name=limit 45 | flowop finishoncount name=finish,value=$count 46 | } 47 | } 48 | 49 | run 100000000 50 | 51 | echo "RemoveDir Version 1.0 personality successfully loaded" 52 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/micro_copyfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=2000000 28 | set $meandirwidth=100 29 | set $meanfilesize=4k 30 | set $iosize=1m 31 | set $nthreads=16 32 | set $count=14000000 33 | 34 | set mode quit firstdone 35 | 36 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 37 | 38 | define fileset name=bigfileset,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 39 | define fileset name=destfiles,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth 40 | 41 | run 100000000 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 47 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 48 | flowop createfile name=createfile2,filesetname=destfiles,fd=2 49 | flowop writewholefile name=writefile2,fd=2,iosize=$iosize 50 | flowop closefile name=closefile1,fd=1 51 | flowop closefile name=closefile2,fd=2 52 | flowop finishoncount name=finish,value=$count 53 | } 54 | } 55 | 56 | 57 | echo "Copyfiles Version 3.0 personality successfully loaded" 58 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/micro_createfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=16000000 37 | set $filesize=4k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=4000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | run 100000000 48 | define process name=filecreate,instances=1 49 | { 50 | thread name=filecreatethread,memsize=10m,instances=$nthreads 51 | { 52 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 53 | flowop writewholefile name=writefile1,filesetname=bigfileset,fd=1,iosize=$iosize 54 | flowop closefile name=closefile1,fd=1 55 | flowop finishoncount name=finish,value=$count 56 | } 57 | } 58 | 59 | 60 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 61 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/micro_createfiles_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=16000000 37 | set $filesize=4k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=4000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | run 100000000 48 | define process name=filecreate,instances=1 49 | { 50 | thread name=filecreatethread,memsize=10m,instances=$nthreads 51 | { 52 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 53 | flowop writewholefile name=writefile1,filesetname=bigfileset,fd=1,iosize=$iosize 54 | flowop closefile name=closefile1,fd=1 55 | flowop finishoncount name=finish,value=$count 56 | } 57 | } 58 | 59 | 60 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 61 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/micro_delete.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=8000000 34 | set $filesize=4k 35 | set $nfiles=4000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | run 100000000 44 | define process name=filedelete,instances=1 45 | { 46 | thread name=filedeletethread,memsize=10m,instances=$nthreads 47 | { 48 | flowop deletefile name=deletefile1, filesetname=bigfileset 49 | flowop opslimit name=limit 50 | flowop finishoncount name=finish,value=$count 51 | } 52 | } 53 | 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/micro_delete_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=8000000 34 | set $filesize=0k 35 | set $nfiles=4000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | run 100000000 44 | define process name=filedelete,instances=1 45 | { 46 | thread name=filedeletethread,memsize=10m,instances=$nthreads 47 | { 48 | flowop deletefile name=deletefile1, filesetname=bigfileset 49 | flowop opslimit name=limit 50 | flowop finishoncount name=finish,value=$count 51 | } 52 | } 53 | 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/micro_listdirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with a fairly deep directory tree, then does readdir 26 | # operations on them for a specified amount of time 27 | # 28 | set $dir=/bench 29 | set $nfiles=2000000 30 | set $meandirwidth=5 31 | set $nthreads=16 32 | set $count=4000000 33 | 34 | set mode quit alldone 35 | 36 | define fileset name=bigfileset,path=$dir,size=0,entries=$nfiles,dirwidth=$meandirwidth,prealloc 37 | 38 | run 39 | define process name=lsdir,instances=1 40 | { 41 | thread name=dirlister,memsize=1m,instances=$nthreads 42 | { 43 | flowop listdir name=open1,filesetname=bigfileset 44 | flowop finishoncount name=finish,value=$count 45 | } 46 | } 47 | 48 | echo "ListDirs Version 1.0 personality successfully loaded" 49 | 50 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/micro_makedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a directory with $ndirs potential leaf directories, than mkdir's them 26 | # 27 | set $dir=/bench 28 | set $ndirs=4000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | 32 | set mode quit firstdone 33 | 34 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth 35 | 36 | run 100000000 37 | define process name=dirmake,instances=1 38 | { 39 | thread name=dirmaker,memsize=1m,instances=$nthreads 40 | { 41 | flowop makedir name=mkdir1,filesetname=bigfileset 42 | } 43 | } 44 | 45 | 46 | echo "MakeDirs Version 1.0 personality successfully loaded" 47 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/micro_removedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with $ndirs empty leaf directories then rmdir's all of them 26 | # 27 | set $dir=/bench 28 | set $ndirs=4000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | set $count=8000000 32 | 33 | set mode quit alldone 34 | 35 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth,prealloc 36 | 37 | run 100000000 38 | define process name=remdir,instances=1 39 | { 40 | thread name=removedirectory,memsize=1m,instances=$nthreads 41 | { 42 | flowop removedir name=dirremover,filesetname=bigfileset 43 | flowop opslimit name=limit 44 | flowop finishoncount name=finish,value=$count 45 | } 46 | } 47 | 48 | 49 | echo "RemoveDir Version 1.0 personality successfully loaded" 50 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/real_fileserver.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=400000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:131072;gamma:1.5) 30 | set $filesize=131072 31 | set $nthreads=50 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=4000000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:10000;gamma:1.5,min=0,max=19999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | run 100000000 43 | define process name=filereader,instances=1 44 | { 45 | thread name=filereaderthread,memsize=10m,instances=$nthreads 46 | { 47 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 48 | flowop writewholefile name=wrtfile1,srcfd=1,fd=1,iosize=$iosize 49 | flowop closefile name=closefile1,fd=1 50 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 51 | flowop appendfile name=appendfilerand1,iosize=$meanappendsize,fd=1 52 | flowop closefile name=closefile2,fd=1 53 | flowop openfile name=openfile2,filesetname=bigfileset,fd=1 54 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 55 | flowop closefile name=closefile3,fd=1 56 | flowop deletefile name=deletefile1,filesetname=bigfileset 57 | flowop statfile name=statfile1,filesetname=bigfileset 58 | flowop finishoncount name=finish,value=$count 59 | } 60 | } 61 | 62 | echo "File-server Version 3.0 personality successfully loaded" 63 | 64 | -------------------------------------------------------------------------------- /benchmark/fragmentation/load_only/real_varmail.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=1600000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:16384;gamma:1.5) 30 | set $filesize=16384 31 | set $nthreads=16 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=8000000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | run 100000000 43 | define process name=filereader,instances=1 44 | { 45 | thread name=filereaderthread,memsize=10m,instances=$nthreads 46 | { 47 | flowop deletefile name=deletefile1,filesetname=bigfileset 48 | flowop createfile name=createfile2,filesetname=bigfileset,fd=1 49 | flowop appendfile name=appendfilerand2,iosize=$meanappendsize,fd=1 50 | flowop fsync name=fsyncfile2,fd=1 51 | flowop closefile name=closefile2,fd=1 52 | flowop openfile name=openfile3,filesetname=bigfileset,fd=1 53 | flowop readwholefile name=readfile3,fd=1,iosize=$iosize 54 | flowop appendfile name=appendfilerand3,iosize=$meanappendsize,fd=1 55 | flowop fsync name=fsyncfile3,fd=1 56 | flowop closefile name=closefile3,fd=1 57 | flowop openfile name=openfile4,filesetname=bigfileset,fd=1 58 | flowop readwholefile name=readfile4,fd=1,iosize=$iosize 59 | flowop closefile name=closefile4,fd=1 60 | flowop finishoncount name=finish,value=$count 61 | } 62 | } 63 | 64 | echo "Varmail Version 3.0 personality successfully loaded" 65 | 66 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/micro_copyfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=2000000 28 | set $meandirwidth=100 29 | set $meanfilesize=4k 30 | set $iosize=1m 31 | set $nthreads=16 32 | set $count=14000000 33 | 34 | set mode quit firstdone 35 | 36 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 37 | 38 | define fileset name=bigfileset,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 39 | define fileset name=destfiles,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth 40 | 41 | define process name=filereader,instances=1 42 | { 43 | thread name=filereaderthread,memsize=10m,instances=$nthreads 44 | { 45 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 46 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 47 | flowop createfile name=createfile2,filesetname=destfiles,fd=2 48 | flowop writewholefile name=writefile2,fd=2,iosize=$iosize 49 | flowop closefile name=closefile1,fd=1 50 | flowop closefile name=closefile2,fd=2 51 | flowop finishoncount name=finish,value=$count 52 | } 53 | } 54 | 55 | run 100000000 56 | 57 | echo "Copyfiles Version 3.0 personality successfully loaded" 58 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/micro_createfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=16000000 37 | set $filesize=4k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=4000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | define process name=filecreate,instances=1 48 | { 49 | thread name=filecreatethread,memsize=10m,instances=$nthreads 50 | { 51 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 52 | flowop writewholefile name=writefile1,filesetname=bigfileset,fd=1,iosize=$iosize 53 | flowop closefile name=closefile1,fd=1 54 | flowop finishoncount name=finish,value=$count 55 | } 56 | } 57 | 58 | run 100000000 59 | 60 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 61 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/micro_createfiles_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=12000000 37 | set $filesize=0k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=4000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | define process name=filecreate,instances=1 48 | { 49 | thread name=filecreatethread,memsize=10m,instances=$nthreads 50 | { 51 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 52 | flowop closefile name=closefile1,fd=1 53 | flowop finishoncount name=finish,value=$count 54 | } 55 | } 56 | 57 | run 100000000 58 | 59 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 60 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/micro_delete.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=8000000 34 | set $filesize=4k 35 | set $nfiles=4000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | define process name=filedelete,instances=1 44 | { 45 | thread name=filedeletethread,memsize=10m,instances=$nthreads 46 | { 47 | flowop deletefile name=deletefile1, filesetname=bigfileset 48 | flowop opslimit name=limit 49 | flowop finishoncount name=finish,value=$count 50 | } 51 | } 52 | 53 | run 100000000 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/micro_delete_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=8000000 34 | set $filesize=0k 35 | set $nfiles=4000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | define process name=filedelete,instances=1 44 | { 45 | thread name=filedeletethread,memsize=10m,instances=$nthreads 46 | { 47 | flowop deletefile name=deletefile1, filesetname=bigfileset 48 | flowop opslimit name=limit 49 | flowop finishoncount name=finish,value=$count 50 | } 51 | } 52 | 53 | run 100000000 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/micro_listdirs_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with a fairly deep directory tree, then does readdir 26 | # operations on them for a specified amount of time 27 | # 28 | set $dir=/bench 29 | set $nfiles=2000000 30 | set $meandirwidth=5 31 | set $nthreads=16 32 | set $count=4000000 33 | 34 | set mode quit alldone 35 | 36 | define fileset name=bigfileset,path=$dir,size=0,entries=$nfiles,dirwidth=$meandirwidth,prealloc 37 | 38 | create files 39 | system "echo 3 > /proc/sys/vm/drop_caches" 40 | 41 | define process name=lsdir,instances=1 42 | { 43 | thread name=dirlister,memsize=1m,instances=$nthreads 44 | { 45 | flowop listdir name=open1,filesetname=bigfileset 46 | flowop finishoncount name=finish,value=$count 47 | } 48 | } 49 | 50 | echo "ListDirs Version 1.0 personality successfully loaded" 51 | 52 | run 53 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/micro_makedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a directory with $ndirs potential leaf directories, than mkdir's them 26 | # 27 | set $dir=/bench 28 | set $ndirs=4000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | 32 | set mode quit firstdone 33 | 34 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth 35 | 36 | define process name=dirmake,instances=1 37 | { 38 | thread name=dirmaker,memsize=1m,instances=$nthreads 39 | { 40 | flowop makedir name=mkdir1,filesetname=bigfileset 41 | } 42 | } 43 | 44 | run 100000000 45 | 46 | echo "MakeDirs Version 1.0 personality successfully loaded" 47 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/micro_removedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with $ndirs empty leaf directories then rmdir's all of them 26 | # 27 | set $dir=/bench 28 | set $ndirs=4000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | set $count=8000000 32 | 33 | set mode quit alldone 34 | 35 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth,prealloc 36 | 37 | define process name=remdir,instances=1 38 | { 39 | thread name=removedirectory,memsize=1m,instances=$nthreads 40 | { 41 | flowop removedir name=dirremover,filesetname=bigfileset 42 | flowop opslimit name=limit 43 | flowop finishoncount name=finish,value=$count 44 | } 45 | } 46 | 47 | run 100000000 48 | 49 | echo "RemoveDir Version 1.0 personality successfully loaded" 50 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/real_fileserver.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=400000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:131072;gamma:1.5) 30 | set $filesize=131072 31 | set $nthreads=50 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=4000000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:10000;gamma:1.5,min=0,max=19999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 47 | flowop writewholefile name=wrtfile1,srcfd=1,fd=1,iosize=$iosize 48 | flowop closefile name=closefile1,fd=1 49 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 50 | flowop appendfile name=appendfilerand1,iosize=$meanappendsize,fd=1 51 | flowop closefile name=closefile2,fd=1 52 | flowop openfile name=openfile2,filesetname=bigfileset,fd=1 53 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 54 | flowop closefile name=closefile3,fd=1 55 | flowop deletefile name=deletefile1,filesetname=bigfileset 56 | flowop statfile name=statfile1,filesetname=bigfileset 57 | flowop finishoncount name=finish,value=$count 58 | } 59 | } 60 | 61 | echo "File-server Version 3.0 personality successfully loaded" 62 | 63 | run 100000000 64 | -------------------------------------------------------------------------------- /benchmark/fragmentation/workloads/real_varmail.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=1600000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:16384;gamma:1.5) 30 | set $filesize=16384 31 | set $nthreads=16 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=8000000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop deletefile name=deletefile1,filesetname=bigfileset 47 | flowop createfile name=createfile2,filesetname=bigfileset,fd=1 48 | flowop appendfile name=appendfilerand2,iosize=$meanappendsize,fd=1 49 | flowop fsync name=fsyncfile2,fd=1 50 | flowop closefile name=closefile2,fd=1 51 | flowop openfile name=openfile3,filesetname=bigfileset,fd=1 52 | flowop readwholefile name=readfile3,fd=1,iosize=$iosize 53 | flowop appendfile name=appendfilerand3,iosize=$meanappendsize,fd=1 54 | flowop fsync name=fsyncfile3,fd=1 55 | flowop closefile name=closefile3,fd=1 56 | flowop openfile name=openfile4,filesetname=bigfileset,fd=1 57 | flowop readwholefile name=readfile4,fd=1,iosize=$iosize 58 | flowop closefile name=closefile4,fd=1 59 | flowop finishoncount name=finish,value=$count 60 | } 61 | } 62 | 63 | echo "Varmail Version 3.0 personality successfully loaded" 64 | 65 | run 100000000 66 | -------------------------------------------------------------------------------- /benchmark/general/blk_map/.nfs0000000000fc177d00000001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgist-datalab/kevin/4f46599a9b1303e0f60f9f114feb302c8d2a00dd/benchmark/general/blk_map/.nfs0000000000fc177d00000001 -------------------------------------------------------------------------------- /benchmark/general/blk_map/01_create_map.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | NUM_BLKS_IN_GROUP = 16 4 | INODETABLE_SIZE = 512 5 | 6 | def main(): 7 | with open('dump.txt') as f: 8 | raw = f.readlines() 9 | 10 | f = open('blk_map.txt', 'w') 11 | 12 | # Superblock section 13 | #f.write("SB\n") 14 | for line in raw: 15 | line = line.split() 16 | if len(line) > 5 and line[1] == 'superblock': 17 | f.write(f"1 { line[3][:-1] } { line[3][:-1] }\n") 18 | 19 | # Descriptor section 20 | #f.write("GD\n") 21 | for line in raw: 22 | line = line.split() 23 | if len(line) > 5 and line[4] == "Group": 24 | f.write(f"2 { ' '.join(line[-1].split('-')) }\n") 25 | 26 | # Block bitmap section 27 | #f.write("BB\n") 28 | for num, line in enumerate(raw): 29 | line = line.split() 30 | if len(line) > 5 and line[0] == "Group" and not (int(line[1][:-1]) % NUM_BLKS_IN_GROUP): 31 | for subline in raw[num+1:num+4]: 32 | subline = subline.split() 33 | if subline[0] == "Block": 34 | f.write(f"3 { ' '.join([subline[3], str(int(subline[3]) + NUM_BLKS_IN_GROUP - 1)]) }\n") 35 | 36 | # Inode bitmap section 37 | #f.write("IB\n") 38 | for num, line in enumerate(raw): 39 | line = line.split() 40 | if len(line) > 5 and line[0] == "Group" and not (int(line[1][:-1]) % NUM_BLKS_IN_GROUP): 41 | for subline in raw[num+2:num+5]: 42 | subline = subline.split() 43 | if subline[0:2] == ["Inode", "bitmap"]: 44 | f.write(f"4 { ' '.join([subline[3], str(int(subline[3]) + NUM_BLKS_IN_GROUP - 1)]) }\n") 45 | 46 | # Inode table section 47 | #f.write("IT\n") 48 | for num, line in enumerate(raw): 49 | line = line.split() 50 | if len(line) > 5 and line[0] == "Group" and not (int(line[1][:-1]) % NUM_BLKS_IN_GROUP): 51 | for subline in raw[num+3:num+6]: 52 | subline = subline.split() 53 | if subline[0:2] == ["Inode", "table"]: 54 | f.write(f"5 { ' '.join([subline[3].split('-')[0], str(int(subline[3].split('-')[0]) + INODETABLE_SIZE * NUM_BLKS_IN_GROUP - 1)]) }\n") 55 | 56 | if __name__ == "__main__": 57 | main() 58 | -------------------------------------------------------------------------------- /benchmark/general/blk_map/02_trace_map.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/pypy 2 | import sys 3 | 4 | 5 | def main(filename): 6 | with open(filename) as f: 7 | raw = f.readlines() 8 | with open("blk_map.txt") as f: 9 | ranges = f.readlines() 10 | 11 | ranges, journal_range = ranges[:-1], ranges[-1].split()[1:] 12 | ranges.sort(key=lambda x: x.split()[1]) 13 | ranges = [line.split() for line in ranges] 14 | 15 | def cont(value): 16 | for line in ranges: 17 | if value >= int(line[1]) and value <= int(line[2]): return {1: 'SB', 2: 'GD', 3: 'BB', 4: 'IB', 5: 'IT'}[int(line[0])] 18 | return "DE" 19 | 20 | def cont_ahead(value): 21 | for line in ranges: 22 | if value >= int(line[1]) and value <= int(line[2]): return {1: 'SB', 2: 'GD', 3: 'BB', 4: 'IB', 5: 'IT'}[int(line[0])] 23 | return "DE" 24 | 25 | count_r = {'SB': 0, 'GD': 0, 'BB': 0, 'IB': 0, 'IT': 0, 'DE': 0, 'DA': 0} 26 | count_w = {'SB': 0, 'GD': 0, 'BB': 0, 'IB': 0, 'IT': 0, 'DE': 0, 'DA': 0, 'DJ': 0} 27 | count = {'R': count_r, 'W': count_w, 'D': 0} 28 | 29 | for line in raw: 30 | tp, lba, cnt = line.split() 31 | if 'M' in tp or 'RA' in tp: 32 | count[tp[0]][cont(int(lba))] += int(cnt) 33 | elif 'D' in tp: 34 | count['D'] += int(cnt) 35 | else: 36 | if int(lba) >= int(journal_range[0]) and int(lba) <= int(journal_range[1]): 37 | count['W']['DJ'] += int(cnt) 38 | else: 39 | count[tp[0]]['DA'] += int(cnt) 40 | 41 | count_r, count_w = count['R'], count['W'] 42 | print(f"{count_r['SB']}\t{count_r['GD']}\t{count_r['BB']}\t{count_r['IB']}\t{count_r['IT']}\t{count_r['DE']}\t{count_r['DA']}\t{count_w['SB']}\t{count_w['GD']}\t{count_w['BB']}\t{count_w['IB']}\t{count_w['IT']}\t{count_w['DE']}\t{count_w['DA']}\t{count_w['DJ']}\t{count['D']}") 43 | 44 | 45 | if __name__ == "__main__": 46 | main(sys.argv[1]) 47 | -------------------------------------------------------------------------------- /benchmark/general/blk_map/parse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | set -eo pipefail 9 | 10 | TMP=/tmp/$(uuidgen) 11 | TMP2=/tmp/$(uuidgen) 12 | TARGET=/tmp/$(uuidgen) 13 | 14 | mkdir $TMP $TMP2 15 | 16 | TARGET=$(realpath "$1") 17 | FILESIZE=$(stat -c%s "$TARGET") 18 | 19 | cd $TMP 20 | split -C $(($FILESIZE / 12)) "$TARGET" 21 | # ls -al x* 22 | while read f; do grep '^[0-9]' $f | awk '{print $2, $3/8, $4/4096}' > $TMP2/$f & done < <(ls) 23 | wait 24 | cd - > /dev/null 25 | 26 | xa=0 27 | xb=0 28 | xc=0 29 | xd=0 30 | xe=0 31 | xf=0 32 | xg=0 33 | xh=0 34 | xi=0 35 | xj=0 36 | xk=0 37 | xl=0 38 | xm=0 39 | xn=0 40 | xo=0 41 | xp=0 42 | 43 | while read a b c d e f g h i j k l m n o p; do 44 | xa=$(($xa + $a)) 45 | xb=$(($xb + $b)) 46 | xc=$(($xc + $c)) 47 | xd=$(($xd + $d)) 48 | xe=$(($xe + $e)) 49 | xf=$(($xf + $f)) 50 | xg=$(($xg + $g)) 51 | xh=$(($xh + $h)) 52 | xi=$(($xi + $i)) 53 | xj=$(($xj + $j)) 54 | xk=$(($xk + $k)) 55 | xl=$(($xl + $l)) 56 | xm=$(($xm + $m)) 57 | xn=$(($xn + $n)) 58 | xo=$(($xo + $o)) 59 | xp=$(($xp + $p)) 60 | done < <(ls -d $TMP2/* | parallel ./02_trace_map.py) 61 | 62 | printf "R_SB\tR_GD\tR_BB\tR_IB\tR_IT\tR_DE\tR_DA\tW_SB\tW_GD\tW_BB\tW_IB\tW_IT\tW_DE\tW_DA\tW_DJ\tDEL\n" 63 | printf "$xa\t$xb\t$xc\t$xd\t$xe\t$xf\t$xg\t$xh\t$xi\t$xj\t$xk\t$xl\t$xm\t$xn\t$xo\t$xp\n" 64 | 65 | rm -rf $TMP $TMP2 66 | -------------------------------------------------------------------------------- /benchmark/general/blktrace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./blktrace 8 | 9 | blktrace $1 -a complete -o - | blkparse -f "%T.%t %d %S %N\n" -i - >> $2 & 10 | -------------------------------------------------------------------------------- /benchmark/general/btrfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./ext4_no_journal 8 | 9 | sudo yes | mkfs.btrfs -f $1 10 | sudo mount -t btrfs -o discard $1 /bench 11 | 12 | #dumpe2fs $1 > dumpfs.out 13 | -------------------------------------------------------------------------------- /benchmark/general/cutloadtrace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | # Usage: 9 | # cd ~/filebench_vmlog-20201015-010514 10 | # ~/kevin/benchmark/cuttrace.sh 11 | 12 | #set -eo pipefail 13 | 14 | # Set from filebench_vm.sh 15 | SLEEP=5 16 | 17 | ls -d */ | while read fs; do 18 | cd $fs 19 | ls perf/ | while read workload; do 20 | echo $fs$workload 21 | 22 | TARGET=$SLEEP 23 | echo Target time: $TARGET 24 | 25 | TIME=$(awk "\$1 > $TARGET && \$1 < ($TARGET + 20)" trace/$workload | head -n1 | awk '{print $1}' || true) 26 | echo Got time: $TIME 27 | 28 | echo Variance: $(echo $TIME-$TARGET | bc) 29 | 30 | # Cut 31 | mkdir -p cut 32 | cat trace/$workload | sed -n -e "/$TIME/"',$p' | sed -e '/CPU/,$d' | awk '$1 < 100000' > cut/$workload 33 | 34 | echo 35 | done 36 | cd .. 37 | done 38 | -------------------------------------------------------------------------------- /benchmark/general/cuttrace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | # Usage: 9 | # cd ~/filebench_vmlog-20201015-010514 10 | # ~/kevin/benchmark/cuttrace.sh 11 | 12 | #set -eo pipefail 13 | 14 | # Set from filebench_vm.sh 15 | SLEEP=5 16 | 17 | ls -d */ | while read fs; do 18 | cd $fs 19 | ls perf/ | while read workload; do 20 | echo $fs$workload 21 | 22 | TARGET=$(echo $(cat perf/$workload | grep ': Running...' | cut -d: -f1)+$SLEEP | bc) 23 | echo Target time: $TARGET 24 | 25 | TIME=$(awk "\$1 > $TARGET && \$1 < ($TARGET + 20)" trace/$workload | head -n1 | awk '{print $1}' || true) 26 | echo Got time: $TIME 27 | 28 | echo Variance: $(echo $TIME-$TARGET | bc) 29 | 30 | # Cut 31 | mkdir -p cut 32 | cat trace/$workload | sed -n -e "/$TIME/"',$p' | sed -e '/CPU/,$d' | awk '$1 < 100000' > cut/$workload 33 | 34 | echo 35 | done 36 | cd .. 37 | done 38 | -------------------------------------------------------------------------------- /benchmark/general/dumpfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./dumpfs 8 | 9 | sudo dumpe2fs $1 10 | -------------------------------------------------------------------------------- /benchmark/general/ext4_data_journal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./ext4_no_journal 8 | 9 | sudo yes | mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 $1 10 | #sudo yes | mkfs.ext4 -N 13000000 -E lazy_itable_init=0,lazy_journal_init=0 $1 11 | sudo mount -t ext4 -o discard,data=journal $1 /bench 12 | 13 | #dumpe2fs $1 > dumpfs.out 14 | -------------------------------------------------------------------------------- /benchmark/general/ext4_metadata_journal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./ext4_no_journal 8 | 9 | sudo yes | mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 $1 10 | sudo mount -t ext4 -o discard,data=ordered $1 /bench 11 | 12 | #dumpe2fs $1 > dumpfs.out 13 | -------------------------------------------------------------------------------- /benchmark/general/ext4_no_journal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./ext4_no_journal 8 | 9 | sudo yes | mkfs.ext4 -O ^has_journal -E lazy_itable_init=0,lazy_journal_init=0 $1 10 | sudo mount -t ext4 -o discard $1 /bench 11 | 12 | #dumpe2fs $1 > dumpfs.out 13 | -------------------------------------------------------------------------------- /benchmark/general/ext4_wb_journal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./ext4_no_journal 8 | 9 | sudo yes | mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 $1 10 | sudo mount -t ext4 -o discard,data=writeback $1 /bench 11 | 12 | #dumpe2fs $1 > dumpfs.out 13 | -------------------------------------------------------------------------------- /benchmark/general/f2fs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./ext4_no_journal 8 | 9 | sudo yes | mkfs.f2fs -f $1 10 | sudo mount -t f2fs -o discard $1 /bench 11 | 12 | #dumpe2fs $1 > dumpfs.out 13 | -------------------------------------------------------------------------------- /benchmark/general/flush_cache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | sync 9 | echo 3 > /proc/sys/vm/drop_caches 10 | -------------------------------------------------------------------------------- /benchmark/general/genfiostat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | # Usage: 9 | # cd ~/filebench_vmlog-20201015-010514 10 | # ~/kevin/benchmark/genstats.sh 11 | 12 | set -eo pipefail 13 | 14 | echo "Generating fs/fio.dat" 15 | echo 16 | 17 | ls -d */ | sort | while read fs; do 18 | cd $fs 19 | echo $fs 20 | 21 | ls perf/ | sort | while read workload; do 22 | echo -ne "$workload\t" 23 | ls perf/$workload | while read a; do grep iB/s $a | tail -n1; done | sed -e 's/bw=//g' -e 's@MiB/s@@g' | awk '{print $2}' 24 | done | tee fio.dat 25 | 26 | cd .. 27 | echo 28 | done 29 | 30 | echo "Generating summary" 31 | 32 | echo -ne '\t' 33 | ls -d */ | sort | while read fs; do 34 | echo -ne "$fs\t" 35 | done | sed \ 36 | -e "s@btrfs/@BTRFS@g" \ 37 | -e "s@xfs/@XFS@g" \ 38 | -e "s@f2fs/@F2FS@g" \ 39 | -e "s@ext4_data_journal/@EXT4-DATA@g" \ 40 | -e "s@ext4_metadata_journal/@EXT4-META@g" 41 | echo 42 | 43 | LINE=$(wc -l $(ls $(ls -d */ | head -n1)/fio.dat) | awk '{print $1}') 44 | for i in $(seq 1 $LINE); do 45 | awk "NR==$i{print \$1}" $(ls $(ls -d */ | head -n1)/fio.dat) | tr '\n' '\t' 46 | ls -d */ | sort | while read fs; do 47 | awk "NR==$i{print \$2}" $fs/fio.dat | tr '\n' '\t' 48 | done 49 | echo 50 | done 51 | -------------------------------------------------------------------------------- /benchmark/general/genmasterstat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | # Usage: 9 | # cd ~/filebench_vmlog-20201015-010514 10 | # ~/kevin/benchmark/genstats.sh 11 | 12 | # set -eo pipefail 13 | 14 | echo "Generating fs/workload/flashdriversum" 15 | echo 16 | 17 | ls -d */ | sort | while read fs; do 18 | cd $fs 19 | echo $fs 20 | 21 | echo "Saving to $(pwd)/flashdriversum" 22 | ( 23 | cat flashdriver | tail -n30 | grep '^MAPPING[RW] \|^DATA[RW] ' | tr ' ' '\t' 24 | echo -ne "GCR\t" 25 | echo $(cat flashdriver | tail -n30 | grep '^GCMR \|^GCDR \|^GCMR_DGC '| awk '{print $2}' | tr '\n' '+')0 | bc 26 | echo -ne "GCW\t" 27 | echo $(cat flashdriver | tail -n30 | grep '^GCMW \|^GCDW \|^GCMW_DGC '| awk '{print $2}' | tr '\n' '+')0 | bc 28 | ) | tee flashdriversum 29 | echo 30 | 31 | cd .. 32 | echo 33 | done 34 | 35 | echo "Generating total flash driver summary" 36 | 37 | echo -ne "$workload"'\t' 38 | cat $(ls -d */ | head -n1)/flashdriversum | awk '{print $1}' | tr '\n' '\t' 39 | echo 40 | ls -d */ | sort | while read fs; do 41 | echo -ne "\"$fs\""'\t' 42 | LINE=$(wc -l $(ls $(ls -d */ | head -n1)/flashdriversum) | awk '{print $1}') 43 | for i in $(seq 1 $LINE); do 44 | awk "NR==$i{print \$2}" $fs/flashdriversum | tr '\n' '\t' 45 | done 46 | echo 47 | done | sed \ 48 | -e "s@btrfs/@BTRFS@g" \ 49 | -e "s@xfs/@XFS@g" \ 50 | -e "s@f2fs/@F2FS@g" \ 51 | -e "s@ext4_data_journal/@EXT4-DATA@g" \ 52 | -e "s@ext4_metadata_journal/@EXT4-META@g" \ 53 | -e "s/micro_copyfiles.f/cp/g" \ 54 | -e "s/micro_createfiles.f/creat_4K/g" \ 55 | -e "s/micro_createfiles_empty.f/creat/g" \ 56 | -e "s/micro_delete.f/unlink_4K/g" \ 57 | -e "s/micro_delete_empty.f/unlink/g" \ 58 | -e "s/micro_makedirs.f/mkdir/g" \ 59 | -e "s/micro_removedirs.f/rmdir/g" \ 60 | -e "s/real_fileserver.f/Fileserver/g" \ 61 | -e "s/real_varmail.f/Varmail/g" \ 62 | -e "s/real_webproxy.f/Webproxy/g" \ 63 | -e "s/real_webserver.f/Webserver/g" 64 | -------------------------------------------------------------------------------- /benchmark/general/gentrace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | # Usage: 9 | # cd ~/filebench_vmlog-20201015-010514 10 | # ~/kevin/benchmark/genstats.sh 11 | 12 | set -eo pipefail 13 | 14 | echo "Parsing trace" 15 | echo 16 | 17 | ls -d */ | sort | while read fs; do 18 | cd $fs 19 | 20 | if echo $fs | grep -qi xfs; then 21 | parser=parser_xfs 22 | else 23 | parser=parser_ext4 24 | fi 25 | 26 | mkdir -p parsed 27 | TARGET=cut/ 28 | if [ ! -e $TARGET ]; then TARGET=trace/; fi 29 | echo "Using $TARGET" 30 | 31 | ls $TARGET | sort | while read workload; do 32 | ${kevin_root_dir}/benchmark/general/$parser $TARGET$workload > parsed/$workload & 33 | done & 34 | 35 | cd .. 36 | done 37 | 38 | while pgrep -f parser_ > /dev/null; do sleep 1; done 39 | 40 | ls -d */ | sort | while read fs; do 41 | cd $fs 42 | 43 | mkdir -p iocount 44 | ls parsed/ | sort | while read workload; do 45 | echo -ne \"$fs\""\t" | sed \ 46 | -e 's@btrfs@BTRFS@g' \ 47 | -e 's@xfs@XFS@g' \ 48 | -e 's@f2fs@F2FS@g' \ 49 | -e 's@ext4_data_journal@EXT4-D@g' \ 50 | -e 's@ext4_metadata_journal@EXT4-M@g' | tr -d '/' > iocount/$workload 51 | tail -n2 parsed/$workload | head -n1 | tr ' ' '\t' >> iocount/$workload 52 | done 53 | 54 | cd .. 55 | done 56 | 57 | ls $(ls -d */ | head -n1)/iocount/ | while read workload; do 58 | echo -e "$workload\tMDR\tMDW\tDR\tDW\tJ\tD" 59 | cat */iocount/$workload 60 | echo 61 | echo 62 | done 63 | -------------------------------------------------------------------------------- /benchmark/general/get_lba_by_inode_number.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./get_lba_by_inode_number 8 | 9 | sudo debugfs -R "stat <$1>" /dev/cheeze0 10 | -------------------------------------------------------------------------------- /benchmark/general/kukasum.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | # Usage: 9 | # cd ~/filebench_vmlog-20201015-010514 10 | # ~/kevin/benchmark/genstats.sh 11 | 12 | # set -eo pipefail 13 | 14 | ( 15 | cat "$@" | tail -n30 | grep '^MAPPING[RW] \|^DATA[RW] ' | tr ' ' '\t' 16 | echo -ne "GCR\t" 17 | echo $(cat "$@" | tail -n30 | grep '^GCMR \|^GCDR \|^GCMR_DGC '| awk '{print $2}' | tr '\n' '+')0 | bc 18 | echo -ne "GCW\t" 19 | echo $(cat "$@" | tail -n30 | grep '^GCMW \|^GCDW \|^GCMW_DGC '| awk '{print $2}' | tr '\n' '+')0 | bc 20 | ) 21 | echo 22 | -------------------------------------------------------------------------------- /benchmark/general/parser.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | #set -eo pipefail 9 | 10 | TMP=/tmp/parser.$(uuidgen) 11 | TMP2=/tmp/parser.$(uuidgen) 12 | 13 | cat > $TMP 14 | 15 | if grep -q MAPPINGR $TMP; then 16 | mkdir dev_count 17 | DEST=dev_count 18 | else 19 | mkdir fs_count 20 | DEST=fs_count 21 | fi 22 | 23 | cat $TMP | grep 'MAPPINGR\|MDR' | awk '{print $1}' | while read title; do 24 | ( 25 | grep -A6 "^$title"$'\t' $TMP | tail -n +2 | \ 26 | sed -e 's@EXT4-META@EXT4-M@g' -e 's@EXT4-DATA@EXT4-D@g' | tr '\t' ' ' | tr '\r' ' ' | \ 27 | while read fs a b c d e f g; do 28 | if [[ "$a" -lt 0 ]]; then a=0; fi 29 | if [[ "$b" -lt 0 ]]; then b=0; fi 30 | if [[ "$c" -lt 0 ]]; then c=0; fi 31 | if [[ "$d" -lt 0 ]]; then d=0; fi 32 | if [[ "$e" -lt 0 ]]; then e=0; fi 33 | if [[ "$f" -lt 0 ]]; then f=0; fi 34 | echo '"'$fs'"' $a $b $c $d $e $f 35 | done | tee > $TMP2 36 | 37 | grep '^"EXT4-M"' $TMP2 38 | grep '^"EXT4-D"' $TMP2 39 | grep '^"XFS"' $TMP2 40 | grep '^"BTRFS"' $TMP2 41 | grep '^"F2FS"' $TMP2 42 | grep '^"LIGHTFS"' $TMP2 43 | ) > $DEST/$title.dat 44 | done 45 | 46 | rm $TMP $TMP2 47 | -------------------------------------------------------------------------------- /benchmark/general/parser_ext4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgist-datalab/kevin/4f46599a9b1303e0f60f9f114feb302c8d2a00dd/benchmark/general/parser_ext4 -------------------------------------------------------------------------------- /benchmark/general/parser_xfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgist-datalab/kevin/4f46599a9b1303e0f60f9f114feb302c8d2a00dd/benchmark/general/parser_xfs -------------------------------------------------------------------------------- /benchmark/general/vmsum.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | mkdir -p vmsum 9 | ls vmstat/ | sort | while read workload; do 10 | #LINES=$(cat vmstat/$workload | awk '{print $16, $17}' | grep '^[0-9]' | awk '{print $1+$2}' | grep -v '^100' | wc -l) 11 | #echo "("$(cat vmstat/$workload | awk '{print $16, $17}' | grep '^[0-9]' | awk '{print $1+$2}' | grep -v '^100' | tr '\n' '+')0") / $LINES" | bc > vmsum/$workload 12 | #LINES=$(cat vmstat/$workload | awk '{print $15, $17, $18}' | grep -v '^0' | awk '{print $2+$3}' | grep -v '^0' | wc -l) 13 | #echo "("$(cat vmstat/$workload | awk '{print $15, $17, $18}' | grep -v '^0' | awk '{print $2+$3}' | grep -v '^0' | tr '\n' '+')0") / $LINES" | bc > vmsum/$workload 14 | LINES=$(cat vmstat/$workload | awk '{print $15, $18}' | grep -v '^0' | awk '{print $2 + 0}' | grep -v '^0' | wc -l) 15 | echo "("$(cat vmstat/$workload | awk '{print $15, $18}' | grep -v '^0' | awk '{print $2 + 0}' | grep -v '^0' | tr '\n' '+')0") / $LINES" | bc > vmsum/$workload 16 | done 17 | 18 | grep . vmsum/* | tr ':' '\t' | sed \ 19 | -e "s@vmsum/@@g" \ 20 | -e "s/micro_copyfiles.f/cp()/g" \ 21 | -e "s/micro_createfiles_fsync.f/creat()-4K-FSYNC/g" \ 22 | -e "s/micro_createfiles.f/creat()-4K/g" \ 23 | -e "s/micro_createfiles_empty.f/creat()/g" \ 24 | -e "s/micro_delete.f/unlink()-4K/g" \ 25 | -e "s/micro_delete_empty.f/unlink()/g" \ 26 | -e "s/micro_makedirs.f/mkdir()/g" \ 27 | -e "s/micro_removedirs.f/rmdir()/g" \ 28 | -e "s/micro_listdirs_empty.f/readdir()-C/g" \ 29 | -e "s/micro_listdirs.f/readdir()-W/g" \ 30 | -e "s/real_fileserver.f/Fileserver/g" \ 31 | -e "s/real_varmail.f/Varmail/g" \ 32 | -e "s/real_webproxy.f/Webproxy/g" \ 33 | -e "s/real_webserver.f/Webserver/g" \ 34 | -e "s/real_oltp.f/Oltp/g" \ 35 | -------------------------------------------------------------------------------- /benchmark/general/xfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #usage: ./ext4_no_journal 8 | 9 | sudo yes | mkfs.xfs -f $1 10 | sudo mount -t xfs -o discard $1 /bench 11 | 12 | #dumpe2fs $1 > dumpfs.out 13 | -------------------------------------------------------------------------------- /benchmark/setup_cheeze.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | set -eo pipefail 9 | 10 | rmmod cheeze 2>/dev/null || true 11 | insmod $blk_cheeze_ko 12 | 13 | TMP=/tmp/setup_vm 14 | 15 | echo -n "/sys/module/cheeze/parameters/page_addr0: " 16 | awk '{print $NF}' $TMP | head -n1 | tail -n1 | tee /sys/module/cheeze/parameters/page_addr0 17 | 18 | echo -n "/sys/module/cheeze/parameters/page_addr1: " 19 | awk '{print $NF}' $TMP | head -n2 | tail -n1 | tee /sys/module/cheeze/parameters/page_addr1 20 | 21 | echo -n "/sys/module/cheeze/parameters/page_addr2: " 22 | awk '{print $NF}' $TMP | head -n3 | tail -n1 | tee /sys/module/cheeze/parameters/page_addr2 23 | 24 | echo 1 > /sys/module/cheeze/parameters/enabled 25 | echo $((128 * 1024 * 1024 * 1024)) > /sys/block/cheeze0/disksize 26 | -------------------------------------------------------------------------------- /benchmark/setup_vm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | set -eo pipefail 9 | 10 | rm -f /dev/hugepages/qemutest 11 | fallocate -l 4G /dev/hugepages/qemutest 12 | 13 | # Set addresses 14 | TMP=/tmp/setup_vm 15 | dmesg -c | grep 'hugetlbfs: qemutest: index ' | tail -n4 | tee $TMP 16 | 17 | ./setup_cheeze.sh 18 | 19 | # Turn on VM 20 | sync 21 | echo "Turning on VM" 22 | virsh start passthru 23 | 24 | echo "Waiting for VM to come online" 25 | until timeout 0.5 ssh root@pt1 true 2>/dev/null; do sleep 0.5; done 26 | echo "VM online" 27 | 28 | # Setup VCU 29 | ssh root@pt1 "sync; $setup_vcu; sync" || true 30 | 31 | echo "VM setup done" 32 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/bench.sh: -------------------------------------------------------------------------------- 1 | #echo $$ > /sys/fs/cgroup/bench/cgroup.procs; filebench -f tmp/copyfiles_16_gamma_fuse.f 2 | #echo $$ > /sys/fs/cgroup/bench/cgroup.procs; filebench -f tmp/filemicro_createfiles_16_fuse.f 3 | #filebench -f tmp/makedirs_16_fuse.f 4 | #filebench -f tmp/removedirs_16_fuse.f 5 | #filebench -f tmp/filemicro_createfiles_16_fuse.f 6 | #filebench -f tmp/filemicro_delete_16_fuse.f 7 | #filebench -f tmp/copyfiles_16_gamma_fuse.f 8 | #filebench -f tmp/fileserver_gamma_fuse.f 9 | #filebench -f tmp/varmail_gamma_fuse.f 10 | #filebench -f tmp/webproxy_gamma_fuse.f 11 | #filebench -f tmp/webserver_gamma_fuse.f 12 | #filebench -f tmp/tmp.f 13 | #filebench -f tmp/micro_makedirs.f 14 | #filebench -f tmp/micro_removedirs.f 15 | filebench -f tmp/micro_copyfiles.f 16 | #filebench -f tmp/micro_makedirs.f 17 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/setup_lightfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | set -eo pipefail 9 | 10 | rmmod cheeze 2>/dev/null || true 11 | insmod /home/koo/cheeze/cheeze.ko 12 | 13 | TMP=/tmp/setup_vm 14 | 15 | echo -n "/sys/module/cheeze/parameters/page_addr0: " 16 | awk '{print $NF}' $TMP | head -n1 | tail -n1 | tee /sys/module/cheeze/parameters/page_addr0 17 | 18 | echo -n "/sys/module/cheeze/parameters/page_addr1: " 19 | awk '{print $NF}' $TMP | head -n2 | tail -n1 | tee /sys/module/cheeze/parameters/page_addr1 20 | 21 | echo -n "/sys/module/cheeze/parameters/page_addr2: " 22 | awk '{print $NF}' $TMP | head -n3 | tail -n1 | tee /sys/module/cheeze/parameters/page_addr2 23 | 24 | echo 1 > /sys/module/cheeze/parameters/enabled 25 | echo $((128 * 1024 * 1024 * 1024)) > /sys/block/cheeze0/disksize 26 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/setup_vm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | set -eo pipefail 9 | 10 | fallocate -l 4G /dev/hugepages/qemutest 11 | 12 | # Set addresses 13 | TMP=/tmp/setup_vm 14 | dmesg -c | grep 'hugetlbfs: qemutest: index ' | tail -n4 | tee $TMP 15 | 16 | # Turn on VM 17 | sync 18 | echo "Turning on VM" 19 | virsh start passthru 20 | 21 | echo "Waiting for VM to come online" 22 | until timeout 0.5 ssh root@10.150.21.48 true 2>/dev/null; do sleep 0.5; done 23 | echo "VM online" 24 | 25 | # Setup VCU 26 | ssh root@10.150.21.48 'sync; /home/flashdriver/amf-driver/programFPGA/program-vcu108.sh; sync' || true 27 | 28 | echo "VM setup done" 29 | 30 | cat /tmp/setup_vm 31 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/copyfiles_16_gamma_fuse.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/media 27 | set $nfiles=3200000 28 | set $meandirwidth=100 29 | set $meanfilesize=8k 30 | set $iosize=1m 31 | set $nthreads=16 32 | set $count=22400000 33 | 34 | set mode quit firstdone 35 | 36 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 37 | 38 | define fileset name=bigfileset,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 39 | define fileset name=destfiles,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth 40 | 41 | define process name=filereader,instances=1 42 | { 43 | thread name=filereaderthread,memsize=10m,instances=$nthreads 44 | { 45 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 46 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 47 | flowop createfile name=createfile2,filesetname=destfiles,fd=2 48 | flowop writewholefile name=writefile2,fd=2,iosize=$iosize 49 | flowop closefile name=closefile1,fd=1 50 | flowop closefile name=closefile2,fd=2 51 | flowop finishoncount name=finish,value=$count 52 | } 53 | } 54 | 55 | run 100000000 56 | 57 | echo "Copyfiles Version 3.0 personality successfully loaded" 58 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/filemicro_createfiles_16_fuse.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/media 36 | set $count=25600000 37 | set $filesize=8k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=6400000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | define process name=filecreate,instances=1 48 | { 49 | thread name=filecreatethread,memsize=10m,instances=$nthreads 50 | { 51 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 52 | flowop writewholefile name=writefile1,filesetname=bigfileset,fd=1,iosize=$iosize 53 | flowop closefile name=closefile1,fd=1 54 | flowop finishoncount name=finish,value=$count 55 | } 56 | } 57 | 58 | run 100000000 59 | 60 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 61 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/filemicro_delete_16_fuse.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/media 33 | set $count=12800000 34 | set $filesize=8k 35 | set $nfiles=6400000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | define process name=filedelete,instances=1 44 | { 45 | thread name=filedeletethread,memsize=10m,instances=$nthreads 46 | { 47 | flowop deletefile name=deletefile1, filesetname=bigfileset 48 | flowop opslimit name=limit 49 | flowop finishoncount name=finish,value=$count 50 | } 51 | } 52 | 53 | run 100000000 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/fileserver_gamma_fuse.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/media 27 | set $nfiles=800000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:131072;gamma:1.5) 30 | set $filesize=131072 31 | set $nthreads=50 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=8000000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:10000;gamma:1.5,min=0,max=19999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 47 | flowop writewholefile name=wrtfile1,srcfd=1,fd=1,iosize=$iosize 48 | flowop closefile name=closefile1,fd=1 49 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 50 | flowop appendfile name=appendfilerand1,iosize=$meanappendsize,fd=1 51 | flowop closefile name=closefile2,fd=1 52 | flowop openfile name=openfile2,filesetname=bigfileset,fd=1 53 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 54 | flowop closefile name=closefile3,fd=1 55 | flowop deletefile name=deletefile1,filesetname=bigfileset 56 | flowop statfile name=statfile1,filesetname=bigfileset 57 | flowop finishoncount name=finish,value=$count 58 | } 59 | } 60 | 61 | echo "File-server Version 3.0 personality successfully loaded" 62 | 63 | run 100000000 64 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/makedirs_16_fuse.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a directory with $ndirs potential leaf directories, than mkdir's them 26 | # 27 | set $dir=/media 28 | set $ndirs=6400000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | 32 | set mode quit firstdone 33 | 34 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth 35 | 36 | define process name=dirmake,instances=1 37 | { 38 | thread name=dirmaker,memsize=1m,instances=$nthreads 39 | { 40 | flowop makedir name=mkdir1,filesetname=bigfileset 41 | } 42 | } 43 | 44 | run 100000000 45 | 46 | echo "MakeDirs Version 1.0 personality successfully loaded" 47 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/micro_copyfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=4000000 28 | set $meandirwidth=100 29 | set $meanfilesize=4k 30 | set $iosize=1m 31 | set $nthreads=16 32 | set $count=28000000 33 | 34 | set mode quit firstdone 35 | 36 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 37 | 38 | define fileset name=bigfileset,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 39 | define fileset name=destfiles,path=$dir,size=$meanfilesize,entries=$nfiles,dirwidth=$meandirwidth 40 | 41 | define process name=filereader,instances=1 42 | { 43 | thread name=filereaderthread,memsize=10m,instances=$nthreads 44 | { 45 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 46 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 47 | flowop createfile name=createfile2,filesetname=destfiles,fd=2 48 | flowop writewholefile name=writefile2,fd=2,iosize=$iosize 49 | flowop closefile name=closefile1,fd=1 50 | flowop closefile name=closefile2,fd=2 51 | flowop finishoncount name=finish,value=$count 52 | } 53 | } 54 | 55 | run 100000000 56 | 57 | echo "Copyfiles Version 3.0 personality successfully loaded" 58 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/micro_createfiles.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=32000000 37 | set $filesize=4k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=8000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | define process name=filecreate,instances=1 48 | { 49 | thread name=filecreatethread,memsize=10m,instances=$nthreads 50 | { 51 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 52 | flowop writewholefile name=writefile1,filesetname=bigfileset,fd=1,iosize=$iosize 53 | flowop closefile name=closefile1,fd=1 54 | flowop finishoncount name=finish,value=$count 55 | } 56 | } 57 | 58 | run 100000000 59 | 60 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 61 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/micro_createfiles_empty.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Creates a fileset with 20,000 entries ($nfiles), but only preallocates 28 | # 50% of the files. Each file's size is set via a gamma distribution with 29 | # a median size of 1KB ($filesize). 30 | # 31 | # The single thread then creates a new file and writes the whole file with 32 | # 1MB I/Os. The thread stops after 5000 files ($count/num of flowops) have 33 | # been created and written to. 34 | 35 | set $dir=/bench 36 | set $count=24000000 37 | set $filesize=0k 38 | set $iosize=1m 39 | set $meandirwidth=100 40 | set $nfiles=8000000 41 | set $nthreads=16 42 | 43 | set mode quit alldone 44 | 45 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=0,paralloc 46 | 47 | define process name=filecreate,instances=1 48 | { 49 | thread name=filecreatethread,memsize=10m,instances=$nthreads 50 | { 51 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 52 | flowop closefile name=closefile1,fd=1 53 | flowop finishoncount name=finish,value=$count 54 | } 55 | } 56 | 57 | run 100000000 58 | 59 | echo "FileMicro-Createfiles Version 2.2 personality successfully loaded" 60 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/micro_delete.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # ident "%Z%%M% %I% %E% SMI" 26 | 27 | # Create a fileset of 50,000 entries ($nfiles), where each file's size is set 28 | # via a gamma distribution with the median size of 16KB ($filesize). 29 | # Fire off 16 threads ($nthreads), where each thread stops after 30 | # deleting 1000 ($count) files. 31 | 32 | set $dir=/bench 33 | set $count=16000000 34 | set $filesize=4k 35 | set $nfiles=8000000 36 | set $meandirwidth=100 37 | set $nthreads=16 38 | 39 | set mode quit alldone 40 | 41 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100,paralloc 42 | 43 | define process name=filedelete,instances=1 44 | { 45 | thread name=filedeletethread,memsize=10m,instances=$nthreads 46 | { 47 | flowop deletefile name=deletefile1, filesetname=bigfileset 48 | flowop opslimit name=limit 49 | flowop finishoncount name=finish,value=$count 50 | } 51 | } 52 | 53 | run 100000000 54 | 55 | echo "FileMicro-Delete Version 2.4 personality successfully loaded" 56 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/micro_makedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a directory with $ndirs potential leaf directories, than mkdir's them 26 | # 27 | set $dir=/media 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | 32 | set mode quit firstdone 33 | 34 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth 35 | 36 | define process name=dirmake,instances=1 37 | { 38 | thread name=dirmaker,memsize=1m,instances=$nthreads 39 | { 40 | flowop makedir name=mkdir1,filesetname=bigfileset 41 | } 42 | } 43 | 44 | run 100000000 45 | 46 | echo "MakeDirs Version 1.0 personality successfully loaded" 47 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/micro_removedirs.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with $ndirs empty leaf directories then rmdir's all of them 26 | # 27 | set $dir=/media 28 | set $ndirs=8000000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | set $count=16000000 32 | 33 | set mode quit alldone 34 | 35 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth,prealloc 36 | 37 | define process name=remdir,instances=1 38 | { 39 | thread name=removedirectory,memsize=1m,instances=$nthreads 40 | { 41 | flowop removedir name=dirremover,filesetname=bigfileset 42 | flowop opslimit name=limit 43 | flowop finishoncount name=finish,value=$count 44 | } 45 | } 46 | 47 | run 100000000 48 | 49 | echo "RemoveDir Version 1.0 personality successfully loaded" 50 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/removedirs_16_fuse.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | # Creates a fileset with $ndirs empty leaf directories then rmdir's all of them 26 | # 27 | set $dir=/media 28 | set $ndirs=6400000 29 | set $meandirwidth=100 30 | set $nthreads=16 31 | set $count=12800000 32 | 33 | set mode quit alldone 34 | 35 | define fileset name=bigfileset,path=$dir,size=0,leafdirs=$ndirs,dirwidth=$meandirwidth,prealloc 36 | 37 | define process name=remdir,instances=1 38 | { 39 | thread name=removedirectory,memsize=1m,instances=$nthreads 40 | { 41 | flowop removedir name=dirremover,filesetname=bigfileset 42 | flowop opslimit name=limit 43 | flowop finishoncount name=finish,value=$count 44 | } 45 | } 46 | 47 | run 100000000 48 | 49 | echo "RemoveDir Version 1.0 personality successfully loaded" 50 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/tmp.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/media 27 | set $nfiles=3200000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:16384;gamma:1.5) 30 | set $filesize=16384 31 | set $nthreads=16 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=12800000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop deletefile name=deletefile1,filesetname=bigfileset 47 | flowop createfile name=createfile2,filesetname=bigfileset,fd=1 48 | flowop appendfile name=appendfilerand2,iosize=$meanappendsize,fd=1 49 | flowop fsync name=fsyncfile2,fd=1 50 | flowop closefile name=closefile2,fd=1 51 | flowop openfile name=openfile3,filesetname=bigfileset,fd=1 52 | flowop readwholefile name=readfile3,fd=1,iosize=$iosize 53 | flowop appendfile name=appendfilerand3,iosize=$meanappendsize,fd=1 54 | flowop fsync name=fsyncfile3,fd=1 55 | flowop closefile name=closefile3,fd=1 56 | flowop openfile name=openfile4,filesetname=bigfileset,fd=1 57 | flowop readwholefile name=readfile4,fd=1,iosize=$iosize 58 | flowop closefile name=closefile4,fd=1 59 | flowop finishoncount name=finish,value=$count 60 | } 61 | } 62 | 63 | echo "Varmail Version 3.0 personality successfully loaded" 64 | 65 | run 100000000 66 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/tmp_fileserver_gamma_fuse.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/bench 27 | set $nfiles=800000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:131072;gamma:1.5) 30 | set $filesize=131072 31 | set $nthreads=50 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=8000000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:10000;gamma:1.5,min=0,max=19999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop createfile name=createfile1,filesetname=bigfileset,fd=1 47 | flowop writewholefile name=wrtfile1,srcfd=1,fd=1,iosize=$iosize 48 | flowop closefile name=closefile1,fd=1 49 | flowop openfile name=openfile1,filesetname=bigfileset,fd=1 50 | flowop appendfile name=appendfilerand1,iosize=$meanappendsize,fd=1 51 | flowop closefile name=closefile2,fd=1 52 | flowop openfile name=openfile2,filesetname=bigfileset,fd=1 53 | flowop readwholefile name=readfile1,fd=1,iosize=$iosize 54 | flowop closefile name=closefile3,fd=1 55 | flowop deletefile name=deletefile1,filesetname=bigfileset 56 | flowop statfile name=statfile1,filesetname=bigfileset 57 | flowop finishoncount name=finish,value=$count 58 | } 59 | } 60 | 61 | echo "File-server Version 3.0 personality successfully loaded" 62 | 63 | run 100000000 64 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/tmp/varmail_gamma_fuse.f: -------------------------------------------------------------------------------- 1 | # 2 | # CDDL HEADER START 3 | # 4 | # The contents of this file are subject to the terms of the 5 | # Common Development and Distribution License (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # 8 | # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 | # or http://www.opensolaris.org/os/licensing. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # When distributing Covered Code, include this CDDL HEADER in each 14 | # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 | # If applicable, add the following below this CDDL HEADER, with the 16 | # fields enclosed by brackets "[]" replaced with your own identifying 17 | # information: Portions Copyright [yyyy] [name of copyright owner] 18 | # 19 | # CDDL HEADER END 20 | # 21 | # 22 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 | # Use is subject to license terms. 24 | # 25 | 26 | set $dir=/media 27 | set $nfiles=3200000 28 | set $meandirwidth=100 29 | #set $filesize=cvar(type=cvar-gamma,parameters=mean:16384;gamma:1.5) 30 | set $filesize=16384 31 | set $nthreads=16 32 | set $iosize=1m 33 | set $meanappendsize=16k 34 | set $count=12800000 35 | 36 | set mode quit alldone 37 | 38 | #set $fileidx=cvar(type=cvar-gamma,parameters=mean:40000;gamma:1.5,min=0,max=79999) 39 | 40 | define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80,paralloc 41 | 42 | define process name=filereader,instances=1 43 | { 44 | thread name=filereaderthread,memsize=10m,instances=$nthreads 45 | { 46 | flowop deletefile name=deletefile1,filesetname=bigfileset 47 | flowop createfile name=createfile2,filesetname=bigfileset,fd=1 48 | flowop appendfile name=appendfilerand2,iosize=$meanappendsize,fd=1 49 | flowop fsync name=fsyncfile2,fd=1 50 | flowop closefile name=closefile2,fd=1 51 | flowop openfile name=openfile3,filesetname=bigfileset,fd=1 52 | flowop readwholefile name=readfile3,fd=1,iosize=$iosize 53 | flowop appendfile name=appendfilerand3,iosize=$meanappendsize,fd=1 54 | flowop fsync name=fsyncfile3,fd=1 55 | flowop closefile name=closefile3,fd=1 56 | flowop openfile name=openfile4,filesetname=bigfileset,fd=1 57 | flowop readwholefile name=readfile4,fd=1,iosize=$iosize 58 | flowop closefile name=closefile4,fd=1 59 | flowop finishoncount name=finish,value=$count 60 | } 61 | } 62 | 63 | echo "Varmail Version 3.0 personality successfully loaded" 64 | 65 | run 100000000 66 | -------------------------------------------------------------------------------- /benchmark/unused/lightfs/ttest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | #mkdir /sys/fs/cgroup/bench 8 | #echo "+memory" > /sys/fs/cgroup/cgroup.subtree_control 9 | #echo $((16 * 1024 * 1024 * 1024)) > /sys/fs/cgroup/bench/memory.max 10 | echo 0 > /proc/sys/kernel/randomize_va_space 11 | 12 | -------------------------------------------------------------------------------- /benchmark/unused/setup_cheeze_vm2vm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$kevin_env_set" != "1" ]]; then 4 | echo "Please source env for kevin" 5 | exit 1 6 | fi 7 | 8 | set -eo pipefail 9 | 10 | rmmod cheeze 2>/dev/null || true 11 | insmod /home/koo/cheeze/cheeze.ko 12 | 13 | echo 0x800000000 > /sys/module/cheeze/parameters/page_addr 14 | echo 1 > /sys/module/cheeze/parameters/enabled 15 | echo $((128 * 1024 * 1024 * 1024)) > /sys/block/cheeze0/disksize 16 | -------------------------------------------------------------------------------- /bin/rm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BOLD=$(tput bold) 4 | NORMAL=$(tput sgr0) 5 | bold() { 6 | echo "$BOLD$@$NORMAL" 1>&2 7 | } 8 | 9 | # Safe rm to prevent `rm -rf /*` 10 | for var in "$@"; do 11 | if [[ "$var" == "/dev" ]]; then 12 | echo 13 | bold "Attempted to rm -rf /, please review your script" 14 | bold $0 ${1:+"$@"} 15 | echo 16 | exit 1 17 | fi 18 | done 19 | 20 | exec /bin/rm ${1:+"$@"} 21 | -------------------------------------------------------------------------------- /env: -------------------------------------------------------------------------------- 1 | # Usage 2 | # . env 3 | 4 | export kevin_root_dir="/home/koo/kevin" 5 | export flash_ftl_driver_dir="/home/kukania/Koofs_proj/FlashFTLDriver" 6 | export flash_driver_dir="/koo/home/koo/src/FlashDriver2" 7 | export tpcc_owner="ssjy806" 8 | export tpcc_dir="/home/ssjy806/tpcc" 9 | export kernel_src="/home/koo/linux-stable.git" 10 | export blk_cheeze_ko="/home/koo/cheeze/cheeze.ko" 11 | export setup_vcu="/home/kukania/amf-driver/programFPGA/program-vcu108.sh" 12 | export geriatrix_path="/home/koo/geriatrix" 13 | 14 | # Use saferm 15 | export PATH=$(realpath bin):$PATH 16 | 17 | export kevin_env_set=1 18 | -------------------------------------------------------------------------------- /kevinfs/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE! Don't add files that are generated in specific 3 | # subdirectories here. Add them in the ".gitignore" file 4 | # in that subdirectory instead. 5 | # 6 | # NOTE! Please use 'git ls-files -i --exclude-standard' 7 | # command after changing this file, to see if there are 8 | # any tracked files which get ignored after the change. 9 | # 10 | # Normal rules (sorted alphabetically) 11 | # 12 | .* 13 | *.a 14 | *.bin 15 | *.bz2 16 | *.c.[012]*.* 17 | *.dtb 18 | *.dtb.S 19 | *.dwo 20 | *.elf 21 | *.gcno 22 | *.gz 23 | *.i 24 | *.ko 25 | *.ll 26 | *.lst 27 | *.lz4 28 | *.lzma 29 | *.lzo 30 | *.mod.c 31 | *.mod 32 | *.o 33 | *.o.* 34 | *.order 35 | *.patch 36 | *.s 37 | *.so 38 | *.so.dbg 39 | *.su 40 | *.symtypes 41 | *.tar 42 | *.xz 43 | Module.symvers 44 | modules.builtin 45 | 46 | # 47 | # Top-level generic files 48 | # 49 | /tags 50 | /TAGS 51 | /linux 52 | /vmlinux 53 | /vmlinux.32 54 | /vmlinux-gdb.py 55 | /vmlinuz 56 | /System.map 57 | /Module.markers 58 | 59 | # 60 | # RPM spec file (make rpm-pkg) 61 | # 62 | /*.spec 63 | 64 | # 65 | # Debian directory (make deb-pkg) 66 | # 67 | #/debian/ 68 | 69 | # 70 | # Snap directory (make snap-pkg) 71 | # 72 | /snap/ 73 | 74 | # 75 | # tar directory (make tar*-pkg) 76 | # 77 | /tar-install/ 78 | 79 | # 80 | # git files that we don't want to ignore even if they are dot-files 81 | # 82 | !.gitignore 83 | !.mailmap 84 | !.cocciconfig 85 | 86 | # 87 | # Generated include files 88 | # 89 | include/config 90 | include/generated 91 | arch/*/include/generated 92 | 93 | # stgit generated dirs 94 | patches-* 95 | 96 | # quilt's files 97 | patches 98 | series 99 | 100 | # cscope files 101 | cscope.* 102 | ncscope.* 103 | 104 | # gnu global files 105 | GPATH 106 | GRTAGS 107 | GSYMS 108 | GTAGS 109 | 110 | # id-utils files 111 | ID 112 | 113 | *.orig 114 | *~ 115 | \#*# 116 | 117 | # 118 | # Leavings from module signing 119 | # 120 | extra_certificates 121 | signing_key.pem 122 | signing_key.priv 123 | signing_key.x509 124 | x509.genkey 125 | 126 | # Kconfig presets 127 | all.config 128 | 129 | # Kdevelop4 130 | *.kdev4 131 | 132 | a.out 133 | -------------------------------------------------------------------------------- /kevinfs/Makefile: -------------------------------------------------------------------------------- 1 | ifdef M 2 | include $(M)/mkinclude 3 | else 4 | include $(PWD)/mkinclude 5 | endif 6 | 7 | obj-m += lightfs.o 8 | 9 | 10 | KBUILD_CFLAGS += -I./cheeze \ 11 | -DLIGHTFS \ 12 | -DPINK \ 13 | -DWB \ 14 | -DGROUP_COMMIT \ 15 | -DGET_MULTI \ 16 | -DRB_LOCK \ 17 | -DSUPER_NOLOCK \ 18 | -DREADA \ 19 | # -DMONITOR \ 20 | # -DIS_IN_VM \ 21 | # -DPRINT_QD \ 22 | # -DDISABLE_DCACHE \ 23 | # -DLIGHTFS_DEBUG \ 24 | # -DDATA_CHECK \ 25 | # -DCALL_TRACE \ 26 | # -DCALL_TRACE_TIME \ 27 | # -DTIME_CHECK \ 28 | # -DTXN_BUFFER \ 29 | # -DGROUP_EVICTION \ 30 | # -DTXN_TIME_CHECK \ 31 | # -DRB_CACHE \ 32 | # -DCHEEZE \ 33 | # -DEMULATION \ 34 | 35 | lightfs-y := lightfs_super.o \ 36 | lightfs_bstore.o \ 37 | lightfs_reada.o \ 38 | lightfs_txn_hdlr.o \ 39 | lightfs_io.o \ 40 | lightfs_db.o \ 41 | lightfs_db_env.o \ 42 | lightfs_cache.o \ 43 | bloomfilter.o \ 44 | lightfs_queue.o \ 45 | murmur3.o \ 46 | rbtreekv.o \ 47 | ./cheeze/queue.o \ 48 | ./cheeze/blk.o \ 49 | ./cheeze/shm.o \ 50 | lightfs_module.o \ 51 | 52 | all: 53 | make -C /lib/modules/$(KDIR)/build M=$(PWD) modules 54 | clean: 55 | make -C /lib/modules/$(KDIR)/build M=$(PWD) clean 56 | -------------------------------------------------------------------------------- /kevinfs/bloomfilter.c: -------------------------------------------------------------------------------- 1 | #include "bloomfilter.h" 2 | #include "murmur3.h" 3 | 4 | #define bit_set(v,n) ((v)[(n) >> 3] |= (0x1 << (0x7 - ((n) & 0x7)))) 5 | #define bit_get(v,n) ((v)[(n) >> 3] & (0x1 << (0x7 - ((n) & 0x7)))) 6 | #define bit_clr(v,n) ((v)[(n) >> 3] &=~(0x1 << (0x7 - ((n) & 0x7)))) 7 | 8 | void 9 | bloomfilter_init(struct bloomfilter *bloomfilter, unsigned int m, unsigned int k) 10 | { 11 | memset(bloomfilter, 0, sizeof(*bloomfilter)); 12 | bloomfilter->m = m; 13 | bloomfilter->k = k; 14 | memset(bloomfilter->bit_vector, 0, bloomfilter->m >> 3); 15 | } 16 | 17 | void 18 | bloomfilter_set(struct bloomfilter *bloomfilter, const void *key, size_t len) 19 | { 20 | uint32_t i; 21 | uint32_t h; 22 | 23 | for (i = 0; i < bloomfilter->k; i++) { 24 | murmur3_hash32(key, len, i, &h); 25 | h %= bloomfilter->m; 26 | bit_set(bloomfilter->bit_vector, h); 27 | } 28 | } 29 | 30 | int 31 | bloomfilter_get(struct bloomfilter *bloomfilter, const void *key, size_t len) 32 | { 33 | uint32_t i; 34 | uint32_t h; 35 | 36 | for (i = 0; i < bloomfilter->k; i++) { 37 | murmur3_hash32(key, len, i, &h); 38 | h %= bloomfilter->m; 39 | if (!bit_get(bloomfilter->bit_vector, h)) 40 | return 0; 41 | } 42 | return 1; 43 | } 44 | -------------------------------------------------------------------------------- /kevinfs/bloomfilter.h: -------------------------------------------------------------------------------- 1 | #ifndef __BLOOMFILTER_H__ 2 | #define __BLOOMFILTER_H__ 3 | 4 | #include "lightfs_fs.h" 5 | 6 | struct bloomfilter { 7 | unsigned int m; 8 | unsigned int k; 9 | unsigned char bit_vector[1]; 10 | }; 11 | 12 | void 13 | bloomfilter_init(struct bloomfilter *bloomfilter, unsigned int m, unsigned int k); 14 | 15 | void 16 | bloomfilter_re_init(struct bloomfilter *bloomfilter, unsigned int m, unsigned int k); 17 | 18 | void 19 | bloomfilter_set(struct bloomfilter *bloomfilter, const void *key, size_t len); 20 | 21 | int 22 | bloomfilter_get(struct bloomfilter *bloomfilter, const void *key, size_t len); 23 | 24 | 25 | #endif /* __BLOOMFILTER_H__ */ 26 | -------------------------------------------------------------------------------- /kevinfs/cheeze/blk.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | /* 3 | * Copyright (C) 2020 Park Ju Hyung 4 | */ 5 | 6 | #define pr_fmt(fmt) "cheeze: " fmt 7 | 8 | /* 9 | * XXX 10 | ** Concurrent I/O may require rwsem lock 11 | */ 12 | 13 | // #define DEBUG 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "cheeze.h" 24 | 25 | /* Globals */ 26 | struct class *cheeze_chr_class; 27 | 28 | extern char *data_addr[2]; 29 | 30 | uint64_t cheeze_prepare_io(struct cheeze_req_user *user, char sync, void *extra, bool transfer) { 31 | int id; 32 | uint64_t seq; 33 | struct cheeze_req *req; 34 | 35 | seq = cheeze_push(user); 36 | id = user->id; 37 | req = reqs + id; 38 | 39 | user->buf = get_buf_addr(data_addr, id); 40 | req->sync = sync; 41 | req->transfer = transfer; 42 | req->extra = extra; 43 | 44 | return seq; 45 | } 46 | 47 | void cheeze_free_io(int id) { 48 | cheeze_move_pop(id); 49 | } 50 | 51 | /* Serve requests from koo */ 52 | void cheeze_io(struct cheeze_req_user *user, void *(*cb)(void *data), void *extra, uint64_t seq) 53 | { 54 | int id; 55 | struct cheeze_req *req; 56 | 57 | id = user->id; 58 | 59 | req = reqs + id; 60 | 61 | send_req(req, id, seq); 62 | 63 | if (cb) { 64 | cb(extra); 65 | } 66 | 67 | if (req->sync) 68 | wait_for_completion(&req->acked); 69 | //cheeze_move_pop(id); 70 | } 71 | EXPORT_SYMBOL(cheeze_io); 72 | 73 | int cheeze_init(void) 74 | { 75 | int ret, i; 76 | 77 | /* 78 | cheeze_chr_class = class_create(THIS_MODULE, "cheeze_chr"); 79 | if (IS_ERR(cheeze_chr_class)) { 80 | ret = PTR_ERR(cheeze_chr_class); 81 | pr_warn("Failed to register class cheeze_chr\n"); 82 | goto out; 83 | } 84 | 85 | ret = cheeze_chr_init_module(); 86 | if (ret) 87 | goto destroy_chr; 88 | 89 | */ 90 | reqs = kzalloc(sizeof(struct cheeze_req) * CHEEZE_QUEUE_SIZE, GFP_KERNEL); 91 | if (reqs == NULL) { 92 | pr_err("%s %d: Unable to allocate memory for cheeze_req\n", __func__, __LINE__); 93 | ret = -ENOMEM; 94 | //goto nomem; 95 | } 96 | cheeze_queue_init(); 97 | for (i = 0; i < CHEEZE_QUEUE_SIZE; i++) 98 | init_completion(&reqs[i].acked); 99 | 100 | shm_init(); 101 | 102 | return 0; 103 | /* 104 | nomem: 105 | cheeze_chr_cleanup_module(); 106 | destroy_chr: 107 | class_destroy(cheeze_chr_class); 108 | out: 109 | */ 110 | return ret; 111 | } 112 | 113 | void cheeze_exit(void) 114 | { 115 | shm_exit(); 116 | cheeze_queue_exit(); 117 | kfree(reqs); 118 | 119 | //cheeze_chr_cleanup_module(); 120 | //class_destroy(cheeze_chr_class); 121 | } 122 | -------------------------------------------------------------------------------- /kevinfs/dummy.dev: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgist-datalab/kevin/4f46599a9b1303e0f60f9f114feb302c8d2a00dd/kevinfs/dummy.dev -------------------------------------------------------------------------------- /kevinfs/lightfs_cache.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIGHTFS_CACHE_H__ 2 | #define __LIGHTFS_CACHE_H__ 3 | 4 | #include "db.h" 5 | #include "lightfs_fs.h" 6 | #include 7 | 8 | struct dcache_entry { 9 | bool is_full; 10 | struct rb_root rb_root; 11 | spinlock_t lock; 12 | uint32_t child; 13 | uint32_t e_child; 14 | }; 15 | 16 | struct ht_lock_item { 17 | //spinlock_t lock; 18 | struct rw_semaphore lock; 19 | struct hlist_node hnode; 20 | }; 21 | 22 | struct ht_cache_item { 23 | DBT key, value; 24 | bool is_weak_del; 25 | bool is_evicted; 26 | uint32_t fp; 27 | struct hlist_node hnode; 28 | struct rb_node rb_node; 29 | struct dcache_entry *dcache; 30 | struct ht_cache_item *parent; 31 | }; 32 | 33 | struct dcache_dbc_wrap { 34 | struct ht_cache_item *node; 35 | DBT *left, *right; 36 | DBC dbc; 37 | }; 38 | 39 | int lightfs_cache_create(DB **, DB_ENV *, uint32_t); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /kevinfs/lightfs_db.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIGHTFS_DB_H__ 2 | #define __LIGHTFS_DB_H__ 3 | 4 | #include "lightfs_fs.h" 5 | 6 | int lightfs_db_create(DB **db, DB_ENV *env, uint32_t flags); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /kevinfs/lightfs_db_env.c: -------------------------------------------------------------------------------- 1 | #include "db.h" 2 | #include "lightfs_fs.h" 3 | #include "lightfs_txn_hdlr.h" 4 | #include "rbtreekv.h" 5 | 6 | int lightfs_db_env_set_cachesize (DB_ENV *env, uint32_t a, uint32_t b, int c) 7 | { 8 | return 0; 9 | } 10 | 11 | int lightfs_db_env_set_key_ops (DB_ENV *env, struct lightfs_db_key_operations *key_ops) 12 | { 13 | db_env_set_default_bt_compare(env, key_ops->keycmp); 14 | return 0; 15 | } 16 | 17 | void lightfs_db_env_set_update (DB_ENV *env, int (*update_function)(DB *, const DBT *key, const DBT *old_val, const DBT *extra, void (*set_val)(const DBT *new_val, void *set_extra), void *set_extra)) 18 | { 19 | return; 20 | } 21 | 22 | int lightfs_db_env_open (DB_ENV *env, const char *a, uint32_t b, int c) 23 | { 24 | return 0; 25 | } 26 | 27 | int lightfs_db_env_close (DB_ENV *env, uint32_t a) 28 | { 29 | lightfs_txn_hdlr_destroy(); 30 | db_env_close(env, a); 31 | kfree(env); 32 | 33 | return 0; 34 | } 35 | 36 | 37 | int lightfs_db_env_create(DB_ENV **envp, uint32_t flags) 38 | { 39 | *envp = kmalloc(sizeof(DB_ENV), GFP_NOIO); 40 | if (*envp == NULL) { 41 | return -ENOMEM; 42 | } 43 | db_env_create(envp, flags); 44 | (*envp)->set_cachesize = lightfs_db_env_set_cachesize; 45 | (*envp)->set_key_ops = lightfs_db_env_set_key_ops; 46 | (*envp)->set_update = lightfs_db_env_set_update; 47 | (*envp)->open = lightfs_db_env_open; 48 | (*envp)->close = lightfs_db_env_close; 49 | 50 | lightfs_txn_hdlr_init(); 51 | 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /kevinfs/lightfs_db_env.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIGHTFS_DB_ENV_H__ 2 | #define __LIGHTFS_DB_ENV_H__ 3 | 4 | #include "lightfs_fs.h" 5 | 6 | int lightfs_db_env_create(DB_ENV **envp, uint32_t flags); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /kevinfs/lightfs_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIGHTFS_DEBUG__ 2 | #define __LIGHTFS_DEBUG__ 3 | 4 | # define LIGHTFS_DEBUG_ON(err) 5 | 6 | static inline void lightfs_error (const char * function, const char * fmt, ...) 7 | { 8 | #ifdef LIGHTFS_DEBUG 9 | va_list args; 10 | 11 | va_start(args, fmt); 12 | printk(KERN_CRIT "lightfs error: %s: ", function); 13 | vprintk(fmt, args); 14 | printk(KERN_CRIT "\n"); 15 | va_end(args); 16 | #endif 17 | } 18 | 19 | static inline void lightfs_log(const char * function, const char * fmt, ...) 20 | { 21 | #ifdef LIGHTFS_DEBUG 22 | va_list args; 23 | va_start(args, fmt); 24 | printk(KERN_ALERT "lightfs log: %s: ", function); 25 | vprintk(fmt, args); 26 | printk(KERN_ALERT "\n"); 27 | va_end(args); 28 | #endif 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /kevinfs/lightfs_module.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lightfs_fs.h" 3 | 4 | MODULE_LICENSE("GPL"); 5 | MODULE_AUTHOR("DGIST"); 6 | MODULE_DESCRIPTION("Kevin FS"); 7 | 8 | static int __init beg_lightfs(void) 9 | { 10 | return init_lightfs_fs(); 11 | } 12 | 13 | static void __exit end_lightfs(void) 14 | { 15 | exit_lightfs_fs(); 16 | } 17 | 18 | 19 | module_init(beg_lightfs); 20 | module_exit(end_lightfs); 21 | -------------------------------------------------------------------------------- /kevinfs/lightfs_queue.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIGHTFS_QUEUE__ 2 | #define __LIGHTFS_QUEUE__ 3 | 4 | #include 5 | #include 6 | 7 | int lightfs_queue_push(struct lightfs_queue *q, void *data); 8 | void *lightfs_queue_peek(struct lightfs_queue *q); 9 | void lightfs_queue_pop(struct lightfs_queue *q, int id); 10 | void *lightfs_queue_peek_and_pop(struct lightfs_queue *q); 11 | bool lightfs_queue_is_empty(struct lightfs_queue *q); 12 | void lightfs_queue_init(struct lightfs_queue **q, int cnt); 13 | void lightfs_queue_exit(struct lightfs_queue *q); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /kevinfs/lightfs_reada.h: -------------------------------------------------------------------------------- 1 | #ifndef __READA_H__ 2 | #define __READA_H__ 3 | 4 | #include "lightfs_fs.h" 5 | 6 | struct reada_entry *lightfs_reada_alloc(struct inode *inode, uint64_t current_block_num, unsigned block_cnt); 7 | void lightfs_reada_free(struct reada_entry *ra_entry, struct inode *inode); 8 | void lightfs_reada_all_flush(struct inode *inode); 9 | void lightfs_reada_flush(struct inode *inode, int cnt); 10 | struct reada_entry *lightfs_reada_reuse(struct inode *inode, uint64_t current_block_num, unsigned block_cnt); 11 | bool lightfs_reada_need(struct inode *inode, struct lightfs_io *lightfs_io, unsigned nr_pages, bool fg_read); 12 | unsigned lightfs_reada_buffer_get(struct reada_entry *ra_entry, struct inode *inode, struct lightfs_io *lightfs_io, unsigned nr_pages); 13 | #endif 14 | -------------------------------------------------------------------------------- /kevinfs/mkinclude: -------------------------------------------------------------------------------- 1 | KDIR=$(shell uname -r) 2 | -------------------------------------------------------------------------------- /kevinfs/murmur3.c: -------------------------------------------------------------------------------- 1 | #include "murmur3.h" 2 | 3 | #define ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) 4 | 5 | uint32_t 6 | fmix32(uint32_t h) 7 | { 8 | return h; 9 | } 10 | 11 | void 12 | murmur3_hash32(const void *key, size_t len, uint32_t seed, void *out) 13 | { 14 | const uint32_t c1 = 0xcc9e2d51; 15 | const uint32_t c2 = 0x1b873593; 16 | 17 | uint32_t k1 = 0; 18 | uint32_t h1 = seed; 19 | 20 | const uint8_t *data = (const uint8_t *)key; 21 | const int nblocks = len >> 2; 22 | 23 | const uint32_t *blocks = (const uint32_t *)(data + nblocks*4); 24 | const uint8_t *tail = (const uint8_t *)(data + nblocks*4); 25 | 26 | int i; 27 | for(i = -nblocks; i; i++) { 28 | uint32_t k1 = blocks[i]; 29 | 30 | k1 *= c1; 31 | k1 = ROTL32(k1,15); 32 | k1 *= c2; 33 | 34 | h1 ^= k1; 35 | h1 = ROTL32(h1,13); 36 | h1 = h1*5+0xe6546b64; 37 | } 38 | 39 | 40 | switch(len & 3) { 41 | case 3: k1 ^= tail[2] << 16; 42 | case 2: k1 ^= tail[1] << 8; 43 | case 1: k1 ^= tail[0]; 44 | k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; 45 | }; 46 | 47 | h1 ^= len; 48 | 49 | h1 ^= h1 >> 16; 50 | h1 *= 0x85ebca6b; 51 | h1 ^= h1 >> 13; 52 | h1 *= 0xc2b2ae35; 53 | h1 ^= h1 >> 16; 54 | 55 | *(uint32_t*)out = h1; 56 | } 57 | -------------------------------------------------------------------------------- /kevinfs/murmur3.h: -------------------------------------------------------------------------------- 1 | #ifndef __H_MURMUR3_H__ 2 | #define __H_MURMUR3_H__ 3 | 4 | #include "db.h" 5 | 6 | void 7 | murmur3_hash32(const void *key, size_t len, uint32_t seed, void *out); 8 | 9 | 10 | #endif /* __H_MURMUR3_H__ */ 11 | -------------------------------------------------------------------------------- /kevinfs/rbtreekv.h: -------------------------------------------------------------------------------- 1 | #ifndef __RBTREEKV_H__ 2 | #define __RBTREEKV_H__ 3 | 4 | int db_env_set_default_bt_compare(DB_ENV *env, int (*bt_compare)(DB *, const DBT *, const DBT *)); 5 | int db_cursor(DB *db, DB_TXN *txnid, DBC **cursorp, uint32_t flags); 6 | int db_env_create(DB_ENV **envp, uint32_t flags); 7 | int db_create(DB **db, DB_ENV *env, uint32_t flags); 8 | int db_env_close(DB_ENV *env, uint32_t flag); 9 | int db_get(DB *db, DB_TXN *txnid, DBT *key, DBT *data, uint32_t flags); 10 | int db_del(DB *db, DB_TXN *txnid, DBT *key, uint32_t flags); 11 | int db_put(DB *db, DB_TXN *txnid, DBT *key, DBT *data, uint32_t flags); 12 | int db_close(DB *db, uint32_t flag); 13 | int db_update(DB *db, DB_TXN *txnid, const DBT *key, const DBT *value, loff_t offset, uint32_t flags); 14 | 15 | 16 | int db_cache_del(DB *db, DB_TXN *txnid, DBT *key, uint32_t flags); 17 | int db_cache_weak_del(DB *db, DB_TXN *txnid, DBT *key, uint32_t flags); 18 | int db_cache_get(DB *db, DB_TXN *txnid, DBT *key, DBT *value, uint32_t flags); 19 | int db_cache_put(DB *db, DB_TXN *txnid, DBT *key, DBT *value, uint32_t flags); 20 | int db_cache_close(DB *db, uint32_t flag); 21 | int db_cache_create(DB **db, DB_ENV *env, uint32_t flags); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /kevinfs/run.sh: -------------------------------------------------------------------------------- 1 | insmod ./lightfs.ko 2 | touch dummy.dev 3 | sudo losetup /dev/loop3 dummy.dev 4 | sudo mount -t lightfs /dev/loop3 $1 5 | #sudo mount -t lightfs nodev $1 6 | -------------------------------------------------------------------------------- /patches/geriatrix.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/geriatrix.cpp b/src/geriatrix.cpp 2 | index 61ab51c..7180bb3 100644 3 | --- a/src/geriatrix.cpp 4 | +++ b/src/geriatrix.cpp 5 | @@ -9,14 +9,14 @@ 6 | 7 | #include "geriatrix.h" 8 | 9 | -#ifdef NEED_POSIX_FALLOCATE 10 | /* 11 | * fake posix_fallocate by ftruncating the file larger and touching 12 | * a byte in each block.... returns 0 on success, errno on fail(!!!) 13 | * (this is at the top of the file so it can be included in the 14 | * posix driver if needed...) 15 | */ 16 | -static int posix_fallocate(int fd, off_t offset, off_t len) { 17 | +static const char zeros[4096] = { 0, }; 18 | +static int fake_fallocate(int fd, off_t offset, off_t len) { 19 | struct stat st; 20 | off_t newlen, curoff, lastoff, ptr; 21 | ssize_t rv; 22 | @@ -29,25 +29,15 @@ static int posix_fallocate(int fd, off_t offset, off_t len) { 23 | if (st.st_size > newlen) /* not growing it, assume ok */ 24 | return(0); 25 | 26 | - if (ftruncate(fd, newlen) < 0) /* grow it */ 27 | - return(errno); 28 | - 29 | - curoff = ((st.st_size + (st.st_blksize-1)) / st.st_blksize) * st.st_blksize; 30 | - lastoff = ((newlen + (st.st_blksize-1)) / st.st_blksize) * st.st_blksize; 31 | - 32 | - for (ptr = curoff ; ptr < lastoff ; ptr += st.st_blksize) { 33 | - if (lseek(fd, ptr, SEEK_SET) < 0) 34 | - return(errno); 35 | - rv = write(fd, "", 1); /* writes a null */ 36 | - if (rv < 0) 37 | - return(errno); 38 | - if (rv == 0) 39 | - return(EIO); 40 | - } 41 | + curoff = lseek(fd, 0, SEEK_CUR); 42 | + while (len > sizeof(zeros)) 43 | + len -= write(fd, zeros, sizeof(zeros)); 44 | + while (len) 45 | + len -= write(fd, zeros, len); 46 | + lseek(fd, curoff, SEEK_SET); 47 | 48 | return(0); 49 | } 50 | -#endif 51 | 52 | /* 53 | * backend configuration -- all filesystem aging I/O is routed here! 54 | @@ -55,7 +45,7 @@ static int posix_fallocate(int fd, off_t offset, off_t len) { 55 | 56 | /* posix driver (the default) */ 57 | static struct backend_driver posix_backend_driver = { 58 | - open, close, write, access, unlink, mkdir, posix_fallocate, stat, chmod, 59 | + open, close, write, access, unlink, mkdir, fake_fallocate, stat, chmod, 60 | }; 61 | 62 | #ifdef DELTAFS /* optional backend for cmu's deltafs */ 63 | --------------------------------------------------------------------------------