From: Olaf Hering <olaf@aepfle.de>
To: Adin Scannell <adin@scannell.ca>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Only retry mapping pages when ENOENT is returned
Date: Wed, 4 Jan 2012 11:46:54 +0100 [thread overview]
Message-ID: <20120104104654.GA5554@aepfle.de> (raw)
In-Reply-To: <14d42c7d8e0817040186.1324094120@dev.gridcentric.ca>
On Fri, Dec 16, Adin Scannell wrote:
> # HG changeset patch
> # User Adin Scannell <adin@scannell.ca>
> # Date 1324094033 18000
> # Node ID 14d42c7d8e0817040186cd01c46f034999fc5dff
> # Parent 9dcc8557a0cb676b84e6788e03ab596bcfda7143
> Only retry mapping pages when ENOENT is returned
>
> If the return value from the ioctl() is not ENOENT, it's possible that err[i]
> will not be updated and libxc will just loop forever. Although it's unlikely
> that err[i] would not be updated after the ioctl() gets through at least once,
> it's better to be defensive.
In linux-2.6.18-xen.hg the ioctl could in theory return -ENOMEM in a
later iteration and maybe even other values if the guest was destroyed
meanwhile. So checking also errno for ENOENT is good, because thats the
return code if any of the requested gfns is still in paged-out state.
Acked-by: Olaf Hering <olaf@aepfle.de>
> diff -r 9dcc8557a0cb -r 14d42c7d8e08 tools/libxc/xc_linux_osdep.c
> --- a/tools/libxc/xc_linux_osdep.c
> +++ b/tools/libxc/xc_linux_osdep.c
> @@ -232,7 +232,7 @@ static void *linux_privcmd_map_foreign_b
> do {
> usleep(100);
> rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
> - } while ( rc < 0 && err[i] == -ENOENT );
> + } while ( rc < 0 && errno == ENOENT && err[i] == -ENOENT );
> }
> }
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
next prev parent reply other threads:[~2012-01-04 10:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-17 3:55 [PATCH] Only retry mapping pages when ENOENT is returned Adin Scannell
2012-01-03 17:01 ` Ian Jackson
2012-01-03 17:15 ` Adin Scannell
2012-01-03 17:20 ` Ian Jackson
2012-01-04 10:46 ` Olaf Hering [this message]
2012-01-05 17:40 ` Ian Jackson
2012-01-06 14:44 ` Adin Scannell
-- strict thread matches above, loose matches on Subject: below --
2012-01-09 21:40 Andres Lagar-Cavilla
2012-01-10 15:35 ` Ian Jackson
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=20120104104654.GA5554@aepfle.de \
--to=olaf@aepfle.de \
--cc=adin@scannell.ca \
--cc=xen-devel@lists.xensource.com \
/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;
as well as URLs for NNTP newsgroup(s).