Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mshv: Only map vp->vp_stats_pages if on root scheduler

This mapping is only used for checking if the dispatch thread is
blocked. This is only relevant for the root scheduler, so check the
scheduler type to determine whether to map/unmap these pages, instead of
the current check, which is incorrect.

Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam <anirudh@anirudhrb.com>
Reviewed-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Acked-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Nuno Das Neves and committed by
Wei Liu
9ebc528c 2647c966

+8 -4
+8 -4
drivers/hv/mshv_root_main.c
··· 936 936 goto unmap_register_page; 937 937 } 938 938 939 - if (hv_parent_partition()) { 939 + /* 940 + * This mapping of the stats page is for detecting if dispatch thread 941 + * is blocked - only relevant for root scheduler 942 + */ 943 + if (hv_scheduler_type == HV_SCHEDULER_TYPE_ROOT) { 940 944 ret = mshv_vp_stats_map(partition->pt_id, args.vp_index, 941 945 stats_pages); 942 946 if (ret) ··· 969 965 if (mshv_partition_encrypted(partition) && is_ghcb_mapping_available()) 970 966 vp->vp_ghcb_page = page_to_virt(ghcb_page); 971 967 972 - if (hv_parent_partition()) 968 + if (hv_scheduler_type == HV_SCHEDULER_TYPE_ROOT) 973 969 memcpy(vp->vp_stats_pages, stats_pages, sizeof(stats_pages)); 974 970 975 971 /* ··· 992 988 free_vp: 993 989 kfree(vp); 994 990 unmap_stats_pages: 995 - if (hv_parent_partition()) 991 + if (hv_scheduler_type == HV_SCHEDULER_TYPE_ROOT) 996 992 mshv_vp_stats_unmap(partition->pt_id, args.vp_index); 997 993 unmap_ghcb_page: 998 994 if (mshv_partition_encrypted(partition) && is_ghcb_mapping_available()) { ··· 1746 1742 if (!vp) 1747 1743 continue; 1748 1744 1749 - if (hv_parent_partition()) 1745 + if (hv_scheduler_type == HV_SCHEDULER_TYPE_ROOT) 1750 1746 mshv_vp_stats_unmap(partition->pt_id, vp->vp_index); 1751 1747 1752 1748 if (vp->vp_register_page) {