linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64:swiotlb:Enable only when Input size through command line
@ 2016-06-23 12:13 Manjeet Pawar
  2016-06-23 12:31 ` Robin Murphy
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Manjeet Pawar @ 2016-06-23 12:13 UTC (permalink / raw)
  To: corbet, catalin.marinas, will.deacon, konrad.wilk, linux-doc,
	linux-kernel, linux-arm-kernel, r.thapliyal, akhilesh.k, ajeet.y
  Cc: pankaj.m, Manjeet Pawar

From: Rohit Thapliyal <r.thapliyal@samsung.com>

swiotlb default size of 64M is too big as
default value therefore it is made configurable
through command line through swiotlb_size parameter.
swiotlb allocation shall be done only when the
swiotlb size is given through command line.
Otherwise no swiotlb is allocated.

Signed-off-by: Rohit Thapliyal <r.thapliyal@samsung.com>
Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
Reviewed-by: Akhilesh Kumar <akhilesh.k@samsung.com>
Reviewed-by: Ajeet Kumar Yadav <ajeet.y@samsung.com>
---
 Documentation/kernel-parameters.txt |    3 +++
 arch/arm64/mm/init.c                |    3 ++-
 include/linux/swiotlb.h             |    1 +
 lib/swiotlb.c                       |   33 +++++++++++++++++++++++++++++----
 4 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 82b42c9..12b680f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -3875,6 +3875,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			force -- force using of bounce buffers even if they
 			         wouldn't be automatically used by the kernel
 
+	swiotlb_sz= [KNL] enter swiotlb size.
+			Sets the swiotlb size for eg. swiotlb_sz=64M
+
 	switches=	[HW,M68k]
 
 	sysfs.deprecated=0|1 [KNL]
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index d45f862..89c6b39 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -403,7 +403,8 @@ static void __init free_unused_memmap(void)
  */
 void __init mem_init(void)
 {
-	swiotlb_init(1);
+	if (swiotlb_enabled)
+		swiotlb_init(1);
 
 	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
 
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 017fced..c7eb146 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -11,6 +11,7 @@ struct page;
 struct scatterlist;
 
 extern int swiotlb_force;
+extern int swiotlb_enabled;
 
 /*
  * Maximum allowable number of contiguous slabs to map,
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 76f29ec..e89296a 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -54,6 +54,7 @@
 #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
 
 int swiotlb_force;
+int swiotlb_enabled;
 
 /*
  * Used to do a quick range check in swiotlb_tbl_unmap_single and
@@ -96,6 +97,9 @@ static DEFINE_SPINLOCK(io_tlb_lock);
 
 static int late_alloc;
 
+unsigned long swiotlb_sz;
+unsigned int swiotlb_sz_shift;
+
 static int __init
 setup_io_tlb_npages(char *str)
 {
@@ -112,6 +116,24 @@ setup_io_tlb_npages(char *str)
 	return 0;
 }
 early_param("swiotlb", setup_io_tlb_npages);
+
+static int __init
+setup_io_tlb_size(char *str)
+{
+	int len = strlen(str);
+
+	if (str[len-1] == 'M')
+		swiotlb_sz_shift = 20;
+	else if (str[len-1] == 'K')
+		swiotlb_sz_shift = 10;
+	str[len-1] = '\0';
+	if (isdigit(*str))
+		swiotlb_sz = kstrtoul(str, &str, 0);
+
+	swiotlb_enabled = 1;
+	return 0;
+}
+early_param("swiotlb_sz", setup_io_tlb_size);
 /* make io_tlb_overflow tunable too? */
 
 unsigned long swiotlb_nr_tbl(void)
@@ -120,8 +142,9 @@ unsigned long swiotlb_nr_tbl(void)
 }
 EXPORT_SYMBOL_GPL(swiotlb_nr_tbl);
 
-/* default to 64MB */
-#define IO_TLB_DEFAULT_SIZE (64UL<<20)
+/* Pass from command line as swiotlb_sz=64M (for eg.)*/
+#define IO_TLB_DEFAULT_SIZE (swiotlb_sz<<swiotlb_sz_shift)
+
 unsigned long swiotlb_size_or_default(void)
 {
 	unsigned long size;
@@ -153,10 +176,12 @@ void swiotlb_print_info(void)
 	vstart = phys_to_virt(io_tlb_start);
 	vend = phys_to_virt(io_tlb_end);
 
-	printk(KERN_INFO "software IO TLB [mem %#010llx-%#010llx] (%luMB) mapped at [%p-%p]\n",
+	pr_info("software IO TLB [mem %#010llx-%#010llx] (%lu%cB) mapped at [%p-%p]\n",
 	       (unsigned long long)io_tlb_start,
 	       (unsigned long long)io_tlb_end,
-	       bytes >> 20, vstart, vend - 1);
+		bytes >> swiotlb_sz_shift,
+		swiotlb_sz_shift == 20 ? 'M' : 'K',
+		vstart, vend - 1);
 }
 
 int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)
-- 
1.7.9.5

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

* Re: [PATCH] arm64:swiotlb:Enable only when Input size through command line
  2016-06-23 12:13 [PATCH] arm64:swiotlb:Enable only when Input size through command line Manjeet Pawar
@ 2016-06-23 12:31 ` Robin Murphy
  2016-06-23 14:30 ` Catalin Marinas
  2016-06-23 14:38 ` kbuild test robot
  2 siblings, 0 replies; 8+ messages in thread
From: Robin Murphy @ 2016-06-23 12:31 UTC (permalink / raw)
  To: Manjeet Pawar, corbet, catalin.marinas, will.deacon, konrad.wilk,
	linux-doc, linux-kernel, linux-arm-kernel, r.thapliyal,
	akhilesh.k, ajeet.y
  Cc: pankaj.m

On 23/06/16 13:13, Manjeet Pawar wrote:
> From: Rohit Thapliyal <r.thapliyal@samsung.com>
>
> swiotlb default size of 64M is too big as
> default value therefore it is made configurable
> through command line through swiotlb_size parameter.
> swiotlb allocation shall be done only when the
> swiotlb size is given through command line.
> Otherwise no swiotlb is allocated.

So all platforms with most memory physically above 4GB (which is quite a 
lot of them) are suddenly broken unless they go and muck about with 
their bootloader?

If anyone's got to muck about with their bootloader, why can't it be the 
memory-constrained platforms just passing "swiotlb=1" instead?

Robin.

> Signed-off-by: Rohit Thapliyal <r.thapliyal@samsung.com>
> Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
> Reviewed-by: Akhilesh Kumar <akhilesh.k@samsung.com>
> Reviewed-by: Ajeet Kumar Yadav <ajeet.y@samsung.com>
> ---
>   Documentation/kernel-parameters.txt |    3 +++
>   arch/arm64/mm/init.c                |    3 ++-
>   include/linux/swiotlb.h             |    1 +
>   lib/swiotlb.c                       |   33 +++++++++++++++++++++++++++++----
>   4 files changed, 35 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 82b42c9..12b680f 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -3875,6 +3875,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>   			force -- force using of bounce buffers even if they
>   			         wouldn't be automatically used by the kernel
>
> +	swiotlb_sz= [KNL] enter swiotlb size.
> +			Sets the swiotlb size for eg. swiotlb_sz=64M
> +
>   	switches=	[HW,M68k]
>
>   	sysfs.deprecated=0|1 [KNL]
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index d45f862..89c6b39 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -403,7 +403,8 @@ static void __init free_unused_memmap(void)
>    */
>   void __init mem_init(void)
>   {
> -	swiotlb_init(1);
> +	if (swiotlb_enabled)
> +		swiotlb_init(1);
>
>   	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
>
> diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> index 017fced..c7eb146 100644
> --- a/include/linux/swiotlb.h
> +++ b/include/linux/swiotlb.h
> @@ -11,6 +11,7 @@ struct page;
>   struct scatterlist;
>
>   extern int swiotlb_force;
> +extern int swiotlb_enabled;
>
>   /*
>    * Maximum allowable number of contiguous slabs to map,
> diff --git a/lib/swiotlb.c b/lib/swiotlb.c
> index 76f29ec..e89296a 100644
> --- a/lib/swiotlb.c
> +++ b/lib/swiotlb.c
> @@ -54,6 +54,7 @@
>   #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
>
>   int swiotlb_force;
> +int swiotlb_enabled;
>
>   /*
>    * Used to do a quick range check in swiotlb_tbl_unmap_single and
> @@ -96,6 +97,9 @@ static DEFINE_SPINLOCK(io_tlb_lock);
>
>   static int late_alloc;
>
> +unsigned long swiotlb_sz;
> +unsigned int swiotlb_sz_shift;
> +
>   static int __init
>   setup_io_tlb_npages(char *str)
>   {
> @@ -112,6 +116,24 @@ setup_io_tlb_npages(char *str)
>   	return 0;
>   }
>   early_param("swiotlb", setup_io_tlb_npages);
> +
> +static int __init
> +setup_io_tlb_size(char *str)
> +{
> +	int len = strlen(str);
> +
> +	if (str[len-1] == 'M')
> +		swiotlb_sz_shift = 20;
> +	else if (str[len-1] == 'K')
> +		swiotlb_sz_shift = 10;
> +	str[len-1] = '\0';
> +	if (isdigit(*str))
> +		swiotlb_sz = kstrtoul(str, &str, 0);
> +
> +	swiotlb_enabled = 1;
> +	return 0;
> +}
> +early_param("swiotlb_sz", setup_io_tlb_size);
>   /* make io_tlb_overflow tunable too? */
>
>   unsigned long swiotlb_nr_tbl(void)
> @@ -120,8 +142,9 @@ unsigned long swiotlb_nr_tbl(void)
>   }
>   EXPORT_SYMBOL_GPL(swiotlb_nr_tbl);
>
> -/* default to 64MB */
> -#define IO_TLB_DEFAULT_SIZE (64UL<<20)
> +/* Pass from command line as swiotlb_sz=64M (for eg.)*/
> +#define IO_TLB_DEFAULT_SIZE (swiotlb_sz<<swiotlb_sz_shift)
> +
>   unsigned long swiotlb_size_or_default(void)
>   {
>   	unsigned long size;
> @@ -153,10 +176,12 @@ void swiotlb_print_info(void)
>   	vstart = phys_to_virt(io_tlb_start);
>   	vend = phys_to_virt(io_tlb_end);
>
> -	printk(KERN_INFO "software IO TLB [mem %#010llx-%#010llx] (%luMB) mapped at [%p-%p]\n",
> +	pr_info("software IO TLB [mem %#010llx-%#010llx] (%lu%cB) mapped at [%p-%p]\n",
>   	       (unsigned long long)io_tlb_start,
>   	       (unsigned long long)io_tlb_end,
> -	       bytes >> 20, vstart, vend - 1);
> +		bytes >> swiotlb_sz_shift,
> +		swiotlb_sz_shift == 20 ? 'M' : 'K',
> +		vstart, vend - 1);
>   }
>
>   int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)
>

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

* Re: [PATCH] arm64:swiotlb:Enable only when Input size through command line
  2016-06-23 12:13 [PATCH] arm64:swiotlb:Enable only when Input size through command line Manjeet Pawar
  2016-06-23 12:31 ` Robin Murphy
@ 2016-06-23 14:30 ` Catalin Marinas
  2016-06-23 16:06   ` Konrad Rzeszutek Wilk
  2016-06-23 14:38 ` kbuild test robot
  2 siblings, 1 reply; 8+ messages in thread
From: Catalin Marinas @ 2016-06-23 14:30 UTC (permalink / raw)
  To: Manjeet Pawar
  Cc: corbet, will.deacon, konrad.wilk, linux-doc, linux-kernel,
	linux-arm-kernel, r.thapliyal, akhilesh.k, ajeet.y, pankaj.m

On Thu, Jun 23, 2016 at 05:43:40PM +0530, Manjeet Pawar wrote:
> From: Rohit Thapliyal <r.thapliyal@samsung.com>
> 
> swiotlb default size of 64M is too big as
> default value therefore it is made configurable
> through command line through swiotlb_size parameter.
> swiotlb allocation shall be done only when the
> swiotlb size is given through command line.
> Otherwise no swiotlb is allocated.

I already queued this patch:

http://lkml.kernel.org/g/1465372426-4077-1-git-send-email-jszhang@marvell.com

If you have any objections to it, please reply there.

-- 
Catalin

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

* Re: [PATCH] arm64:swiotlb:Enable only when Input size through command line
  2016-06-23 12:13 [PATCH] arm64:swiotlb:Enable only when Input size through command line Manjeet Pawar
  2016-06-23 12:31 ` Robin Murphy
  2016-06-23 14:30 ` Catalin Marinas
@ 2016-06-23 14:38 ` kbuild test robot
  2 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2016-06-23 14:38 UTC (permalink / raw)
  To: Manjeet Pawar
  Cc: kbuild-all, corbet, catalin.marinas, will.deacon, konrad.wilk,
	linux-doc, linux-kernel, linux-arm-kernel, r.thapliyal,
	akhilesh.k, ajeet.y, pankaj.m, Manjeet Pawar

[-- Attachment #1: Type: text/plain, Size: 2176 bytes --]

Hi,

[auto build test WARNING on v4.7-rc4]
[cannot apply to arm64/for-next/core next-20160623]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Manjeet-Pawar/arm64-swiotlb-Enable-only-when-Input-size-through-command-line/20160623-205508
config: x86_64-randconfig-i0-201625 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   lib/swiotlb.c: In function 'setup_io_tlb_size':
>> lib/swiotlb.c:131:30: warning: passing argument 2 of 'kstrtoul' makes integer from pointer without a cast [-Wint-conversion]
      swiotlb_sz = kstrtoul(str, &str, 0);
                                 ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:17,
                    from include/linux/dma-mapping.h:6,
                    from lib/swiotlb.c:21:
   include/linux/kernel.h:298:32: note: expected 'unsigned int' but argument is of type 'char **'
    static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
                                   ^~~~~~~~

vim +/kstrtoul +131 lib/swiotlb.c

   115	
   116		return 0;
   117	}
   118	early_param("swiotlb", setup_io_tlb_npages);
   119	
   120	static int __init
   121	setup_io_tlb_size(char *str)
   122	{
   123		int len = strlen(str);
   124	
   125		if (str[len-1] == 'M')
   126			swiotlb_sz_shift = 20;
   127		else if (str[len-1] == 'K')
   128			swiotlb_sz_shift = 10;
   129		str[len-1] = '\0';
   130		if (isdigit(*str))
 > 131			swiotlb_sz = kstrtoul(str, &str, 0);
   132	
   133		swiotlb_enabled = 1;
   134		return 0;
   135	}
   136	early_param("swiotlb_sz", setup_io_tlb_size);
   137	/* make io_tlb_overflow tunable too? */
   138	
   139	unsigned long swiotlb_nr_tbl(void)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 28749 bytes --]

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

* Re: [PATCH] arm64:swiotlb:Enable only when Input size through command line
  2016-06-23 14:30 ` Catalin Marinas
@ 2016-06-23 16:06   ` Konrad Rzeszutek Wilk
  2016-06-24  2:57     ` Jisheng Zhang
  0 siblings, 1 reply; 8+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-06-23 16:06 UTC (permalink / raw)
  To: Catalin Marinas, Manjeet Pawar
  Cc: corbet, will.deacon, linux-doc, linux-kernel, linux-arm-kernel,
	r.thapliyal, akhilesh.k, ajeet.y, pankaj.m

On June 23, 2016 10:30:34 AM EDT, Catalin Marinas <catalin.marinas@arm.com> wrote:
>On Thu, Jun 23, 2016 at 05:43:40PM +0530, Manjeet Pawar wrote:
>> From: Rohit Thapliyal <r.thapliyal@samsung.com>
>> 
>> swiotlb default size of 64M is too big as
>> default value therefore it is made configurable
>> through command line through swiotlb_size parameter.
>> swiotlb allocation shall be done only when the
>> swiotlb size is given through command line.
>> Otherwise no swiotlb is allocated.
>
>I already queued this patch:
>
>http://lkml.kernel.org/g/1465372426-4077-1-git-send-email-jszhang@marvell.com
>
>If you have any objections to it, please reply there.


I do (sorry about duplicate email, the other got rejected by mailing lists).

Why not expand the swiotlb= parameter instead of introducing a new one?

Also, why not use the swiotlb by itself? That does the job as well?

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

* Re: [PATCH] arm64:swiotlb:Enable only when Input size through command line
  2016-06-23 16:06   ` Konrad Rzeszutek Wilk
@ 2016-06-24  2:57     ` Jisheng Zhang
  2016-06-24 10:46       ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 8+ messages in thread
From: Jisheng Zhang @ 2016-06-24  2:57 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Catalin Marinas, Manjeet Pawar, linux-doc, corbet, will.deacon,
	linux-kernel, ajeet.y, akhilesh.k, r.thapliyal, linux-arm-kernel,
	pankaj.m

Dear Konrad,

On Thu, 23 Jun 2016 12:06:10 -0400 Konrad Rzeszutek Wilk wrote:

> On June 23, 2016 10:30:34 AM EDT, Catalin Marinas <catalin.marinas@arm.com> wrote:
> >On Thu, Jun 23, 2016 at 05:43:40PM +0530, Manjeet Pawar wrote:  
> >> From: Rohit Thapliyal <r.thapliyal@samsung.com>
> >> 
> >> swiotlb default size of 64M is too big as
> >> default value therefore it is made configurable
> >> through command line through swiotlb_size parameter.
> >> swiotlb allocation shall be done only when the
> >> swiotlb size is given through command line.
> >> Otherwise no swiotlb is allocated.  
> >
> >I already queued this patch:
> >
> >http://lkml.kernel.org/g/1465372426-4077-1-git-send-email-jszhang@marvell.com
> >
> >If you have any objections to it, please reply there.  
> 
> 
> I do (sorry about duplicate email, the other got rejected by mailing lists).
> 
> Why not expand the swiotlb= parameter instead of introducing a new one?

Do you mean pass "swiotlb=" for those platforms(most probably, arm64 with less
than 4GB DDR) which don't need swiotlb? I'm afraid this is not convenient, and
users even don't notice swiotlb parameter. From another side, pass "swiotlb=0"
will make the swiotlb reserve 64MB instead, so how can we achieve zero reserved
memory for swiotlb through "swiotlb=" parameter?

PS: my patch didn't introduce new boot parameter.

I'm not sure I got your meaning, so could you please comment my patch
directly?

Thanks,
Jisheng

> 
> Also, why not use the swiotlb by itself? That does the job as well?
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64:swiotlb:Enable only when Input size through command line
  2016-06-24  2:57     ` Jisheng Zhang
@ 2016-06-24 10:46       ` Konrad Rzeszutek Wilk
  2016-06-24 10:53         ` Robin Murphy
  0 siblings, 1 reply; 8+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-06-24 10:46 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Konrad Rzeszutek Wilk, Catalin Marinas, Manjeet Pawar, linux-doc,
	corbet, will.deacon, linux-kernel, ajeet.y, akhilesh.k,
	r.thapliyal, linux-arm-kernel, pankaj.m

On Fri, Jun 24, 2016 at 10:57:29AM +0800, Jisheng Zhang wrote:
> Dear Konrad,
> 
> On Thu, 23 Jun 2016 12:06:10 -0400 Konrad Rzeszutek Wilk wrote:
> 
> > On June 23, 2016 10:30:34 AM EDT, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > >On Thu, Jun 23, 2016 at 05:43:40PM +0530, Manjeet Pawar wrote:  
> > >> From: Rohit Thapliyal <r.thapliyal@samsung.com>
> > >> 
> > >> swiotlb default size of 64M is too big as
> > >> default value therefore it is made configurable
> > >> through command line through swiotlb_size parameter.
> > >> swiotlb allocation shall be done only when the
> > >> swiotlb size is given through command line.
> > >> Otherwise no swiotlb is allocated.  
> > >
> > >I already queued this patch:
> > >
> > >http://lkml.kernel.org/g/1465372426-4077-1-git-send-email-jszhang@marvell.com
> > >
> > >If you have any objections to it, please reply there.  
> > 
> > 
> > I do (sorry about duplicate email, the other got rejected by mailing lists).
> > 
> > Why not expand the swiotlb= parameter instead of introducing a new one?
> 
> Do you mean pass "swiotlb=" for those platforms(most probably, arm64 with less
> than 4GB DDR) which don't need swiotlb? I'm afraid this is not convenient, and

Why not just have a function that checks the amount of memory? x86 has
that - if it finds that the machine has less than 4GB it will not setup
SWIOTLB?

> users even don't notice swiotlb parameter. From another side, pass "swiotlb=0"
> will make the swiotlb reserve 64MB instead, so how can we achieve zero reserved
> memory for swiotlb through "swiotlb=" parameter?

Obviously make the function understand that 0 is to turn it off.
> 
> PS: my patch didn't introduce new boot parameter.

swiotlb_sz ?

> 
> I'm not sure I got your meaning, so could you please comment my patch
> directly?
> 
> Thanks,
> Jisheng
> 
> > 
> > Also, why not use the swiotlb by itself? That does the job as well?
> > 
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

* Re: [PATCH] arm64:swiotlb:Enable only when Input size through command line
  2016-06-24 10:46       ` Konrad Rzeszutek Wilk
@ 2016-06-24 10:53         ` Robin Murphy
  0 siblings, 0 replies; 8+ messages in thread
From: Robin Murphy @ 2016-06-24 10:53 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, Jisheng Zhang
  Cc: Konrad Rzeszutek Wilk, corbet, Catalin Marinas, linux-doc,
	will.deacon, linux-kernel, ajeet.y, akhilesh.k, linux-arm-kernel,
	r.thapliyal, Manjeet Pawar, pankaj.m

Hi Konrad,

On 24/06/16 11:46, Konrad Rzeszutek Wilk wrote:
> On Fri, Jun 24, 2016 at 10:57:29AM +0800, Jisheng Zhang wrote:
>> Dear Konrad,
>>
>> On Thu, 23 Jun 2016 12:06:10 -0400 Konrad Rzeszutek Wilk wrote:
>>
>>> On June 23, 2016 10:30:34 AM EDT, Catalin Marinas <catalin.marinas@arm.com> wrote:
>>>> On Thu, Jun 23, 2016 at 05:43:40PM +0530, Manjeet Pawar wrote:  
>>>>> From: Rohit Thapliyal <r.thapliyal@samsung.com>
>>>>>
>>>>> swiotlb default size of 64M is too big as
>>>>> default value therefore it is made configurable
>>>>> through command line through swiotlb_size parameter.
>>>>> swiotlb allocation shall be done only when the
>>>>> swiotlb size is given through command line.
>>>>> Otherwise no swiotlb is allocated.  
>>>>
>>>> I already queued this patch:
>>>>
>>>> http://lkml.kernel.org/g/1465372426-4077-1-git-send-email-jszhang@marvell.com
>>>>
>>>> If you have any objections to it, please reply there.  
>>>
>>>
>>> I do (sorry about duplicate email, the other got rejected by mailing lists).
>>>
>>> Why not expand the swiotlb= parameter instead of introducing a new one?
>>
>> Do you mean pass "swiotlb=" for those platforms(most probably, arm64 with less
>> than 4GB DDR) which don't need swiotlb? I'm afraid this is not convenient, and
> 
> Why not just have a function that checks the amount of memory? x86 has
> that - if it finds that the machine has less than 4GB it will not setup
> SWIOTLB?
> 
>> users even don't notice swiotlb parameter. From another side, pass "swiotlb=0"
>> will make the swiotlb reserve 64MB instead, so how can we achieve zero reserved
>> memory for swiotlb through "swiotlb=" parameter?
> 
> Obviously make the function understand that 0 is to turn it off.
>>
>> PS: my patch didn't introduce new boot parameter.
> 
> swiotlb_sz ?

Note that Jisheng's patch is the one Catalin linked to, *not* this one,
and more or less does exactly what you describe.

Robin.

>>
>> I'm not sure I got your meaning, so could you please comment my patch
>> directly?
>>
>> Thanks,
>> Jisheng
>>
>>>
>>> Also, why not use the swiotlb by itself? That does the job as well?
>>>
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

end of thread, other threads:[~2016-06-24 10:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-23 12:13 [PATCH] arm64:swiotlb:Enable only when Input size through command line Manjeet Pawar
2016-06-23 12:31 ` Robin Murphy
2016-06-23 14:30 ` Catalin Marinas
2016-06-23 16:06   ` Konrad Rzeszutek Wilk
2016-06-24  2:57     ` Jisheng Zhang
2016-06-24 10:46       ` Konrad Rzeszutek Wilk
2016-06-24 10:53         ` Robin Murphy
2016-06-23 14:38 ` kbuild test robot

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).