@@ -4625,6 +4625,8 @@ static void wqattrs_clear_for_pool(struct workqueue_attrs *attrs)
4625
4625
{
4626
4626
attrs -> affn_scope = WQ_AFFN_NR_TYPES ;
4627
4627
attrs -> ordered = false;
4628
+ if (attrs -> affn_strict )
4629
+ cpumask_copy (attrs -> cpumask , cpu_possible_mask );
4628
4630
}
4629
4631
4630
4632
/* hash value of the content of @attr */
@@ -4633,11 +4635,12 @@ static u32 wqattrs_hash(const struct workqueue_attrs *attrs)
4633
4635
u32 hash = 0 ;
4634
4636
4635
4637
hash = jhash_1word (attrs -> nice , hash );
4636
- hash = jhash (cpumask_bits (attrs -> cpumask ),
4637
- BITS_TO_LONGS (nr_cpumask_bits ) * sizeof (long ), hash );
4638
+ hash = jhash_1word (attrs -> affn_strict , hash );
4638
4639
hash = jhash (cpumask_bits (attrs -> __pod_cpumask ),
4639
4640
BITS_TO_LONGS (nr_cpumask_bits ) * sizeof (long ), hash );
4640
- hash = jhash_1word (attrs -> affn_strict , hash );
4641
+ if (!attrs -> affn_strict )
4642
+ hash = jhash (cpumask_bits (attrs -> cpumask ),
4643
+ BITS_TO_LONGS (nr_cpumask_bits ) * sizeof (long ), hash );
4641
4644
return hash ;
4642
4645
}
4643
4646
@@ -4647,11 +4650,11 @@ static bool wqattrs_equal(const struct workqueue_attrs *a,
4647
4650
{
4648
4651
if (a -> nice != b -> nice )
4649
4652
return false;
4650
- if (! cpumask_equal ( a -> cpumask , b -> cpumask ) )
4653
+ if (a -> affn_strict != b -> affn_strict )
4651
4654
return false;
4652
4655
if (!cpumask_equal (a -> __pod_cpumask , b -> __pod_cpumask ))
4653
4656
return false;
4654
- if (a -> affn_strict != b -> affn_strict )
4657
+ if (! a -> affn_strict && ! cpumask_equal ( a -> cpumask , b -> cpumask ) )
4655
4658
return false;
4656
4659
return true;
4657
4660
}
0 commit comments