Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1686799
| From | Wengang <wen.gang.wang@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v1] xen/grant-table: log the lack of grants |
| Date | 2017-07-13 19:40 +0200 |
| Message-ID | <u2QfM-85-21@gated-at.bofh.it> (permalink) |
| References | <u0G1b-7Gw-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
Anyone can you please review this patch?
thanks,
wengang
On 07/07/2017 11:23 AM, Wengang Wang wrote:
> log a message when we enter this situation:
> 1) we already allocated the max number of available grants from hypervisor
> and
> 2) we still need more (but the request fails because of 1)).
>
> Sometimes the lack of grants causes IO hangs in xen_blkfront devices.
> Adding this log would help debuging.
>
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
> ---
> drivers/xen/grant-table.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> index d6786b8..2c6a911 100644
> --- a/drivers/xen/grant-table.c
> +++ b/drivers/xen/grant-table.c
> @@ -42,6 +42,7 @@
> #include <linux/delay.h>
> #include <linux/hardirq.h>
> #include <linux/workqueue.h>
> +#include <linux/ratelimit.h>
>
> #include <xen/xen.h>
> #include <xen/interface/xen.h>
> @@ -1072,8 +1073,14 @@ static int gnttab_expand(unsigned int req_entries)
> cur = nr_grant_frames;
> extra = ((req_entries + (grefs_per_grant_frame-1)) /
> grefs_per_grant_frame);
> - if (cur + extra > gnttab_max_grant_frames())
> + if (cur + extra > gnttab_max_grant_frames()) {
> + pr_warn_ratelimited("xen/grant-table: max_grant_frames reached"
> + " cur=%u extra=%u limit=%u"
> + " gnttab_free_count=%u req_entries=%u\n",
> + cur, extra, gnttab_max_grant_frames(),
> + gnttab_free_count, req_entries);
> return -ENOSPC;
> + }
>
> rc = gnttab_map(cur, cur + extra - 1);
> if (rc == 0)
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v1] xen/grant-table: log the lack of grants Wengang Wang <wen.gang.wang@oracle.com> - 2017-07-07 20:20 +0200
Re: [PATCH v1] xen/grant-table: log the lack of grants Wengang <wen.gang.wang@oracle.com> - 2017-07-13 19:40 +0200
Re: [Xen-devel] [PATCH v1] xen/grant-table: log the lack of grants Julien Grall <julien.grall@arm.com> - 2017-07-14 16:20 +0200
Re: [Xen-devel] [PATCH v1] xen/grant-table: log the lack of grants Juergen Gross <jgross@suse.com> - 2017-07-18 09:20 +0200
Re: [Xen-devel] [PATCH v1] xen/grant-table: log the lack of grants Juergen Gross <jgross@suse.com> - 2017-07-18 10:10 +0200
csiph-web