mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-27 07:20:53 +00:00
btrfs-progs: send: increase size of transfer buffer
4K is quite small, increase it to 64K. This reduces number of context switches and calls to read. Kernel sends us about 50K of data per read, so increasing the buffer further does not make any improvement. Example run on tests/cli-tests/004-send-parent-multi-subvol: 4K: - ~800 context switches - ~5000 calls to read 64K: - ~450 context switches - ~500 calls to read Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
88edac358c
commit
76fc07e3a6
@ -44,6 +44,8 @@
|
|||||||
#include "send.h"
|
#include "send.h"
|
||||||
#include "send-utils.h"
|
#include "send-utils.h"
|
||||||
|
|
||||||
|
#define SEND_BUFFER_SIZE (64 * 1024)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default is 1 for historical reasons, changing may break scripts that expect
|
* Default is 1 for historical reasons, changing may break scripts that expect
|
||||||
* the 'At subvol' message.
|
* the 'At subvol' message.
|
||||||
@ -222,7 +224,7 @@ static void *dump_thread(void *arg_)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct btrfs_send *s = (struct btrfs_send*)arg_;
|
struct btrfs_send *s = (struct btrfs_send*)arg_;
|
||||||
char buf[4096];
|
char buf[SEND_BUFFER_SIZE];
|
||||||
int readed;
|
int readed;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user