Re: Distributed storage.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daniel Phillips
Date: Sunday, August 12, 2007 - 4:36 pm

On Tuesday 07 August 2007 13:55, Jens Axboe wrote:

Sixteen bits in bi_rw are consumed by queue priority.  Is there a reason 
this lives in struct bio instead of struct request?


Virtual merging is only needed at the physical device, so why do these 
fields live in struct bio instead of struct request?


Right, that is done by bi_vcnt.  I meant bi_max_vecs, which you can 
derive efficiently from BIO_POOL_IDX() provided the bio was allocated 
in the standard way.  This leaves a little bit of clean up to do for 
bios not allocated from a standard pool.

Incidentally, why does the bvl need to be memset to zero on allocation?  
bi_vcnt already tells you which bvecs are valid and the only field in a 
bvec that can reasonably default to zero is the offset, which ought to 
be set set every time a bvec is initialized anyway.


Struct request has a remaining submission sector count so what does 
bi_idx do that is different?


Average struct bio memory footprint ranks near the bottom of the list of 
things that suck most about Linux storage.  At idle I see 8K in use 
(reserves); during updatedb it spikes occasionally to 50K; under a 
heavy  load generated by ddsnap on a storage box it sometimes goes to 
100K with bio throttling in place.  Really not moving the needle.

On the other hand, vm writeout deadlock ranks smack dab at the top of 
the list, so that is where the patching effort must go for the 
forseeable future.  Without bio throttling, the ddsnap load can go to 
24 MB for struct bio alone.  That definitely moves the needle.  in 
short, we save 3,200 times more memory by putting decent throttling in 
place than by saving an int in struct bio.

That said, I did a little analysis to get an idea of where the soft 
targets are in struct bio, and to get to know the bio layer a little 
better.  Maybe these few hints will get somebody interested enough to 
look further.


Which costs very little, probably less than trashing an extra field's 
worth of cache.


You did not comment on the one about putting the bio destructor in 
the ->endio handler, which looks dead simple.  The majority of cases 
just use the default endio handler and the default destructor.  Of the 
remaining cases, where a specialized destructor is needed, typically a 
specialized endio handler is too, so combining is free.  There are few 
if any cases where a new specialized endio handler would need to be 
written.

As far as code stability goes, current kernels are horribly unstable in 
a variety of contexts because of memory deadlock and slowdowns related 
to the attempt to fix the problem via dirty memory limits.  Accurate 
throttling of bio traffic is one of the two key requirements to fix 
this instability, the other other is accurate writeout path reserve 
management, which is only partially addressed by BIO_POOL.

Nice to see you jumping in Jens.  Now it is over to the other side of 
the thread where Evgeniy has posted a patch that a) grants your wish to 
add no new field in struct bio and b) does not fix the problem.

Regards,

Daniel
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Distributed storage., Evgeniy Polyakov, (Tue Jul 31, 10:13 am)
Re: Distributed storage., Daniel Phillips, (Thu Aug 2, 2:08 pm)
Re: Distributed storage., Mike Snitzer, (Thu Aug 2, 9:09 pm)
Re: Distributed storage., Manu Abraham, (Thu Aug 2, 10:04 pm)
Re: Distributed storage., Evgeniy Polyakov, (Fri Aug 3, 3:26 am)
Re: Distributed storage., Evgeniy Polyakov, (Fri Aug 3, 3:42 am)
Re: Distributed storage., Evgeniy Polyakov, (Fri Aug 3, 3:44 am)
Re: Distributed storage., Evgeniy Polyakov, (Fri Aug 3, 3:57 am)
Re: Distributed storage., Peter Zijlstra, (Fri Aug 3, 5:27 am)
Re: Distributed storage., Evgeniy Polyakov, (Fri Aug 3, 6:49 am)
Re: Distributed storage., Peter Zijlstra, (Fri Aug 3, 7:53 am)
Re: Distributed storage., Daniel Phillips, (Fri Aug 3, 12:41 pm)
Re: Distributed storage., Daniel Phillips, (Fri Aug 3, 12:48 pm)
Re: Distributed storage., Daniel Phillips, (Fri Aug 3, 5:41 pm)
Re: Distributed storage., Daniel Phillips, (Fri Aug 3, 5:49 pm)
Re: Distributed storage., Daniel Phillips, (Fri Aug 3, 6:19 pm)
Re: Distributed storage., Dave Dillow, (Fri Aug 3, 7:51 pm)
Re: Distributed storage., Manu Abraham, (Fri Aug 3, 8:44 pm)
Re: Distributed storage., Evgeniy Polyakov, (Sat Aug 4, 9:37 am)
Re: Distributed storage., Evgeniy Polyakov, (Sat Aug 4, 9:44 am)
Re: Distributed storage., Evgeniy Polyakov, (Sat Aug 4, 10:03 am)
Re: Distributed storage., Daniel Phillips, (Sun Aug 5, 1:04 am)
Re: Distributed storage., Daniel Phillips, (Sun Aug 5, 1:06 am)
Re: Distributed storage., Evgeniy Polyakov, (Sun Aug 5, 8:01 am)
Re: Distributed storage., Evgeniy Polyakov, (Sun Aug 5, 8:08 am)
Re: Distributed storage., Daniel Phillips, (Sun Aug 5, 2:23 pm)
Re: Distributed storage., Daniel Phillips, (Sun Aug 5, 2:35 pm)
Re: Distributed storage., Evgeniy Polyakov, (Mon Aug 6, 1:25 am)
Re: Distributed storage., Evgeniy Polyakov, (Mon Aug 6, 1:28 am)
Re: Distributed storage., Jens Axboe, (Tue Aug 7, 5:05 am)
Re: Distributed storage., Daniel Phillips, (Tue Aug 7, 11:24 am)
Re: Distributed storage., Jens Axboe, (Tue Aug 7, 1:55 pm)
Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Wed Aug 8, 2:54 am)
[1/1] Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Wed Aug 8, 3:17 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Wed Aug 8, 6:28 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Daniel Phillips, (Sun Aug 12, 4:16 pm)
Re: Distributed storage., Daniel Phillips, (Sun Aug 12, 4:36 pm)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Sun Aug 12, 10:22 pm)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Sun Aug 12, 10:36 pm)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Sun Aug 12, 11:44 pm)
Re: Distributed storage., Jens Axboe, (Mon Aug 13, 12:28 am)
Re: Distributed storage., Jens Axboe, (Mon Aug 13, 12:45 am)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Mon Aug 13, 1:14 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Mon Aug 13, 1:18 am)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Mon Aug 13, 1:23 am)
Re: Distributed storage., Daniel Phillips, (Mon Aug 13, 1:59 am)
Re: Distributed storage., Daniel Phillips, (Mon Aug 13, 2:08 am)
Re: Distributed storage., Jens Axboe, (Mon Aug 13, 2:12 am)
Re: Distributed storage., Jens Axboe, (Mon Aug 13, 2:13 am)
Re: Distributed storage., Evgeniy Polyakov, (Mon Aug 13, 2:18 am)
Re: Distributed storage., Daniel Phillips, (Mon Aug 13, 2:55 am)
Re: Distributed storage., Jens Axboe, (Mon Aug 13, 3:06 am)
Re: Distributed storage., Daniel Phillips, (Mon Aug 13, 3:12 am)
Re: Distributed storage., Daniel Phillips, (Mon Aug 13, 3:15 am)
Re: Distributed storage., Jens Axboe, (Mon Aug 13, 3:22 am)
Re: Distributed storage., Daniel Phillips, (Mon Aug 13, 3:32 am)
Re: Distributed storage., Evgeniy Polyakov, (Mon Aug 13, 4:03 am)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Mon Aug 13, 4:04 am)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Mon Aug 13, 4:18 am)
Re: Distributed storage., Daniel Phillips, (Mon Aug 13, 4:45 am)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Mon Aug 13, 5:04 am)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Mon Aug 13, 5:18 am)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Mon Aug 13, 5:18 am)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Mon Aug 13, 5:24 am)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Mon Aug 13, 6:04 am)
Re: Distributed storage., Daniel Phillips, (Mon Aug 13, 4:27 pm)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Tue Aug 14, 1:46 am)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Tue Aug 14, 4:13 am)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Tue Aug 14, 4:30 am)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Tue Aug 14, 4:35 am)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Tue Aug 14, 4:50 am)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Tue Aug 14, 5:32 am)
Re: Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Tue Aug 14, 5:46 am)
Re: Block device throttling [Re: Distributed storage.], Daniel Phillips, (Tue Aug 14, 5:54 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Daniel Phillips, (Mon Aug 27, 2:57 pm)
Re: [1/1] Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Tue Aug 28, 2:35 am)
Re: Distributed storage., Evgeniy Polyakov, (Tue Aug 28, 10:19 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Daniel Phillips, (Tue Aug 28, 10:27 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Tue Aug 28, 10:54 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Daniel Phillips, (Tue Aug 28, 2:08 pm)
Re: [1/1] Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Wed Aug 29, 1:53 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Daniel Phillips, (Thu Aug 30, 4:20 pm)
Re: [1/1] Block device throttling [Re: Distributed storage.], Evgeniy Polyakov, (Fri Aug 31, 10:33 am)
Re: [1/1] Block device throttling [Re: Distributed storage.], Alasdair G Kergon, (Fri Aug 31, 2:41 pm)