Skip to content
  • Sherry Yang's avatar
    android: binder: Add global lru shrinker to binder · f2517eb7
    Sherry Yang authored
    
    
    Hold on to the pages allocated and mapped for transaction
    buffers until the system is under memory pressure. When
    that happens, use linux shrinker to free pages. Without
    using shrinker, patch "android: binder: Move buffer out
    of area shared with user space" will cause a significant
    slow down for small transactions that fit into the first
    page because free list buffer header used to be inlined
    with buffer data.
    
    In addition to prevent the performance regression for
    small transactions, this patch improves the performance
    for transactions that take up more than one page.
    
    Modify alloc selftest to work with the shrinker change.
    
    Test: Run memory intensive applications (Chrome and Camera)
    to trigger shrinker callbacks. Binder frees memory as expected.
    Test: Run binderThroughputTest with high memory pressure
    option enabled.
    
    Signed-off-by: default avatarSherry Yang <sherryy@android.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f2517eb7