* [PATCH v1] xen/grant-table: log the lack of grants
@ 2017-07-07 18:23 Wengang Wang
2017-07-13 17:42 ` Wengang
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Wengang Wang @ 2017-07-07 18:23 UTC (permalink / raw)
To: xen-devel, linux-kernel; +Cc: wen.gang.wang, konrad.wilk, junxiao.bi
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)
--
2.9.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1] xen/grant-table: log the lack of grants
2017-07-07 18:23 [PATCH v1] xen/grant-table: log the lack of grants Wengang Wang
@ 2017-07-13 17:42 ` Wengang
2017-07-14 14:18 ` [Xen-devel] " Julien Grall
2017-07-18 7:11 ` Juergen Gross
2017-07-18 8:00 ` Juergen Gross
2 siblings, 1 reply; 5+ messages in thread
From: Wengang @ 2017-07-13 17:42 UTC (permalink / raw)
To: xen-devel, linux-kernel; +Cc: konrad.wilk, junxiao.bi
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)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] [PATCH v1] xen/grant-table: log the lack of grants
2017-07-13 17:42 ` Wengang
@ 2017-07-14 14:18 ` Julien Grall
0 siblings, 0 replies; 5+ messages in thread
From: Julien Grall @ 2017-07-14 14:18 UTC (permalink / raw)
To: Wengang, xen-devel, linux-kernel@vger.kernel.org
Cc: junxiao.bi, Boris Ostrovsky, Juergen Gross
On 07/13/2017 06:42 PM, Wengang wrote:
> Hi,
Hello,
> Anyone can you please review this patch?
Most of the developer community were at Xen Summit this week, so you may
expect some delay in review.
However, in general it is better to CC relevant maintainers of your code
to raise attention on your patch. I did it for you this time.
Cheers,
>
> 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)
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
--
Julien Grall
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] [PATCH v1] xen/grant-table: log the lack of grants
2017-07-07 18:23 [PATCH v1] xen/grant-table: log the lack of grants Wengang Wang
2017-07-13 17:42 ` Wengang
@ 2017-07-18 7:11 ` Juergen Gross
2017-07-18 8:00 ` Juergen Gross
2 siblings, 0 replies; 5+ messages in thread
From: Juergen Gross @ 2017-07-18 7:11 UTC (permalink / raw)
To: Wengang Wang, xen-devel, linux-kernel; +Cc: junxiao.bi
On 07/07/17 20:23, 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>
Reviewed-by: Juergen Gross <jgross@suse.com>
Thanks,
Juergen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] [PATCH v1] xen/grant-table: log the lack of grants
2017-07-07 18:23 [PATCH v1] xen/grant-table: log the lack of grants Wengang Wang
2017-07-13 17:42 ` Wengang
2017-07-18 7:11 ` Juergen Gross
@ 2017-07-18 8:00 ` Juergen Gross
2 siblings, 0 replies; 5+ messages in thread
From: Juergen Gross @ 2017-07-18 8:00 UTC (permalink / raw)
To: Wengang Wang, xen-devel, linux-kernel; +Cc: junxiao.bi
On 07/07/17 20:23, 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>
Committed to xen/tip for-linus-4.13
Thanks,
Juergen
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-07-18 8:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07 18:23 [PATCH v1] xen/grant-table: log the lack of grants Wengang Wang
2017-07-13 17:42 ` Wengang
2017-07-14 14:18 ` [Xen-devel] " Julien Grall
2017-07-18 7:11 ` Juergen Gross
2017-07-18 8:00 ` Juergen Gross
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).