I''m currently working on a hybrid approach which dynamically switches
between first-fit to best-fit and vice-versa. With this new allocator
you could choose to always do best-fit if your workload requires
something like that. You should see this in Opensolaris in the next month.
Thanks,
George
Jeff Bonwick wrote:> Yes.
>
> The ZFS block allocator has three independent layers: device selection,
> metaslab selection (within the chosen device), and block selection
> (within the chosen metaslab).
>
> Device selection is currently round-robin to provide dynamic striping,
> with weighting for load balance. Many other policies are possible.
>
> Metaslab selection is based on the metaslab''s weight, as computed
by
> metaslab_weight(). This considers the recording zone, locality, and
> other factors. Again, the weight function could literally be anything.
>
> Finally, block selection is determined by the space map ops vector.
> We currently have just one (a modified first-fit allocator), but we
> have a couple of new ones in the works. It should be straightforward
> to test-drive your own using metaslab_ff_alloc() as an example.
> (The current first-fit allocator is just 70 lines of code.)
>
> Jeff
>
> On Mon, Mar 23, 2009 at 01:25:12PM -0700, David Dew wrote:
>
>> Hello, looking to see if it is possible to change the allocation
strategy to a "best-fit" or "fill, spill" model. In looking
into the current code and blog entries, there seems to have been some of this
flexibility in mind. My current thoughts are this should be attempted in
metaslab.c in the metaslab_alloc_dva function, but curious if anyone else has
attempted this.
>>
>> Thanks
>> --
>> This message posted from opensolaris.org
>> _______________________________________________
>> zfs-code mailing list
>> zfs-code at opensolaris.org
>> http://mail.opensolaris.org/mailman/listinfo/zfs-code
>>
> _______________________________________________
> zfs-code mailing list
> zfs-code at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-code
>