diff options
author | 2024-03-25 10:50:48 +0800 | |
---|---|---|
committer | 2024-03-31 20:36:11 -0400 | |
commit | 36f9ef109b1c6935928d09a3e73d744291f71545 (patch) | |
tree | df4595b4fbd0c75233c205768a72d060985221ee /tools/perf/scripts/python/export-to-postgresql.py | |
parent | bcachefs: Don't do extent merging before journal replay is finished (diff) | |
download | wireguard-linux-36f9ef109b1c6935928d09a3e73d744291f71545.tar.xz wireguard-linux-36f9ef109b1c6935928d09a3e73d744291f71545.zip |
bcachefs: fix trans->mem realloc in __bch2_trans_kmalloc
The old code doesn't consider the mem alloced from mempool when call
krealloc on trans->mem. Also in bch2_trans_put, using mempool_free to
free trans->mem by condition "trans->mem_bytes == BTREE_TRANS_MEM_MAX"
is inaccurate when trans->mem was allocated by krealloc function.
Instead, we use used_mempool stuff to record the situation, and realloc
or free the trans->mem in elegant way.
Also, after krealloc failed in __bch2_trans_kmalloc, the old data
should be copied to the new buffer when alloc from mempool_alloc.
Fixes: 31403dca5bb1 ("bcachefs: optimize __bch2_trans_get(), kill DEBUG_TRANSACTIONS")
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions