there are lots of PFNs busy message when run GPU tests:
[ 622.370671] alloc_contig_range: [4ea70, 4ea7c) PFNs busy
[ 626.518072] alloc_contig_range: [4ea90, 4ea9c) PFNs busy
this problem is related with CMA migration for fragments,
move CMA allocator after GFP to avoid memory migration,
also fix CMA preempt for contiguous memory request.
can improve CTS and gpubench benchmarks on M850D.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
ad77ed61b72c8362b04361acd2deb685fee15436)
gcsALLOCATOR_DESC allocatorArray[] =
{
+ /* GFP allocator. */
+ gcmkDEFINE_ALLOCATOR_DESC("gfp", _GFPAlloctorInit),
+
#if LINUX_CMA_FSL
gcmkDEFINE_ALLOCATOR_DESC("cmafsl", _CMAFSLAlloctorInit),
#endif
- /* GFP allocator. */
- gcmkDEFINE_ALLOCATOR_DESC("gfp", _GFPAlloctorInit),
-
/* User memory importer. */
gcmkDEFINE_ALLOCATOR_DESC("user", _UserMemoryAlloctorInit),
gcmkHEADER_ARG("Mdl=%p NumPages=0x%zx", Mdl, NumPages);
- if (os->allocatorLimitMarker)
+ if (os->allocatorLimitMarker && !(Flags & gcvALLOC_FLAG_CMA_PREEMPT))
{
- if ((Flags & gcvALLOC_FLAG_CMA_LIMIT) && !(Flags & gcvALLOC_FLAG_CMA_PREEMPT))
+ if (Flags & gcvALLOC_FLAG_CMA_LIMIT)
{
priv->cmaLimitRequest = gcvTRUE;
}
if (Os->allocatorLimitMarker)
{
allocator->capability |= gcvALLOC_FLAG_CMA_LIMIT;
- allocator->capability |= gcvALLOC_FLAG_CMA_PREEMPT;
}
+ allocator->capability |= gcvALLOC_FLAG_CMA_PREEMPT;
+
*Allocator = allocator;
return gcvSTATUS_OK;
gcmkASSERT(Flag & gcvALLOC_FLAG_CONTIGUOUS);
- if (Os->allocatorLimitMarker)
- {
- Flag |= gcvALLOC_FLAG_CMA_LIMIT;
- Flag |= gcvALLOC_FLAG_CMA_PREEMPT;
#if gcdENABLE_CACHEABLE_COMMAND_BUFFER
- Flag &= ~gcvALLOC_FLAG_CACHEABLE;
+ Flag &= ~gcvALLOC_FLAG_CACHEABLE;
#endif
- }
+
+ Flag |= gcvALLOC_FLAG_CMA_PREEMPT;
/* Walk all allocators. */
list_for_each_entry(allocator, &Os->allocatorList, link)