mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen: issue warning message when out of grant maptrack entries
Date: Tue, 18 Sep 2018 13:03:14 -0400	[thread overview]
Message-ID: <f75e7a31-eef9-e444-0440-f46c3cd111fa@oracle.com> (raw)
In-Reply-To: <20180918093200.17499-1-jgross@suse.com>

On 9/18/18 5:32 AM, Juergen Gross wrote:
> When a driver domain (e.g. dom0) is running out of maptrack entries it
> can't map any more foreign domain pages. Instead of silently stalling
> the affected domUs issue a rate limited warning in this case in order
> to make it easier to detect that situation.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  drivers/xen/grant-table.c | 25 +++++++++++++++++++------
>  1 file changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> index 7bafa703a992..09f6ff8c1957 100644
> --- a/drivers/xen/grant-table.c
> +++ b/drivers/xen/grant-table.c
> @@ -1040,18 +1040,31 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
>  		return ret;
>  
>  	for (i = 0; i < count; i++) {
> -		/* Retry eagain maps */
> -		if (map_ops[i].status == GNTST_eagain)
> -			gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref, map_ops + i,
> -						&map_ops[i].status, __func__);
> -
> -		if (map_ops[i].status == GNTST_okay) {
> +		switch (map_ops[i].status) {
> +		case GNTST_okay:
> +		{
>  			struct xen_page_foreign *foreign;
>  
>  			SetPageForeign(pages[i]);
>  			foreign = xen_page_foreign(pages[i]);
>  			foreign->domid = map_ops[i].dom;
>  			foreign->gref = map_ops[i].ref;
> +			break;
> +		}
> +
> +		case GNTST_no_device_space:
> +			pr_warn_ratelimited("maptrack limit reached, can't map all guest pages\n");
> +			break;
> +
> +		case GNTST_eagain:
> +			/* Retry eagain maps */
> +			gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref,
> +						map_ops + i,
> +						&map_ops[i].status, __func__);
> +			break;
> +
> +		default:
> +			break;
>  		}
>  	}


Should we pass 'i' instead of count to set_foreign_p2m_mapping() below?
The loop there will skip entries that are in error, but does it make
sense to do the hypercall for kmap_ops with count>i ?

-boris

  reply	other threads:[~2018-09-18 17:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  9:32 Juergen Gross
2018-09-18 17:03 ` Boris Ostrovsky [this message]
2018-09-18 17:17   ` Juergen Gross
2018-09-18 17:25     ` Boris Ostrovsky
2018-09-19 13:29     ` Boris Ostrovsky
2018-09-19 13:34       ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f75e7a31-eef9-e444-0440-f46c3cd111fa@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome