public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ntb_transport: make DMA_OUT_RESOURCE_TO HZ independent
@ 2016-08-22 16:51 Nicholas Mc Guire
  2016-08-22 16:51 ` [PATCH 2/2] ntb: " Nicholas Mc Guire
  0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Mc Guire @ 2016-08-22 16:51 UTC (permalink / raw)
  To: Jon Mason
  Cc: Dave Jiang, Allen Hubbe, Logan Gunthorpe, Arnd Bergmann,
	Sudip Mukherjee, linux-ntb, linux-kernel, Nicholas Mc Guire

schedule_timeout_* takes a timeout in jiffies but the code currently is
passing in a constant which makes this timeout HZ dependent, so pass it
through msecs_to_jiffies() to fix this up.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem found by coccinelle script

The below patch sets the timeout to 50ms - not clear what HZ setting was 
assumed during design/testing, so this needs an ack by someone who knows
the driver and can confirm that 50ms is reasonable to wait on retries.

Patch was compile tested with: x86_64_defconfig + CONFIG_NTB=m, 
CONFIG_NTB_TRANSPORT=m

Patch is against 4.8.0-rc2 (localversion-next is -next-20160822)

 drivers/ntb/ntb_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 8601c10..4eb8adb 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -257,7 +257,7 @@ enum {
 #define NTB_QP_DEF_NUM_ENTRIES	100
 #define NTB_LINK_DOWN_TIMEOUT	10
 #define DMA_RETRIES		20
-#define DMA_OUT_RESOURCE_TO	50
+#define DMA_OUT_RESOURCE_TO	msecs_to_jiffies(50)
 
 static void ntb_transport_rxc_db(unsigned long data);
 static const struct ntb_ctx_ops ntb_transport_ops;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ntb: make DMA_OUT_RESOURCE_TO HZ independent
  2016-08-22 16:51 [PATCH 1/2] ntb_transport: make DMA_OUT_RESOURCE_TO HZ independent Nicholas Mc Guire
@ 2016-08-22 16:51 ` Nicholas Mc Guire
  2016-08-22 16:58   ` Jiang, Dave
  0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Mc Guire @ 2016-08-22 16:51 UTC (permalink / raw)
  To: Jon Mason
  Cc: Dave Jiang, Allen Hubbe, Logan Gunthorpe, Arnd Bergmann,
	Sudip Mukherjee, linux-ntb, linux-kernel, Nicholas Mc Guire

schedule_timeout_* takes a timeout in jiffies but the code currently is
passing in a constant which makes this timeout HZ dependent, so pass it
through msecs_to_jiffies() to fix this up.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem found by coccinelle script

The below patch sets the timeout to 50ms - not clear what HZ setting was
assumed during design/testing, so this needs an ack by someone who knows
the driver and can confirm that 50ms is reasonable to wait on DMA retries.

Patch was compile tested with: x86_64_defconfig + CONFIG_NTB=m,
CONFIG_NTB_PERF=m

Patch is against 4.8.0-rc2 (localversion-next is -next-20160822)

 drivers/ntb/test/ntb_perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 6a50f20..e065b69 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -72,7 +72,7 @@
 #define MAX_THREADS		32
 #define MAX_TEST_SIZE		SZ_1M
 #define MAX_SRCS		32
-#define DMA_OUT_RESOURCE_TO	50
+#define DMA_OUT_RESOURCE_TO	msecs_to_jiffies(50)
 #define DMA_RETRIES		20
 #define SZ_4G			(1ULL << 32)
 #define MAX_SEG_ORDER		20 /* no larger than 1M for kmalloc buffer */
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] ntb: make DMA_OUT_RESOURCE_TO HZ independent
  2016-08-22 16:51 ` [PATCH 2/2] ntb: " Nicholas Mc Guire
@ 2016-08-22 16:58   ` Jiang, Dave
  2016-08-23 16:43     ` Jon Mason
  0 siblings, 1 reply; 4+ messages in thread
From: Jiang, Dave @ 2016-08-22 16:58 UTC (permalink / raw)
  To: hofrat@osadl.org, jdmason@kudzu.us
  Cc: Allen.Hubbe@emc.com, logang@deltatee.com,
	linux-kernel@vger.kernel.org, sudipm.mukherjee@gmail.com,
	arnd@arndb.de, linux-ntb@googlegroups.com


On Mon, 2016-08-22 at 18:51 +0200, Nicholas Mc Guire wrote:
> schedule_timeout_* takes a timeout in jiffies but the code currently
> is
> passing in a constant which makes this timeout HZ dependent, so pass
> it
> through msecs_to_jiffies() to fix this up.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>

Acked-by: Dave Jiang <dave.jiang@intel.com>


> ---
> 
> Problem found by coccinelle script
> 
> The below patch sets the timeout to 50ms - not clear what HZ setting
> was
> assumed during design/testing, so this needs an ack by someone who
> knows
> the driver and can confirm that 50ms is reasonable to wait on DMA
> retries.
> 
> Patch was compile tested with: x86_64_defconfig + CONFIG_NTB=m,
> CONFIG_NTB_PERF=m
> 
> Patch is against 4.8.0-rc2 (localversion-next is -next-20160822)
> 
>  drivers/ntb/test/ntb_perf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ntb/test/ntb_perf.c
> b/drivers/ntb/test/ntb_perf.c
> index 6a50f20..e065b69 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -72,7 +72,7 @@
>  #define MAX_THREADS		32
>  #define MAX_TEST_SIZE		SZ_1M
>  #define MAX_SRCS		32
> -#define DMA_OUT_RESOURCE_TO	50
> +#define DMA_OUT_RESOURCE_TO	msecs_to_jiffies(50)
>  #define DMA_RETRIES		20
>  #define SZ_4G			(1ULL << 32)
>  #define MAX_SEG_ORDER		20 /* no larger than 1M for
> kmalloc buffer */
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] ntb: make DMA_OUT_RESOURCE_TO HZ independent
  2016-08-22 16:58   ` Jiang, Dave
@ 2016-08-23 16:43     ` Jon Mason
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Mason @ 2016-08-23 16:43 UTC (permalink / raw)
  To: Jiang, Dave
  Cc: hofrat@osadl.org, Allen.Hubbe@emc.com, logang@deltatee.com,
	linux-kernel@vger.kernel.org, sudipm.mukherjee@gmail.com,
	arnd@arndb.de, linux-ntb@googlegroups.com

On Mon, Aug 22, 2016 at 12:58 PM, Jiang, Dave <dave.jiang@intel.com> wrote:
>
> On Mon, 2016-08-22 at 18:51 +0200, Nicholas Mc Guire wrote:
>> schedule_timeout_* takes a timeout in jiffies but the code currently
>> is
>> passing in a constant which makes this timeout HZ dependent, so pass
>> it
>> through msecs_to_jiffies() to fix this up.
>>
>> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
>
> Acked-by: Dave Jiang <dave.jiang@intel.com>

Pulled both patches into ntb-next

Thanks,
Jon

>
>> ---
>>
>> Problem found by coccinelle script
>>
>> The below patch sets the timeout to 50ms - not clear what HZ setting
>> was
>> assumed during design/testing, so this needs an ack by someone who
>> knows
>> the driver and can confirm that 50ms is reasonable to wait on DMA
>> retries.
>>
>> Patch was compile tested with: x86_64_defconfig + CONFIG_NTB=m,
>> CONFIG_NTB_PERF=m
>>
>> Patch is against 4.8.0-rc2 (localversion-next is -next-20160822)
>>
>>  drivers/ntb/test/ntb_perf.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/ntb/test/ntb_perf.c
>> b/drivers/ntb/test/ntb_perf.c
>> index 6a50f20..e065b69 100644
>> --- a/drivers/ntb/test/ntb_perf.c
>> +++ b/drivers/ntb/test/ntb_perf.c
>> @@ -72,7 +72,7 @@
>>  #define MAX_THREADS          32
>>  #define MAX_TEST_SIZE                SZ_1M
>>  #define MAX_SRCS             32
>> -#define DMA_OUT_RESOURCE_TO  50
>> +#define DMA_OUT_RESOURCE_TO  msecs_to_jiffies(50)
>>  #define DMA_RETRIES          20
>>  #define SZ_4G                        (1ULL << 32)
>>  #define MAX_SEG_ORDER                20 /* no larger than 1M for
>> kmalloc buffer */
>> --
>> 2.1.4
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-23 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-22 16:51 [PATCH 1/2] ntb_transport: make DMA_OUT_RESOURCE_TO HZ independent Nicholas Mc Guire
2016-08-22 16:51 ` [PATCH 2/2] ntb: " Nicholas Mc Guire
2016-08-22 16:58   ` Jiang, Dave
2016-08-23 16:43     ` Jon Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox