mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 13:25:45 +02:00
resolve: add bees.h constants for balance and logical_ino serialization
Make these workarounds configurable in src/bees.h instead of #if 0 code blocks. Someday we'll make the constants in bees.h configurable through a file or similar. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
c0149d72b7
commit
636e69267e
@ -803,6 +803,10 @@ BeesResolveAddrResult::BeesResolveAddrResult()
|
|||||||
void
|
void
|
||||||
BeesContext::wait_for_balance()
|
BeesContext::wait_for_balance()
|
||||||
{
|
{
|
||||||
|
if (!BEES_SERIALIZE_BALANCE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Timer balance_timer;
|
Timer balance_timer;
|
||||||
BEESNOTE("WORKAROUND: waiting for balance to stop");
|
BEESNOTE("WORKAROUND: waiting for balance to stop");
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -845,17 +849,21 @@ BeesContext::resolve_addr_uncached(BeesAddress addr)
|
|||||||
// transaction latency, competing threads, and freeze/SIGSTOP
|
// transaction latency, competing threads, and freeze/SIGSTOP
|
||||||
// pausing the bees process.
|
// pausing the bees process.
|
||||||
|
|
||||||
#if 0
|
// There can be only one of these running at a time, or some lingering
|
||||||
// There can be only one of these running at a time, or the slow
|
// backref bug will kill the whole system. Also it looks like there
|
||||||
// backrefs bug will kill the whole system. Also it looks like there
|
|
||||||
// are so many locks held while LOGICAL_INO runs that there is no
|
// are so many locks held while LOGICAL_INO runs that there is no
|
||||||
// point in trying to run two of them on the same filesystem.
|
// point in trying to run two of them on the same filesystem.
|
||||||
// ...but it works most of the time, and the performance hit from
|
// ...but it works most of the time, and the performance hit from
|
||||||
// not running resolve in multiple threads is significant.
|
// not running resolve in multiple threads is significant.
|
||||||
BEESNOTE("waiting to resolve addr " << addr);
|
// But "most of the time" really just means "between forced reboots",
|
||||||
|
// and with recent improvements in kernel uptime, this is now in the
|
||||||
|
// top 3 crash causes.
|
||||||
static mutex s_resolve_mutex;
|
static mutex s_resolve_mutex;
|
||||||
unique_lock<mutex> lock(s_resolve_mutex);
|
unique_lock<mutex> lock(s_resolve_mutex, defer_lock);
|
||||||
#endif
|
if (BEES_SERIALIZE_RESOLVE) {
|
||||||
|
BEESNOTE("waiting to resolve addr " << addr);
|
||||||
|
lock.lock();
|
||||||
|
}
|
||||||
|
|
||||||
// Is there a bug where resolve and balance cause a crash (BUG_ON at fs/btrfs/ctree.c:1227)?
|
// Is there a bug where resolve and balance cause a crash (BUG_ON at fs/btrfs/ctree.c:1227)?
|
||||||
// Apparently yes, and more than one.
|
// Apparently yes, and more than one.
|
||||||
|
@ -116,6 +116,12 @@ const size_t BEES_TRANSID_FACTOR = 10;
|
|||||||
// Wait this long for a balance to stop
|
// Wait this long for a balance to stop
|
||||||
const double BEES_BALANCE_POLL_INTERVAL = 60.0;
|
const double BEES_BALANCE_POLL_INTERVAL = 60.0;
|
||||||
|
|
||||||
|
// Workaround for backref bugs
|
||||||
|
const bool BEES_SERIALIZE_RESOLVE = false;
|
||||||
|
|
||||||
|
// Workaround for tree mod log bugs
|
||||||
|
const bool BEES_SERIALIZE_BALANCE = false;
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
const int FLAGS_OPEN_COMMON = O_NOFOLLOW | O_NONBLOCK | O_CLOEXEC | O_NOATIME | O_LARGEFILE | O_NOCTTY;
|
const int FLAGS_OPEN_COMMON = O_NOFOLLOW | O_NONBLOCK | O_CLOEXEC | O_NOATIME | O_LARGEFILE | O_NOCTTY;
|
||||||
const int FLAGS_OPEN_DIR = FLAGS_OPEN_COMMON | O_RDONLY | O_DIRECTORY;
|
const int FLAGS_OPEN_DIR = FLAGS_OPEN_COMMON | O_RDONLY | O_DIRECTORY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user