mirror of
https://github.com/torvalds/linux
synced 2024-07-22 11:10:46 +00:00
![Kent Overstreet](/assets/img/avatar_default.png)
Various phases of fsck involve checking references from one btree to another: this means doing a sequential scan of one btree, and then mostly random access into the second. This is particularly painful for checking extents <-> backpointers; we can prefetch btree node access on the sequential scan, but not on the random access portion, and this is particularly painful on spinning rust, where we'd like to keep the pipeline fairly full of btree node reads so that the elevator can reduce seeking. This patch implements prefetching and pinning of the portion of the btree that we'll be doing random access to. We already calculate how much of the random access btree will fit in memory so it's a fairly straightforward change. This will put more pressure on system memory usage, so we introduce a new option, fsck_memory_usage_percent, which is the percentage of total system ram that fsck is allowed to pin. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
19 lines
405 B
C
19 lines
405 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _BCACHEFS_BBPOS_TYPES_H
|
|
#define _BCACHEFS_BBPOS_TYPES_H
|
|
|
|
struct bbpos {
|
|
enum btree_id btree;
|
|
struct bpos pos;
|
|
};
|
|
|
|
static inline struct bbpos BBPOS(enum btree_id btree, struct bpos pos)
|
|
{
|
|
return (struct bbpos) { btree, pos };
|
|
}
|
|
|
|
#define BBPOS_MIN BBPOS(0, POS_MIN)
|
|
#define BBPOS_MAX BBPOS(BTREE_ID_NR - 1, SPOS_MAX)
|
|
|
|
#endif /* _BCACHEFS_BBPOS_TYPES_H */
|