[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] dom0/pvh: fix processing softirqs during memory map population
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Mon, 7 Feb 2022 10:51:02 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XiOfI3zwfLnqqgoXiik9Wlkdk/H7DaolRG8yaxJP5LM=; b=NdwCgppNJoTW1QsJEsOz62WFM+jBBIQh0i9Mv/roYbUAqW2/WYQqLkd2MbfFiKQT/FNQhEh0ba9g26mfh6+oHMJARuogEtGYrPAI8HFJOG98V7WUNvoX+0fsQ2zPF3hGHDGQR7L15Yf8WINppEzsMvnpmTZKexQc/AoQGZ6QzmiX+KZHqDdJNGb4oWUDSsXMEG454ZMxy7TCg0IanMtYZ/DQkSBDGhqhKeH/wAon4fAnK1LldWZoYboXkMyULuUmloq+lm35udg7zFgpwZkvNpuK1eHVNo4W+sP2udO3No83HNlLq9qL5p0UKCSbOF5XiOda3ghxsj2BmZpOdb+39Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J+PnEo3G0jvQVNklo6I4OUWkuHJRvy/xDW6jWrYD8McNcBDFe4/qE2aqjp2Y0AwirrJ9jnfkSJD+3Y9kfWRLrJQ3aapTsxMllaO1EFW/6anbsPiea4+hN3mfycfjQKCgQ8JZf6pQ82zMOpTNkJVHRJFa5s73iDV5EjzYITQ5PW1nVVKy/3C9AxUt/xFdf0IDGTIotS+n6hW3uvxlSEGeu0PJ/3ljWWIz+43VLyRWUynkki0siBUoyuUdirCEauhZaKziVN4WOZ+oDFiYAncfsvU/XPE3A/fM9Gmet0t6X9FtFCmV/XT9tZiw0mZsY2eBzB+U5I/ZkZClzx+2IvBFgQ==
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 07 Feb 2022 09:51:48 +0000
- Ironport-data: A9a23:01kKsaKqW/NRE0qTFE+RA5IlxSXFcZb7ZxGr2PjKsXjdYENS0zNTm mBJXGuHbPfcNmf3ctFxb4S/9kNV7cXRx4M2SQBlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUakideSc+EH170Ug7xLZg6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB22wM5fy /NctaeCE1YIYqvOh8U2cDNHRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsF2gcsuNo/zNZ43sXB81zDJS/0hRPgvRo2UvoEDhGxt2qiiG978e cpCRAhpVi7NSARfOAgzGdFnseuR0yyXnzpw9wvO+PtfD3Lo5Bx81v3hPcTYfvSORN5JhQCIq 2Te5WP7DxoGctuFxlKt7XaEluLJ2yThV+o6Fre16/pri1273XEIBVsdUl7TnBWiohfgAZQFc RVSo3dw6/hpnKC2cjXjdyLnvlCHmA8cYOgKQsxm7gOS64H3yRnMUwDoUQV9QNAhscY3Qxkj2 VmIg87lCFRTjVGFdZ6O3uzK9G3vYED5OUdHPHZZFlVdv7EPtalu1kqnczp1LEKiYjQZ8xnU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yp8 gWKr4sGl9oBD4P1mLZ/Y0BCIgNBvoUU8arx8MskVY5pzrHA0/dJEL0fX3RqsUBO22prCwoMFMr nVpRXqOL/9zGQ6yoNwSfpQD9RZlLtbzheBSn5X1smW9j6gjCq0gOTM5hUYN7KI4VaLW4cwPHUz MlX+7G67SIVs8/DtJJwIeGNpqlrHHMzD8AK8Mn/IM3Givop2R7xHgUAB1vhjru+LSwSD0pmgab sqV/+ZRrm9ILr73cZXGJphXG
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Feb 07, 2022 at 09:21:11AM +0100, Jan Beulich wrote:
> On 05.02.2022 11:18, Roger Pau Monne wrote:
> > Make sure softirqs are processed at least once for every call to
> > pvh_populate_memory_range. It's likely that none of the calls to
> > pvh_populate_memory_range will perform 64 iterations, in which case
> > softirqs won't be processed for the whole duration of the p2m
> > population.
> >
> > In order to force softirqs to be processed at least once for every
> > pvh_populate_memory_range call move the increasing of 'i' to be done
> > after evaluation, so on the first loop iteration softirqs will
> > unconditionally be processed.
>
> Nit: The change still guarantees one invocation only for every
> iteration not encountering an error. That's fine from a functional
> pov, but doesn't fully match what you claim.
OK, will fix on next iteration.
> > --- a/xen/arch/x86/hvm/dom0_build.c
> > +++ b/xen/arch/x86/hvm/dom0_build.c
> > @@ -186,7 +186,7 @@ static int __init pvh_populate_memory_range(struct
> > domain *d,
> > start += 1UL << order;
> > nr_pages -= 1UL << order;
> > order_stats[order]++;
> > - if ( (++i % MAP_MAX_ITER) == 0 )
> > + if ( (i++ % MAP_MAX_ITER) == 0 )
> > process_pending_softirqs();
> > }
>
> This way is perhaps easiest, so
>
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> but I'd like you to consider to avoid doing this on the first
> iteration. How about keeping the code here as is, but instead
> insert an invocation in the sole caller (and there unconditionally
> at the end of every successful loop iteration)?
In fact I was thinking that we should call process_pending_softirqs on
every iteration: the calls to guest_physmap_add_page could use a 1G
page order, so if not using sync-pt (at least until your series for
IOMMU super-page support is committed) mapping a whole 1G page using
4K chunks on the IOMMU page-tables could be quite time consuming, and
hence we would likely need to process softirqs on every iteration.
>
> Furthermore, how about taking the opportunity and deleting the mis-
> named and single-use-only MAP_MAX_ITER define?
Right, let me know your opinion about the comment above.
Thanks, Roger.
|