[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1465841117.16234.248.camel@intel.com>
Date: Mon, 13 Jun 2016 18:05:34 +0000
From: "Jiang, Dave" <dave.jiang@...el.com>
To: "Allen.Hubbe@....com" <Allen.Hubbe@....com>,
"logang@...tatee.com" <logang@...tatee.com>,
"jdmason@...zu.us" <jdmason@...zu.us>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"shuahkh@....samsung.com" <shuahkh@....samsung.com>,
"sudipm.mukherjee@...il.com" <sudipm.mukherjee@...il.com>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"arnd@...db.de" <arnd@...db.de>,
"linux-ntb@...glegroups.com" <linux-ntb@...glegroups.com>
Subject: Re: [PATCH 1/8] ntb_perf: Schedule based on time not on performance
On Fri, 2016-06-10 at 16:54 -0600, Logan Gunthorpe wrote:
> When debugging performance problems, if some issue causes the ntb
> hardware to be significantly slower than expected, ntb_perf will
> hang requiring a reboot because it only schedules once every 4GB.
>
> Instead, schedule based on jiffies so it will not hang the CPU if
> the transfer is slow.
>
> Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
Acked-by: Dave Jiang <dave.jiang@...el.com>
> ---
> drivers/ntb/test/ntb_perf.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ntb/test/ntb_perf.c
> b/drivers/ntb/test/ntb_perf.c
> index 4368519..5008ccf 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -273,6 +273,7 @@ static int perf_move_data(struct pthr_ctx *pctx,
> char __iomem *dst, char *src,
> char __iomem *tmp = dst;
> u64 perf, diff_us;
> ktime_t kstart, kstop, kdiff;
> + unsigned long last_sleep = jiffies;
>
> chunks = div64_u64(win_size, buf_size);
> total_chunks = div64_u64(total, buf_size);
> @@ -288,8 +289,9 @@ static int perf_move_data(struct pthr_ctx *pctx,
> char __iomem *dst, char *src,
> } else
> tmp += buf_size;
>
> - /* Probably should schedule every 4GB to prevent
> soft hang. */
> - if (((copied % SZ_4G) == 0) && !use_dma) {
> + /* Probably should schedule every 5s to prevent soft
> hang. */
> + if (unlikely((jiffies - last_sleep) > 5 * HZ)) {
> + last_sleep = jiffies;
> set_current_state(TASK_INTERRUPTIBLE);
> schedule_timeout(1);
> }
> --
> 2.1.4
>
Powered by blists - more mailing lists