Files
android_kernel_xiaomi_sm8450/include/linux
Andrea Parri (Microsoft) afaa33da08 Drivers: hv: vmbus: Resolve more races involving init_vp_index()
init_vp_index() uses the (per-node) hv_numa_map[] masks to record the
CPUs allocated for channel interrupts at a given time, and distribute
the performance-critical channels across the available CPUs: in part.,
the mask of "candidate" target CPUs in a given NUMA node, for a newly
offered channel, is determined by XOR-ing the node's CPU mask and the
node's hv_numa_map.  This operation/mechanism assumes that no offline
CPUs is set in the hv_numa_map mask, an assumption that does not hold
since such mask is currently not updated when a channel is removed or
assigned to a different CPU.

To address the issues described above, this adds hooks in the channel
removal path (hv_process_channel_removal()) and in target_cpu_store()
in order to clear, resp. to update, the hv_numa_map[] masks as needed.
This also adds a (missed) update of the masks in init_vp_index() (cf.,
e.g., the memory-allocation failure path in this function).

Like in the case of init_vp_index(), such hooks require to determine
if the given channel is performance critical.  init_vp_index() does
this by parsing the channel's offer, it can not rely on the device
data structure (device_obj) to retrieve such information because the
device data structure has not been allocated/linked with the channel
by the time that init_vp_index() executes.  A similar situation may
hold in hv_is_alloced_cpu() (defined below); the adopted approach is
to "cache" the device type of the channel, as computed by parsing the
channel's offer, in the channel structure itself.

Fixes: 7527810573 ("Drivers: hv: vmbus: Introduce the CHANNELMSG_MODIFYCHANNEL message type")
Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20200522171901.204127-3-parri.andrea@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
2020-05-23 09:07:00 +00:00
..
2020-03-31 21:29:04 +02:00
2019-12-11 09:12:38 +01:00
2019-11-12 11:43:29 -05:00
2020-03-30 01:34:00 +02:00
2020-04-10 15:36:21 -07:00
2020-01-23 00:35:50 +01:00
2020-03-09 11:12:19 +01:00
2020-02-27 14:58:01 +01:00
2019-12-03 11:20:37 +01:00
2020-02-17 13:37:00 +01:00
2020-01-27 11:09:31 +01:00
2020-01-18 09:19:18 -05:00
2020-03-13 12:49:51 -07:00
2020-03-06 11:06:15 +01:00
2020-03-27 20:19:24 -03:00
2020-04-15 11:48:21 +02:00
2020-03-21 16:00:24 +01:00
2019-12-04 19:44:14 -08:00
2020-01-31 17:33:54 +00:00
2020-02-20 21:17:24 +01:00
2019-12-11 09:12:38 +01:00
2020-04-10 15:36:21 -07:00
2020-03-06 11:56:59 +01:00
2020-04-07 10:43:38 -07:00
2019-12-09 10:55:03 +01:00
2020-03-21 16:00:24 +01:00
2019-11-14 19:06:47 -08:00
2020-01-15 10:54:33 -05:00
2020-01-14 12:20:48 +01:00
2019-12-11 16:37:02 +08:00
2020-04-02 09:35:27 -07:00
2020-04-07 10:43:38 -07:00
2019-11-13 19:09:47 +08:00
2020-01-15 16:30:28 +00:00
2020-04-09 12:15:35 -05:00
2020-03-17 18:31:05 +01:00
2020-01-13 18:16:43 -08:00
2019-11-14 13:07:48 +08:00
2020-03-21 16:00:24 +01:00
2020-02-21 10:31:18 +01:00
2020-04-07 10:43:42 -07:00
2020-03-21 16:00:24 +01:00
2020-03-02 14:04:31 -07:00
2019-11-13 12:15:34 -08:00
2020-02-04 03:05:26 +00:00
2020-03-23 13:41:55 +01:00
2020-02-21 11:22:15 -08:00
2020-01-14 12:20:48 +01:00
2020-03-23 17:01:47 +01:00
2020-04-01 12:06:26 -04:00
2020-04-01 12:06:26 -04:00
2020-03-21 18:56:06 -07:00
2020-04-01 12:06:26 -04:00
2019-11-14 12:20:02 +08:00