On Mon, Jun 16, 2014 at 10:46 AM, Haomai Wang <haomaiwang@xxxxxxxxx> wrote: > Hi, > > Now librbd is the only user for set_alloc_hint op. > > void AioWrite::add_write_ops(librados::ObjectWriteOperation &wr) { > wr.set_alloc_hint(m_ictx->get_object_size(), m_ictx->get_object_size()); > wr.write(m_object_off, m_write_data); > } > > According above, the arguments for set_alloc_hint both are the size of > a object. It looks like there exist a misleading of the argument name > called "expected_write_size". And I would like to think > "expected_write_size" as the write size for most write ops. > > KeyValueStore in recent commits use "expected_write_size" as strip > size, unfortunately librbd will issue set_alloc_hint(4MB, 4MB) but > each write op's size is serval KB. > > I'm not sure "expected_object_size" and "expected_write_size" for > set_alloc_hint are properly used by librbd or maybe I misunderdstand > the op. The idea was to have set_alloc_hint to be a one-shot op, but for rbd this turned out to be impossible due to the fact that rbd does not maintain any sort of object map. (I'm hoping this will change after the upcoming CDS ;) Now, expected_write_size is indeed supposed to be something close to the average or expected size of rbd writes, but, currently there is no interface for the user to convey that information and we don't do any tracking ourselves. Given that, and in combination with filestore_max_alloc_hint_size, setting both expected_object_size and expected_write_size to object_size seemed like a good idea. > > As for FileStore, if use XFS, set_alloc_hint will let FS allocate in > multiples of the hint size for this file. And some users may use 16MB > as the order of librbd image(like me :-| ), so it seemed a little > space ineffective. You can cap the hint with with filestore_max_alloc_hint_size config option. Thanks, Ilya -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html