aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorTakashi Iwai2022-11-14 15:16:58 +0100
committerGreg Kroah-Hartman2022-12-31 13:32:11 +0100
commitaccc7993a780c5cd4e45051634bf66400df10f36 (patch)
treef0f32de181b9fe9f0ba4f124f228758bcf967002 /security
parent0a730f51b02ae44031fb0be12700066c91a9af7e (diff)
ALSA: memalloc: Allocate more contiguous pages for fallback case
[ Upstream commit cc26516374065a34e10c9a8bf3e940e42cd96e2a ] Currently the fallback SG allocation tries to allocate each single page, and this tends to result in the reverse order of memory addresses when large space is available at boot, as the kernel takes a free page from the top to the bottom in the zone. The end result looks as if non-contiguous (although it actually is). What's worse is that it leads to an overflow of BDL entries for HD-audio. For avoiding such a problem, this patch modifies the allocation code slightly; now it tries to allocate the larger contiguous chunks as much as possible, then reduces to the smaller chunks only if the allocation failed -- a similar strategy as the existing snd_dma_alloc_pages_fallback() function. Along with the trick, drop the unused address array from snd_dma_sg_fallback object. It was needed in the past when dma_alloc_coherent() was used, but with the standard page allocator, it became superfluous and never referred. Fixes: a8d302a0b770 ("ALSA: memalloc: Revive x86-specific WC page allocations again") Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20221114141658.29620-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions