Linuxã«ãããTRIMã®å©ç¨ã¨ã¢ãã¿ãªã³ã°
æ¬å½ã¯CentOS 6.0ããªãªã¼ã¹ãããã®ãé¦ãé·ããã¦å¾ ã£ã¦ããã®ã§ãããå¾ ã¡ãããªãã£ãã®ã§ã¨ããããFedora 14ãã¤ã³ã¹ãã¼ã«ãã¾ãããLinuxã§TRIMãå©ç¨ããã«ã¯ãext4ãã¡ã¤ã«ã·ã¹ãã ããã¦ã³ãããéã«discardãªãã·ã§ã³ãæå®ãã¾ãã
# mount -t ext4 -o discard /dev/sda5 /mnt
Linuxã§ã¯ããããã¯ããã¤ã¹ã«ä¸è¦é åãéç¥ããæ©è½ã®ãã¨ãBlock Discardã¨å¼ãã§ãã¾ããBlock Discardã«ãã£ã¦ATAããã¤ã¹ã«ã¯TRIMã³ãã³ãããSCSIããã¤ã¹ã«ã¯UNMAPã¨ããã³ãã³ããçºè¡ããã¾ãã
ãã¦ãè¨å®ã¯ããã ããªã®ã§ãããããã§å®éã«TRIMãæ©è½ãã¦ããã®ãã©ããå°ãå¿é ã«ãªãã¾ããã¨ããã®ããTRIMã«ã¤ãã¦ã¯ãã°ãªã©ãä½ãåºåãããªãããã§ãã
ããã§ãSystemTapãç¨ãã¦Block Discardã®æ§åãã¢ãã¿ãªã³ã°ããã¹ã¯ãªãããä½ã£ã¦ã¿ã¾ãããSystemTapã«ã¤ãã¦ã¯æ¨å¹´ã®ã¨ã³ããªã§ãåãæ±ã£ã¦ãã¾ãã®ã§ããã¡ããæ¯éã覧ãã ããã
- SystemTapã§MySQLã®Disk I/Oãåæãã - SH2ã®æ¥è¨
以ä¸ã®ã¹ã¯ãªãããdiscard.stpã¨ããååã§ä¿åãã¾ãã
probe kernel.function("blkdev_issue_discard").return { printf("%s, sector=%d, nr_sects=%d, return=%d (%d - %d KiB)\n", execname(), $sector, $nr_sects, $return, $sector / 2, ($sector $nr_sects) / 2 - 1);} stapã³ãã³ãã§SystemTapãèµ·åãã¾ãã
# stap discard.stp
å¥ã®ã¿ã¼ããã«ã§ã大ããªãã¡ã¤ã«ãä½ã£ã¦ããåé¤ãã¦ã¿ã¾ãã
# dd if=/dev/zero of=temp.dat bs=8388608 count=128 oflag=direct128 0 records in128 0 records out1073741824 bytes (1.1 GB) copied, 9.1373 s, 118 MB/s# rm temp.dat rm: remove é常ãã¡ã¤ã« `temp.dat'? y
ããã¨ãæ°ç§çµã£ã¦ãã以ä¸ã®ãããªãã°ãåºåããã¾ããã
jbd2/sda5-8, sector=5767168, nr_sects=16392, return=0 (2883584 - 2891779 KiB)jbd2/sda5-8, sector=4718592, nr_sects=262144, return=0 (2359296 - 2490367 KiB)jbd2/sda5-8, sector=4980736, nr_sects=262144, return=0 (2490368 - 2621439 KiB)jbd2/sda5-8, sector=5242880, nr_sects=262144, return=0 (2621440 - 2752511 KiB)jbd2/sda5-8, sector=5505024, nr_sects=262144, return=0 (2752512 - 2883583 KiB)jbd2/sda5-8, sector=6029312, nr_sects=262144, return=0 (3014656 - 3145727 KiB)jbd2/sda5-8, sector=5799936, nr_sects=229376, return=0 (2899968 - 3014655 KiB)jbd2/sda5-8, sector=6291456, nr_sects=262144, return=0 (3145728 - 3276799 KiB)jbd2/sda5-8, sector=6815744, nr_sects=32768, return=0 (3407872 - 3424255 KiB)jbd2/sda5-8, sector=6569984, nr_sects=245760, return=0 (3284992 - 3407871 KiB)
å·¦ãããããã»ã¹åãTRIMéå§ã»ã¯ã¿ãã»ã¯ã¿æ°ãæ»ãå¤ãæ¬å¼§å ã¯TRIM対象ç¯å²ãKiBåä½ã«æç®ããå¤ã§ããjbd2ã¨ããã®ã¯ãã¡ã¤ã«ã·ã¹ãã ã«ã¸ã£ã¼ããªã³ã°æ©è½ãä»å ããJournaling Block Deviceã¢ã¸ã¥ã¼ã«ã®ext4対å¿çã§ããè¦ãã¨ã確ãã«åè¨1GiBã®é åãTRIMããã¦ãããã¨ããä¸åº¦ã«TRIMãããé åãæå¤§128MiBã§ãããã¨ãªã©ãåããã¾ãã
TRIMã³ãã³ãããã¡ã¤ã«åé¤ããå°ãé ãã¦å®è¡ãããã®ã¯ãã³ãã³ãããããã¡ãªã³ã°ããã¦ã¾ã¨ãã¦å®è¡ãããããã«è¨è¨ããã¦ããããã¨èãããã¾ããï¼ä½ãã -o syncããã峿å®è¡ãããï¼ãã®ãããã®äºæ ã¯Linux Kernel Watchã«è©³ããã§ãã
ã¾ããFedora 14ã§ã¯ãã¡ã¤ã«ã·ã¹ãã æ§ç¯æã«ãTRIMãçºè¡ããã¾ãã
# mkfs -t ext4 /dev/sda5mke2fs 1.41.12 (17-May-2010)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks524288 inodes, 2097152 blocks104857 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=214748364864 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632Writing inode tables: done Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 25 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
ãã®ã¨ãSystemTapã®åºåã¯ä»¥ä¸ã®ããã«ãªããä¸åº¦ã«ããã¤ã¹ã®å ¨é åãTRIMãã¦ãããã¨ãè¦ã¦ã¨ãã¾ãã
mkfs.ext4, sector=0, nr_sects=16777216, return=0 (0 - 8388607 KiB)
䏿¹ãHDDãªã©TRIMã«å¯¾å¿ãã¦ããªãããã¤ã¹ã§ã¯ãæ»ãå¤ã¨ãã¦-95ãè¿ããã¾ããããã¯EOPNOTSUPPããOperation not supported on transport endpointãã¨ããã¨ã©ã¼ã表ãã¦ãã¾ãã
jbd2/sdb5-8, sector=1312776, nr_sects=8, return=-95 (656388 - 656391 KiB)jbd2/sdb5-8, sector=270336, nr_sects=245760, return=-95 (135168 - 258047 KiB)jbd2/sdb5-8, sector=524288, nr_sects=262144, return=-95 (262144 - 393215 KiB)jbd2/sdb5-8, sector=1048576, nr_sects=262144, return=-95 (524288 - 655359 KiB)jbd2/sdb5-8, sector=802816, nr_sects=245760, return=-95 (401408 - 524287 KiB)jbd2/sdb5-8, sector=1572864, nr_sects=262144, return=-95 (786432 - 917503 KiB)jbd2/sdb5-8, sector=1327104, nr_sects=245760, return=-95 (663552 - 786431 KiB)jbd2/sdb5-8, sector=2097152, nr_sects=262144, return=-95 (1048576 - 1179647 KiB)jbd2/sdb5-8, sector=1851392, nr_sects=245760, return=-95 (925696 - 1048575 KiB)jbd2/sdb5-8, sector=2375680, nr_sects=65536, return=-95 (1187840 - 1220607 KiB)
ãããã«
Linuxã«ãããSSDã®TRIM対å¿ã¯Windowsã«æ¯ã¹ã¦å°ãé ãã¦ãããããããã¾ã§SSDã®å°å ¥ã«èºèºãã¦ããã®ã§ãããããããæ¡ä»¶ãæ´ã£ã¦ãã¾ãããã¡ããã©Intelããæ°ããCPUãçºå£²ããããã¨ã§ãããSandy Bridgeï¼RHEL 6.0/Ubuntu 10.10ï¼ææ°SSDã¸ã¨ç°å¢ãå·æ°ãã絶好ã®ã¿ã¤ãã³ã°ããããã¾ããã
Linuxã§ã®SSDå©ç¨ã«ã¤ãã¦ã¯ããå°ã調ã¹ã¦ããã®ã§ãæ å ±ãã¾ã¨ã¾ã£ããå度ã¬ãã¼ããããã¨æãã¾ãã
—
SSDに対するBlock Discard/TRIMをSystemTapで可視化する - SH2の日記
ext4ファイルシステムをマウントする際にdiscardオプションを指定する事が大事なようですね。
(via kens-notepad)(via kens-notepad)
Tumbl Young Man Tumbl: In Which I Rap Battle @ajpiano »
Wilto
But let’s stop this—try a topic with less awfulness.
It’s @Wilto from Twitter, threatnin’ to punch your esophagus.
Arguing semantics and trollin’ on all the haters.
Droppin’ the dopest stylistics—all of the rest r alligators.
[OH!]
Oh snao™.
Thought that I was finished? I’m back;…
But it’s hard to stay mad when there’s so much beauty in the world. Sometimes I feel like I’m seeing it all at once and it’s too much. My heart fills up like a balloon that’s about to burst. And then I remember to relax, and stop trying to hold on to it, and then it flows through me like rain and I can’t feel anything but gratitude for every single moment of my stupid little life.”
— American Beauty (via roscoe-)
(Source: jen-romero, via whiteblank)
The Trans-Siberian Railway
I rode this once before in 2006. I
Who Really Owns The NYPD? »
It’s called the Paid Detail Unit and it allows the New York Stock Exchange and Wall Street corporations, including those repeatedly charged with crimes, to order up a flank of New York’s finest with the ease of dialing the deli for a pastrami on rye.
The corporations pay an average of $37 an hour (no medical, no pension benefit, no overtime pay) for a member of the NYPD, with gun, handcuffs and the ability to arrest. The officer is indemnified by the taxpayer, not the corporation.
New York City gets a 10 percent administrative fee on top of the $37 per hour paid to the police. The City’s 2011 budget called for $1,184,000 in Paid Detail fees, meaning private corporations were paying wages of $11.8 million to police participating in the Paid Detail Unit. The program has more than doubled in revenue to the city since 2002.
The taxpayer has paid for the training of the rent-a-cop, his uniform and gun, and will pick up the legal tab for lawsuits stemming from the police personnel following illegal instructions from its corporate master. Lawsuits have already sprung up from the program.
Holy shit. That
(Source: jen-romero)




