aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin
diff options
context:
space:
mode:
authorAlexey Skidanov <[email protected]>2019-01-03 15:26:44 -0800
committerLinus Torvalds <[email protected]>2019-01-04 13:13:46 -0800
commit52fbf1134d479234d7e64ba9dcbaea23405f229e (patch)
treeab1629a6b81d70f85237d365c66bbf173c7309a6 /tools/perf/scripts/python/bin
parent3fc2579e6f162fcff964f5aa01c8a29438ca5c05 (diff)
lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk
gen_pool_alloc_algo() uses different allocation functions implementing different allocation algorithms. With gen_pool_first_fit_align() allocation function, the returned address should be aligned on the requested boundary. If chunk start address isn't aligned on the requested boundary, the returned address isn't aligned too. The only way to get properly aligned address is to initialize the pool with chunks aligned on the requested boundary. If want to have an ability to allocate buffers aligned on different boundaries (for example, 4K, 1MB, ...), the chunk start address should be aligned on the max possible alignment. This happens because gen_pool_first_fit_align() looks for properly aligned memory block without taking into account the chunk start address alignment. To fix this, we provide chunk start address to gen_pool_first_fit_align() and change its implementation such that it starts looking for properly aligned block with appropriate offset (exactly as is done in CMA). Link: https://lkml.kernel.org/lkml/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Alexey Skidanov <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Logan Gunthorpe <[email protected]> Cc: Daniel Mentz <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Laura Abbott <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions