• Miklos Szeredi's avatar
    fuse: realloc page array · e52a8250
    Miklos Szeredi authored
    Writeback caching currently allocates requests with the maximum number of
    possible pages, while the actual number of pages per request depends on a
    couple of factors that cannot be determined when the request is allocated
    (whether page is already under writeback, whether page is contiguous with
    previous pages already added to a request).
    
    This patch allows such requests to start with no page allocation (all pages
    inline) and grow the page array on demand.
    
    If the max_pages tunable remains the default value, then this will mean
    just one allocation that is the same size as before.  If the tunable is
    larger, then this adds at most 3 additional memory allocations (which is
    generously compensated by the improved performance from the larger
    request).
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    e52a8250
dev.c 53.7 KB