Skip to content

Instantly share code, notes, and snippets.

View IUSR's full-sized avatar

Jerome Jia IUSR

View GitHub Profile
--- a/block/blk-throttle.c 2016-08-09 15:48:03.242986929 +0800
+++ b/block/blk-throttle.c 2016-08-09 15:53:33.060446303 +0800
@@ -735,7 +735,8 @@
}
/* Calc approx time to dispatch */
- extra_bytes = tg->bytes_disp[rw] + bio->bi_iter.bi_size - bytes_allowed;
+ /* fcicq: iops limit not checked and allow smaller request, use the correct wait time here */
+ extra_bytes = tg->bytes_disp[rw] + max(bio->bi_iter.bi_size, 32768U) - bytes_allowed;
jiffy_wait = div64_u64(extra_bytes * HZ, tg->bps[rw]);
@fcicq
fcicq / namecoin-19200.txt
Last active December 15, 2015 23:49
structure of a merged mining block, see also http://dot-bit.org/forum/viewtopic.php?f=7&t=368 and https://en.bitcoin.it/wiki/Merged_mining_specification. to get hexencoded: sed -e 's/(.*//' -e 's/00000...//' -e 's/ //g' -e '/^$/d' namecoin-19200.txt
00000000 f9 be b4 fe (magic bytes of namecoin)
a6 02 00 00 (message hash)
(namecoin block, merged)
01 01 01 00 (version)
36 90 9a c0
00000010 7a 16 73 da f6 5f a7 d8 28 88 2e 66 c9 e8 9f 85
00000020 46 cd d5 0a 9f b1 00 00 00 00 00 00 (prev block)
0f 5c 65 49
00000030 bc d6 08 ab 7c 4e ac 59 3e 5b d5 a7 3b 2d 43 2e
00000040 b6 35 18 70 8f 77 8f c7 dc df af 88 (merkle root)
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@rednaxelafx
rednaxelafx / JDK5u22_client.log
Created August 23, 2011 16:43
PrintCompilation samples running Groovy shell 1.7.7 on different versions of HotSpot VM
1 b java.lang.String::charAt (33 bytes)
2 b java.lang.Math::max (11 bytes)
3 b java.util.jar.Manifest$FastInputStream::readLine (167 bytes)
4 b sun.nio.cs.UTF_8$Decoder::decodeArrayLoop (553 bytes)
5 b java.util.Properties$LineReader::readLine (383 bytes)
6 b java.lang.String::hashCode (60 bytes)
7 b java.lang.String::indexOf (151 bytes)
8 b sun.nio.cs.ext.DoubleByteDecoder::decodeSingle (10 bytes)
9 b java.lang.String::lastIndexOf (156 bytes)
10 b java.lang.String::replace (142 bytes)