]> asedeno.scripts.mit.edu Git - linux.git/commit
fuse: realloc page array
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 1 Oct 2018 08:07:06 +0000 (10:07 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 1 Oct 2018 08:07:06 +0000 (10:07 +0200)
commite52a8250480acd3b26534793c61816e30d85fbb6
treebe2ae4d947e7fb876eae27926f70cf9c702243b2
parent5da784cce4308ae10a79e3c8c41b13fb9568e4e0
fuse: realloc page array

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: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dev.c
fs/fuse/file.c
fs/fuse/fuse_i.h