linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: exynos_defconfig: increase CONFIG_CMA_SIZE_MBYTES to 96
@ 2017-02-28 19:12 Shuah Khan
  2017-03-01 17:09 ` Krzysztof Kozlowski
  2017-03-07 19:03 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 5+ messages in thread
From: Shuah Khan @ 2017-02-28 19:12 UTC (permalink / raw)
  To: linux, kgene, krzk, javier, arnd, cw00.choi, rafael.j.wysocki,
	robie, b.zolnierkie, viresh.kumar, m.szyprowski, s.nawrocki,
	a.hajda, inki.dae, sw0312.kim
  Cc: Shuah Khan, shuah, linux-arm-kernel, linux-samsung-soc, linux-kernel

Current CMA size of 64 Mbytes is right on the edge of being small when
several drivers need to allocate large CMA buffers.

For example, if the s5p-mfc driver needs to pre-allocate N MiB CMA memory
to decode a H.264 1080p video, then there won't be enough CMA memory left
for other drivers, such as the exynos-drm driver that may need to allocate
GEM buffers for the display manager.

Increasing CMA size to 96 Mbytes in exynos_defconfig addresses use-cases
such as these.

Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

Changes since v1:
Fix short and long commit log.

Reason for this patch:
With the proposed s5p_mfc patch series that pre-allocate buffers, when
display manager starts, it fails to get GEM buffers.  Increasing the CMA
size to 96 solved the problem.

 arch/arm/configs/exynos_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index 742baf0..2541414 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -53,7 +53,7 @@ CONFIG_RFKILL_REGULATOR=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=64
+CONFIG_CMA_SIZE_MBYTES=96
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_CRYPTOLOOP=y
 CONFIG_BLK_DEV_RAM=y
-- 
2.7.4

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

* Re: [PATCH v2] ARM: exynos_defconfig: increase CONFIG_CMA_SIZE_MBYTES to 96
  2017-02-28 19:12 [PATCH v2] ARM: exynos_defconfig: increase CONFIG_CMA_SIZE_MBYTES to 96 Shuah Khan
@ 2017-03-01 17:09 ` Krzysztof Kozlowski
  2017-03-01 18:08   ` Shuah Khan
  2017-03-07 19:03 ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-01 17:09 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux, kgene, javier, arnd, cw00.choi, rafael.j.wysocki, robie,
	b.zolnierkie, viresh.kumar, m.szyprowski, s.nawrocki, a.hajda,
	inki.dae, sw0312.kim, shuah, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

On Tue, Feb 28, 2017 at 12:12:21PM -0700, Shuah Khan wrote:
> Current CMA size of 64 Mbytes is right on the edge of being small when
> several drivers need to allocate large CMA buffers.
> 
> For example, if the s5p-mfc driver needs to pre-allocate N MiB CMA memory

Everything looks good but I don't get this "N MiB". What do you mean by
that? If N is infinite (or not known) then how do you know that 96 MiB
will be enough?

Best regards,
Krzysztof


> to decode a H.264 1080p video, then there won't be enough CMA memory left
> for other drivers, such as the exynos-drm driver that may need to allocate
> GEM buffers for the display manager.
> 
> Increasing CMA size to 96 Mbytes in exynos_defconfig addresses use-cases
> such as these.
> 
> Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
> 
> Changes since v1:
> Fix short and long commit log.
> 
> Reason for this patch:
> With the proposed s5p_mfc patch series that pre-allocate buffers, when
> display manager starts, it fails to get GEM buffers.  Increasing the CMA
> size to 96 solved the problem.
> 
>  arch/arm/configs/exynos_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
> index 742baf0..2541414 100644
> --- a/arch/arm/configs/exynos_defconfig
> +++ b/arch/arm/configs/exynos_defconfig
> @@ -53,7 +53,7 @@ CONFIG_RFKILL_REGULATOR=y
>  CONFIG_DEVTMPFS=y
>  CONFIG_DEVTMPFS_MOUNT=y
>  CONFIG_DMA_CMA=y
> -CONFIG_CMA_SIZE_MBYTES=64
> +CONFIG_CMA_SIZE_MBYTES=96
>  CONFIG_BLK_DEV_LOOP=y
>  CONFIG_BLK_DEV_CRYPTOLOOP=y
>  CONFIG_BLK_DEV_RAM=y
> -- 
> 2.7.4
> 

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

* Re: [PATCH v2] ARM: exynos_defconfig: increase CONFIG_CMA_SIZE_MBYTES to 96
  2017-03-01 17:09 ` Krzysztof Kozlowski
@ 2017-03-01 18:08   ` Shuah Khan
  2017-03-01 18:49     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Shuah Khan @ 2017-03-01 18:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux, kgene, javier, arnd, cw00.choi, rafael.j.wysocki, robie,
	b.zolnierkie, viresh.kumar, m.szyprowski, s.nawrocki, a.hajda,
	inki.dae, sw0312.kim, shuah, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, Shuah Khan

On 03/01/2017 10:09 AM, Krzysztof Kozlowski wrote:
> On Tue, Feb 28, 2017 at 12:12:21PM -0700, Shuah Khan wrote:
>> Current CMA size of 64 Mbytes is right on the edge of being small when
>> several drivers need to allocate large CMA buffers.
>>
>> For example, if the s5p-mfc driver needs to pre-allocate N MiB CMA memory
> 
> Everything looks good but I don't get this "N MiB". What do you mean by
> that? If N is infinite (or not known) then how do you know that 96 MiB
> will be enough?

s5p_mfc pre-allocating the default 8MiB at the moment with CMA size of
64 Mbytes H.264 1080p video use0case fails. Works with CMA size = 96 Mbytes.

N in this log meant to cover the deualt case of 8 MiB or any user override
with s5p_mfc.mem=UserSpecifiedM. If this leads to confusion, we can amend
it to say "pre-allocate CMA memory"

Would you like me to amend the changelog with the above change and resend
the patch?

thanks,
-- Shuah


> 
> Best regards,
> Krzysztof
> 
> 
>> to decode a H.264 1080p video, then there won't be enough CMA memory left
>> for other drivers, such as the exynos-drm driver that may need to allocate
>> GEM buffers for the display manager.
>>
>> Increasing CMA size to 96 Mbytes in exynos_defconfig addresses use-cases
>> such as these.
>>
>> Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
>> ---
>>
>> Changes since v1:
>> Fix short and long commit log.
>>
>> Reason for this patch:
>> With the proposed s5p_mfc patch series that pre-allocate buffers, when
>> display manager starts, it fails to get GEM buffers.  Increasing the CMA
>> size to 96 solved the problem.
>>
>>  arch/arm/configs/exynos_defconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
>> index 742baf0..2541414 100644
>> --- a/arch/arm/configs/exynos_defconfig
>> +++ b/arch/arm/configs/exynos_defconfig
>> @@ -53,7 +53,7 @@ CONFIG_RFKILL_REGULATOR=y
>>  CONFIG_DEVTMPFS=y
>>  CONFIG_DEVTMPFS_MOUNT=y
>>  CONFIG_DMA_CMA=y
>> -CONFIG_CMA_SIZE_MBYTES=64
>> +CONFIG_CMA_SIZE_MBYTES=96
>>  CONFIG_BLK_DEV_LOOP=y
>>  CONFIG_BLK_DEV_CRYPTOLOOP=y
>>  CONFIG_BLK_DEV_RAM=y
>> -- 
>> 2.7.4
>>

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

* Re: [PATCH v2] ARM: exynos_defconfig: increase CONFIG_CMA_SIZE_MBYTES to 96
  2017-03-01 18:08   ` Shuah Khan
@ 2017-03-01 18:49     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-01 18:49 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux, kgene, javier, arnd, cw00.choi, rafael.j.wysocki, robie,
	b.zolnierkie, viresh.kumar, m.szyprowski, s.nawrocki, a.hajda,
	inki.dae, sw0312.kim, shuah, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

On Wed, Mar 01, 2017 at 11:08:52AM -0700, Shuah Khan wrote:
> On 03/01/2017 10:09 AM, Krzysztof Kozlowski wrote:
> > On Tue, Feb 28, 2017 at 12:12:21PM -0700, Shuah Khan wrote:
> >> Current CMA size of 64 Mbytes is right on the edge of being small when
> >> several drivers need to allocate large CMA buffers.
> >>
> >> For example, if the s5p-mfc driver needs to pre-allocate N MiB CMA memory
> > 
> > Everything looks good but I don't get this "N MiB". What do you mean by
> > that? If N is infinite (or not known) then how do you know that 96 MiB
> > will be enough?
> 
> s5p_mfc pre-allocating the default 8MiB at the moment with CMA size of
> 64 Mbytes H.264 1080p video use0case fails. Works with CMA size = 96 Mbytes.
> 
> N in this log meant to cover the deualt case of 8 MiB or any user override
> with s5p_mfc.mem=UserSpecifiedM. If this leads to confusion, we can amend
> it to say "pre-allocate CMA memory"
> 
> Would you like me to amend the changelog with the above change and resend
> the patch?

I get the point. I think the ammended version sounds better but there is
no need to resend. I will rephrase it when applying (after merge
window).

Best regards,
Krzysztof

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

* Re: [PATCH v2] ARM: exynos_defconfig: increase CONFIG_CMA_SIZE_MBYTES to 96
  2017-02-28 19:12 [PATCH v2] ARM: exynos_defconfig: increase CONFIG_CMA_SIZE_MBYTES to 96 Shuah Khan
  2017-03-01 17:09 ` Krzysztof Kozlowski
@ 2017-03-07 19:03 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-07 19:03 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux, kgene, javier, arnd, cw00.choi, rafael.j.wysocki, robie,
	b.zolnierkie, viresh.kumar, m.szyprowski, s.nawrocki, a.hajda,
	inki.dae, sw0312.kim, shuah, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

On Tue, Feb 28, 2017 at 12:12:21PM -0700, Shuah Khan wrote:
> Current CMA size of 64 Mbytes is right on the edge of being small when
> several drivers need to allocate large CMA buffers.
> 
> For example, if the s5p-mfc driver needs to pre-allocate N MiB CMA memory
> to decode a H.264 1080p video, then there won't be enough CMA memory left
> for other drivers, such as the exynos-drm driver that may need to allocate
> GEM buffers for the display manager.
> 
> Increasing CMA size to 96 Mbytes in exynos_defconfig addresses use-cases
> such as these.
> 
> Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
> 
> Changes since v1:
> Fix short and long commit log.
> 
> Reason for this patch:
> With the proposed s5p_mfc patch series that pre-allocate buffers, when
> display manager starts, it fails to get GEM buffers.  Increasing the CMA
> size to 96 solved the problem.
> 
>  arch/arm/configs/exynos_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks, applied with slightly changed commit msg.

Best regards,
Krzysztof

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

end of thread, other threads:[~2017-03-07 19:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28 19:12 [PATCH v2] ARM: exynos_defconfig: increase CONFIG_CMA_SIZE_MBYTES to 96 Shuah Khan
2017-03-01 17:09 ` Krzysztof Kozlowski
2017-03-01 18:08   ` Shuah Khan
2017-03-01 18:49     ` Krzysztof Kozlowski
2017-03-07 19:03 ` Krzysztof Kozlowski

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