Skip to contentSkip to conversation

What represent 646345728 bytes

DISCUSSION [email protected] 3 participants 4 messages Feb 1, 2010

lore
Share & tools
lore
#0 lore raw

Thank you Eric for your reply.

My problem with preallocation is that i don't know the size of my final tar archive. So i would prefer to don't make any supposition.

Yes, i write a stream of 640x480x1 pnm images (307215 bytes each) to a single tar file. So lets say that each write is 307712 (divisible by 512 bytes for tar).

Here is a test bench program that reproduce the behaviour of the real app.

The program log some write overhead at 645579776bytes and other at 645887488bytes, so not exactly the same thing as in the real app.

You will be able to tell me if my test bench is correct (metric, compilation options, etc.).

The system on which i run the test bench has no other workload, no other disk access.

Please find the attached files :
- test bench source
- the dumpe2fs log

Tonight, i will try with the "-O ^uninit_bg at mkfs time".

Thanks.

Paul.

dumpe2fs 1.41.9 (22-Aug-2009)

Filesystem volume name:   DATA
Last mounted on:          /var/data
Filesystem UUID:          7b19bf38-cf32-11de-a163-0060c2140392
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         not clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              3670016
Block count:              14653288
Reserved block count:     732664
Free blocks:              11828118
Free inodes:              3669685
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1020
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Thu Nov 12 02:24:18 2009
Last mount time:          Thu Nov 12 02:26:17 2009
Last write time:          Thu Nov 12 06:05:46 2009
Mount count:              1
Maximum mount count:      30
Last checked:             Thu Nov 12 02:24:18 2009
Check interval:           15552000 (6 months)
Next check after:         Tue May 11 02:24:18 2010
Lifetime writes:          11 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Default directory hash:   half_md4
Directory Hash Seed:      7b19c00a-cf32-11de-a163-0060c2140392
#1 lore raw
Quoted 9 lines · [email protected] wrote:

Thank you Eric for your reply.

My problem with preallocation is that i don't know the size of my final tar archive. So i would prefer to don't make any supposition.

Yes, i write a stream of 640x480x1 pnm images (307215 bytes each) to a single tar file. So lets say that each write is 307712 (divisible by 512 bytes for tar).

Quoted 8 lines

Here is a test bench program that reproduce the behaviour of the real app.

The program log some write overhead at 645579776bytes and other at 645887488bytes, so not exactly the same thing as in the real app.

You will be able to tell me if my test bench is correct (metric, compilation options, etc.).

I changed the test for an abnormally long write to printf if the current time is more than twice the average; the hardcoded time didn't trip on my run (faster disk?)

uninit_bg

size 480338432 time 10170277 avg 1533119 size 661580800 time 6651861 avg 1559238 size 1025296384 time 16295994 avg 1585389 size 1206538752 time 5157166 avg 1591501 size 1388704256 time 10096621 avg 1596869 size 1570562048 time 6523130 avg 1600365 size 1752727552 time 11047298 avg 1603791 size 1935200768 time 7421506 avg 1606132 size 1963202560 time 13636110 avg 1608181 size 2116750848 time 4634594 avg 1609417 size 2299224064 time 17226228 avg 1612249 diff min : 1468219
diff moy : 1612779
diff max : 17226228
8035 iterations

^uninit_bg

size  125854208 time 11192339 avg 1531071
size  480646144 time  8405476 avg 1537763 *
size  662196224 time  5187685 avg 1562247 *
size  843746304 time 10184477 avg 1577636

size 1025911808 time 15772404 avg 1589258 * size 1207154176 time 3354220 avg 1594480 * size 1389011968 time 17024332 avg 1601196 * size 1570562048 time 5321635 avg 1604032 * size 1752727552 time 10858699 avg 1607154 * size 1934585344 time 6316573 avg 1609076 * size 1963202560 time 12102167 avg 1610854 *

size 1963510272 time  9019437 avg 1612015 *
size 2116135424 time  3464465 avg 1612853 *
size 2297993216 time  8579660 avg 1614396 *

diff min : 1469909
diff moy : 1614416
diff max : 17024332
7493 iterations

* = roughly same offset as with uninit_bg

So uninit_bg doesn't seem to help. (this was on 2.6.32-ish)

some oprofiling may be in order ...

-Eric

Quoted 14 lines

The system on which i run the test bench has no other workload, no other disk access.

Please find the attached files : - test bench source - the dumpe2fs log

Tonight, i will try with the "-O ^uninit_bg at mkfs time".

Thanks.

Paul.

#2 lore raw
Quoted 3 lines · Eric Sandeen

So uninit_bg doesn't seem to help. (this was on 2.6.32-ish)

some oprofiling may be in order ...

Or stapping ... thanks to hints from the stap guys, using a modified version of
http://sourceware.org/systemtap/examples/profiling/fntimes.stp
I printed out function times higher than avg and correlated to writes above average from the testcase (cleaned up manually a bit):

1265062212927230 function ext4_mb_load_buddy well over average time (42303 vs 2) 1265062212927399 function ext4_mb_regular_allocator well over average time (42476 vs 5495) 1265062212949252 function ext4_mb_mark_diskspace_used well over average time (21739 vs 196) 1265062212949306 function ext4_mb_new_blocks well over average time (64738 vs 2457) 1265062212949647 function ext4_ext_get_blocks well over average time (65211 vs 1106) 1265062212949678 function ext4_get_blocks well over average time (65357 vs 1844) 1265062212949695 function ext4_get_block well over average time (65479 vs 683) 1265062212951284 function ext4_ind_direct_IO well over average time (68891 vs 3034) 1265062212951299 function ext4_direct_IO well over average time (68908 vs 3046) 1265062212951497 function ext4_file_write well over average time (69437 vs 3590)

1265062212951534 size 134470144 time 69477310 avg 3601820

Unfortunately under ext4_mb_load_buddy is a lot of static/inlined functions so no more detailed info yet.

But loading the buddy bitmap for a new group seems to be the big hitter here - I'll keep digging, or maybe Aneesh, who groks mballoc better than I do (I think) might have an idea.

But yeah, writes randomly taking 20x longer than usual sounds bad. :(

-Eric

#3 lore raw
Quoted 21 lines · Eric Sandeen

Eric Sandeen wrote:
So uninit_bg doesn't seem to help. (this was on 2.6.32-ish)

Quoted 2 lines

some oprofiling may be in order ...

Or stapping ... thanks to hints from the stap guys, using a modified version of
http://sourceware.org/systemtap/examples/profiling/fntimes.stp
I printed out function times higher than avg and correlated to writes above average from the testcase (cleaned up manually a bit):

1265062212927230 function ext4_mb_load_buddy well over average time (42303 vs 2) 1265062212927399 function ext4_mb_regular_allocator well over average time (42476 vs 5495) 1265062212949252 function ext4_mb_mark_diskspace_used well over average time (21739 vs 196) 1265062212949306 function ext4_mb_new_blocks well over average time (64738 vs 2457) 1265062212949647 function ext4_ext_get_blocks well over average time (65211 vs 1106) 1265062212949678 function ext4_get_blocks well over average time (65357 vs 1844) 1265062212949695 function ext4_get_block well over average time (65479 vs 683) 1265062212951284 function ext4_ind_direct_IO well over average time (68891 vs 3034) 1265062212951299 function ext4_direct_IO well over average time (68908 vs 3046) 1265062212951497 function ext4_file_write well over average time (69437 vs 3590)

Quoted 8 lines

1265062212951534 size 134470144 time 69477310 avg 3601820

Unfortunately under ext4_mb_load_buddy is a lot of static/inlined functions so no more detailed info yet.

But loading the buddy bitmap for a new group seems to be the big hitter here - I'll keep digging, or maybe Aneesh, who groks mballoc better than I do (I think) might have an idea.

Since these are on-demand loads, one option is when the current group is ~80% full submit an async read for the next group bitmap so that it will be in memory by the next time we need it.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.