File tree Expand file tree Collapse file tree 4 files changed +21
-6
lines changed Expand file tree Collapse file tree 4 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -7454,9 +7454,10 @@ arc_state_multilist_index_func(multilist_t *ml, void *obj)
7454
7454
* Also, the low order bits of the hash value are thought to be
7455
7455
* distributed evenly. Otherwise, in the case that the multilist
7456
7456
* has a power of two number of sublists, each sublists' usage
7457
- * would not be evenly distributed.
7457
+ * would not be evenly distributed. In this context full 64bit
7458
+ * division would be a waste of time, so limit it to 32 bits.
7458
7459
*/
7459
- return (buf_hash (hdr -> b_spa , & hdr -> b_dva , hdr -> b_birth ) %
7460
+ return (( unsigned int ) buf_hash (hdr -> b_spa , & hdr -> b_dva , hdr -> b_birth ) %
7460
7461
multilist_get_num_sublists (ml ));
7461
7462
}
7462
7463
Original file line number Diff line number Diff line change @@ -622,9 +622,10 @@ dbuf_cache_multilist_index_func(multilist_t *ml, void *obj)
622
622
* Also, the low order bits of the hash value are thought to be
623
623
* distributed evenly. Otherwise, in the case that the multilist
624
624
* has a power of two number of sublists, each sublists' usage
625
- * would not be evenly distributed.
625
+ * would not be evenly distributed. In this context full 64bit
626
+ * division would be a waste of time, so limit it to 32 bits.
626
627
*/
627
- return (dbuf_hash (db -> db_objset , db -> db .db_object ,
628
+ return (( unsigned int ) dbuf_hash (db -> db_objset , db -> db .db_object ,
628
629
db -> db_level , db -> db_blkid ) %
629
630
multilist_get_num_sublists (ml ));
630
631
}
Original file line number Diff line number Diff line change @@ -399,7 +399,15 @@ static unsigned int
399
399
dnode_multilist_index_func (multilist_t * ml , void * obj )
400
400
{
401
401
dnode_t * dn = obj ;
402
- return (dnode_hash (dn -> dn_objset , dn -> dn_object ) %
402
+
403
+ /*
404
+ * The low order bits of the hash value are thought to be
405
+ * distributed evenly. Otherwise, in the case that the multilist
406
+ * has a power of two number of sublists, each sublists' usage
407
+ * would not be evenly distributed. In this context full 64bit
408
+ * division would be a waste of time, so limit it to 32 bits.
409
+ */
410
+ return ((unsigned int )dnode_hash (dn -> dn_objset , dn -> dn_object ) %
403
411
multilist_get_num_sublists (ml ));
404
412
}
405
413
Original file line number Diff line number Diff line change @@ -1874,7 +1874,12 @@ static unsigned int
1874
1874
metaslab_idx_func (multilist_t * ml , void * arg )
1875
1875
{
1876
1876
metaslab_t * msp = arg ;
1877
- return (msp -> ms_id % multilist_get_num_sublists (ml ));
1877
+
1878
+ /*
1879
+ * ms_id values are allocated sequentially, so full 64bit
1880
+ * division would be a waste of time, so limit it to 32 bits.
1881
+ */
1882
+ return ((unsigned int )msp -> ms_id % multilist_get_num_sublists (ml ));
1878
1883
}
1879
1884
1880
1885
uint64_t
You can’t perform that action at this time.
0 commit comments