hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/fs/fscache/object.c
....@@ -807,8 +807,6 @@
807807 }
808808 EXPORT_SYMBOL(fscache_object_destroy);
809809
810
-static DECLARE_WAIT_QUEUE_HEAD(fscache_object_cong_wait);
811
-
812810 /*
813811 * enqueue an object for metadata-type processing
814812 */
....@@ -817,12 +815,16 @@
817815 _enter("{OBJ%x}", object->debug_id);
818816
819817 if (fscache_get_object(object, fscache_obj_get_queue) >= 0) {
818
+ wait_queue_head_t *cong_wq =
819
+ &get_cpu_var(fscache_object_cong_wait);
820820
821821 if (queue_work(fscache_object_wq, &object->work)) {
822822 if (fscache_object_congested())
823
- wake_up(&fscache_object_cong_wait);
823
+ wake_up(cong_wq);
824824 } else
825825 fscache_put_object(object, fscache_obj_put_queue);
826
+
827
+ put_cpu_var(fscache_object_cong_wait);
826828 }
827829 }
828830
....@@ -840,15 +842,16 @@
840842 */
841843 bool fscache_object_sleep_till_congested(signed long *timeoutp)
842844 {
845
+ wait_queue_head_t *cong_wq = this_cpu_ptr(&fscache_object_cong_wait);
843846 DEFINE_WAIT(wait);
844847
845848 if (fscache_object_congested())
846849 return true;
847850
848
- add_wait_queue_exclusive(&fscache_object_cong_wait, &wait);
851
+ add_wait_queue_exclusive(cong_wq, &wait);
849852 if (!fscache_object_congested())
850853 *timeoutp = schedule_timeout(*timeoutp);
851
- finish_wait(&fscache_object_cong_wait, &wait);
854
+ finish_wait(cong_wq, &wait);
852855
853856 return fscache_object_congested();
854857 }