Commit Graph

4 Commits

Author SHA1 Message Date
Dustin Brown
8ddef7dd9a qcacmn: Remove qdf_flex_mem_release()
Due to a limitation in the memory leak detection logic when qdf_flex_mem
was written, qdf_flex_mem_release() was necessary to free any
dynamically allocated memory in the qdf_flex_mem_pool during certain
points in the WLAN driver lifecycle. This was done to avoid flagging any
dynamically allocated qdf_flex_mem_segments as false positive leaks
when the memory domains were changed and leak checking was performed.
With the introduction of qdf_talloc(), this workaround is no longer
required. Replace the calls to qdf_mem_malloc/free with qdf_talloc/free,
and remove qdf_flex_mem_release() altogether.

Change-Id: Ia5fd21386b94fc117af5f27853db5d8341601738
CRs-Fixed: 2404955
2019-03-01 11:14:48 -08:00
Jeff Johnson
2d821eb0fe qcacmn: Fix typo "recieve"
Replace typo "recieve" with correct spelling "receive".

Change-Id: I7d88e57b97fa6d217630d4a5d5c365b56e714428
CRs-Fixed: 2238309
2018-05-17 00:47:23 -07:00
Dustin Brown
03a7ac6e19 qcacmn: Add reduction limit to qdf_flex_mem
Add the ability to prevent qdf_flex_mem_pool from freeing memory
segments unless there are more than some minimum number in the pool
already.

Change-Id: I20bde2ed629b97924ea71b4f7f46a2c1fc1bab28
CRs-Fixed: 2229511
2018-05-11 13:23:00 -07:00
Dustin Brown
19911f3a06 qcacmn: Add qdf_flex_mem pool allocator
It often happens that the WLAN driver needs to allocate some pool of
structures to handle bursty operations. The traditional approach is to
statically allocate the maximum number of structures that we want to be
able to handle concurrently. This has the significant down side of
requiring manual tuning for every hardware combination for optimal
behavior, and wasting large amounts of memory during non-burst periods.

Add a new flexible, segmented memory allocator in QDF to help address
such scenarios. A small static buffer segment is used to service the
vast majority of operations, while additional segments are dynamically
allocated as needed to meet demand. Critically, these additional
segments are freed when not in use to reduce memory consumption. The
result is a self-tuning buffer that combines most of the benefits of
pure dynamic allocation with most of the benefits of pure static
allocation.

Change-Id: I5c27ecce72a450826494b5d13d6c9fdebda650a6
CRs-Fixed: 2224534
2018-04-19 14:15:19 -07:00