...
 
Commits (3)
  • David Kalnischkies's avatar
    Fix new gcc-9 warning -Wpessimizing-move · a967ba05
    David Kalnischkies authored
    warning: moving a local object in a return statement prevents copy
    elision [-Wpessimizing-move]
    
    Reported-By: gcc-9
    Gbp-Dch: Ignore
    a967ba05
  • David Kalnischkies's avatar
    Follow gcc-9 -Wnoexcept suggestion for FileChunk constructor · febbe5e3
    David Kalnischkies authored
    warning: but ‘pkgTagFilePrivate::FileChunk::FileChunk(bool, size_t)’
    does not throw; perhaps it should be declared ‘noexcept’ [-Wnoexcept]
    
    Reported-By: gcc-9
    Gbp-Dch: Ignore
    febbe5e3
  • David Kalnischkies's avatar
    Don't limit cpu-limited queues to at most 10 · f426580b
    David Kalnischkies authored
    Queues for processes like rred are not created by hostname but we
    spawn at most CPU*2 queues to place items in. The problem is that we
    then proceeded to limit it to at most 10 queues (via QueueHost::Limit)
    again at the end of the method so that all items (after the first 10
    queues are busy) are forcibly placed into a generic catch-all instance
    which is bad because we don't keep all CPUs we have available busy and
    worse we end up sheduling the most work to a single one while random
    distribution was intended.
    f426580b
......@@ -396,6 +396,7 @@ string pkgAcquire::QueueName(string Uri,MethodConfig const *&Config)
if (Config->SingleInstance == true || QueueMode == QueueAccess)
return U.Access;
int Limit = 10;
string AccessSchema = U.Access + ':';
string FullQueueName;
......@@ -414,15 +415,15 @@ string pkgAcquire::QueueName(string Uri,MethodConfig const *&Config)
#ifdef _SC_NPROCESSORS_ONLN
long cpuCount = sysconf(_SC_NPROCESSORS_ONLN) * 2;
#else
long cpuCount = 10;
long cpuCount = Limit;
#endif
cpuCount = _config->FindI("Acquire::QueueHost::Limit", cpuCount);
Limit = _config->FindI("Acquire::QueueHost::Limit", cpuCount);
if (cpuCount <= 0 || existing < cpuCount)
if (Limit <= 0 || existing < Limit)
strprintf(FullQueueName, "%s%ld", AccessSchema.c_str(), existing);
else
{
long const randomQueue = random() % cpuCount;
long const randomQueue = random() % Limit;
strprintf(FullQueueName, "%s%ld", AccessSchema.c_str(), randomQueue);
}
......@@ -430,6 +431,7 @@ string pkgAcquire::QueueName(string Uri,MethodConfig const *&Config)
clog << "Chose random queue " << FullQueueName << " for " << Uri << endl;
} else
{
Limit = _config->FindI("Acquire::QueueHost::Limit", Limit);
FullQueueName = AccessSchema + U.Host;
}
unsigned int Instances = 0, SchemaLength = AccessSchema.length();
......@@ -448,7 +450,7 @@ string pkgAcquire::QueueName(string Uri,MethodConfig const *&Config)
clog << "Found " << Instances << " instances of " << U.Access << endl;
}
if (Instances >= static_cast<decltype(Instances)>(_config->FindI("Acquire::QueueHost::Limit",10)))
if (Instances >= static_cast<decltype(Instances)>(Limit))
return U.Access;
return FullQueueName;
......
......@@ -69,7 +69,7 @@ public:
{
bool const good;
size_t length;
FileChunk(bool const pgood, size_t const plength) : good(pgood), length(plength) {}
FileChunk(bool const pgood, size_t const plength) noexcept : good(pgood), length(plength) {}
};
std::list<FileChunk> chunks;
......
......@@ -262,7 +262,7 @@ static std::vector<struct addrinfo *> OrderAddresses(struct addrinfo *CurHost)
allAddrs.push_back(*otherIter++);
}
return std::move(allAddrs);
return allAddrs;
}
/*}}}*/
// Check for errors and report them /*{{{*/
......