1
0
mirror of https://github.com/Zygo/bees.git synced 2025-07-03 09:12:25 +02:00

context: raise limit on the number of concurrent ioctls to cpu_cores/2

This might improve performance on systems with more than 3 CPU cores...or
it might bring such a machine to its knees.

TODO:  find out which of those two things happens.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell
2017-01-13 00:50:39 -05:00
parent 9cb48c35b9
commit 99fe452101
5 changed files with 13 additions and 8 deletions

View File

@ -1,6 +1,7 @@
#include "bees.h"
#include "crucible/cache.h"
#include "crucible/process.h"
#include "crucible/string.h"
#include <fstream>
@ -554,7 +555,7 @@ void
BeesCrawl::crawl_thread()
{
Timer crawl_timer;
LockSet<uint64_t>::Lock crawl_lock(m_ctx->roots()->lock_set(), m_state.m_root, false);
auto crawl_lock = m_ctx->roots()->lock_set().make_lock(m_state.m_root, false);
while (!m_stopped) {
BEESNOTE("waiting for crawl thread limit " << m_state);
crawl_lock.lock();
@ -646,7 +647,7 @@ BeesCrawl::fetch_extents()
bool ioctl_ok = false;
{
BEESNOTE("waiting to search crawl sk " << static_cast<btrfs_ioctl_search_key&>(sk));
unique_lock<mutex> lock(bees_ioctl_mutex);
auto lock = bees_ioctl_lock_set.make_lock(gettid());
BEESNOTE("searching crawl sk " << static_cast<btrfs_ioctl_search_key&>(sk));
BEESTOOLONG("Searching crawl sk " << static_cast<btrfs_ioctl_search_key&>(sk));