[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] schedule: mask out XEN_RUNSTATE_UPDATE from state entry time


  • To: Andrii Anisov <andrii.anisov@xxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Thu, 18 Jul 2019 15:04:52 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CFcM+bJFWq1Vma8BXCN6RK1vK6nCujzKQCqbeNia/38=; b=ITZBhCVe/tJHOlZCa/1jo9VkZoApoiugp7LhWQkXjjz97ys4hAy53sIjynarjynAmY2MuEN75wvxUU1Wk//gf/8B9jWrTZjMT+MaLt7WjiSQ8DonCsdlVN2an/DQoMRSER+kksWYIF+Jc9e2pQG3IBs3uZNTjp+PQOKKhUV1uHIksm25TEbnDU2dss3ncg5/Wg5OPIQ8GYf1cloDaegIyWATZexBlUqxhgnPKZOh31XKquvWcaJGoveWLIju8Qrbc+RtaZsKAteTpDlj1Bda/RfxypLokgESFAMjxl9y/YmxjXXNQXWV4WmDKOd2r9GfsPaUs+Qdyf0w626xjWANrQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lnlMzfiuDQoj4npFsXANyyipexbFYl07EqFYjhfC5PN9wlccLF3KHmFJ3mvZyOC6nkv3WQc2E89UQ38tToYVF8Y+Lc1cEop96RF93+Ldm1mkMcpL2MHXMPQMkA7iFwuIrtPFhUuOj7s3lzuETY3nsitebKIF5rZLk5dQ04duu4TcLO4y4T0JfWSMFRvxj9KAU5rV0P7ybeeNT1SwNIHpz1A6jHLIJL/vav0OF9+b314TWmLdpXlWf8Z87u5kCQYUZk+ZoODqLf/sEulv91EO+NT72c2vSAF6tZqqvbu1t6QgTog4f9H4Y+soVn2ntJAYTnFQTQBeekq11l7pkn1aGQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrii Anisov <andrii_anisov@xxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>
  • Delivery-date: Thu, 18 Jul 2019 15:05:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPU7dWxB3gAbicEW8M/sijNABxqbQOA+AgAAzR5uAAA5VgA==
  • Thread-topic: [Xen-devel] [PATCH] schedule: mask out XEN_RUNSTATE_UPDATE from state entry time

On 18.07.2019 16:12, Andrii Anisov wrote:
> On 18.07.19 14:10, Jan Beulich wrote:
>> A concrete scenario where update_runstate_area() and vcpu_runstate_change()
>> can actually race would be very worthwhile to point out here. In particular
>> on Arm I'm not (yet?) seeing how this could happen.
> 
> The scenario is quite trivial: some vcpu uptdating its runstate values
> (e.g. context switching) while those values are being read by a guest using
> other vcpu.

Well, that's (afaia) not an intended usage scenario. That's specifically
what the XEN_RUNSTATE_UPDATE flag was introduced for: This way guests
can notice that they shouldn't use the values, as they're likely
inconsistent. They'd pause for a brief moment and make another attempt;
see Linux'es xen_get_runstate_snapshot_cpu_delta().

But neither from the code change nor from the description I would have
implied that it's a guest side problem you're trying to address. So
far I was assuming you had found a race in Xen itself.

>> Considering the value of XEN_RUNSTATE_UPDATE it must be a rather rare race
>> anyway, I would guess.
> 
> I'm not sure how do you link the value of XEN_RUNSTATE_UPDATE and the issue
> occurrence rate. Could you please provide more details about the idea?

The value is huge, hence it being wrongly part of a calculation ought to
be easily noticeable _if_ it occurred often enough.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.