In the 4.4 kernel, its possible that allocating large buffers without
__GFP_NORETRY causes us to be stuck for long periods of time. I don't
get this behavior upstream when using the GFP_RETRY_MAYFAIL flag which
is the right way to prevent this but isn't possible to use in 4.4 due to
missing dependencies.
As a workaround for this, lets limit the total buffer size per-CPU to
200MB which on walleye is more than sufficient.
Test:
(1)
walleye:/data # echo 18014398509481980 > /d/tracing/buffer_size_kb
1|walleye:/data # echo $?
1
(2) Start camera recording and also other apps in the background, and
run without issues: echo 200000 > /d/tracing/buffer_size_kb
Bug: 63664347
Change-Id: I12cdea17eb7c46af315b91007967510da188e3f2
Signed-off-by: Joel Fernandes <joelaf@google.com>