mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
71008eab74
PD#SWPL-73422 Problem: When driver/kernel call kmalloc with large size, memory may waste if size is not equal to 2^n. For example, driver call kmalloc with size 129KB, kmalloc will allocate a 256KB memory block to caller. Then 127kb memory will be wasted if this caller do not free it. Solution: Free tail of slab memory if size is not match to 2^n. This change can save about 900KB memory after boot, and more than 100KB durning runtime. Verify: local. Change-Id: I19cfbdddc92b1c2050cbc17ea65feb4b01f0445d Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
14 lines
459 B
C
14 lines
459 B
C
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
|
|
/*
|
|
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _INC_AML_MM_H_
|
|
#define _INC_AML_MM_H_
|
|
void should_wakeup_kswap(gfp_t gfp_mask, int order,
|
|
struct alloc_context *ac);
|
|
void adjust_redzone_end(const void *ptr, size_t size, unsigned long *p_end);
|
|
void *aml_slub_alloc_large(size_t size, gfp_t flags, int order);
|
|
int aml_free_nonslab_page(struct page *page, void *object);
|
|
#endif
|