Skip to content

Commit

Permalink
[backend] fix nativeonly dispatch handling
Browse files Browse the repository at this point in the history
We need to deep copy or BSCando::cando has no helpers defined anymore
  • Loading branch information
adrianschroeter committed May 10, 2016
1 parent 8eb6c80 commit 012ae37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/backend/bs_dispatch
Expand Up @@ -124,9 +124,15 @@ my $port = 5252; #'RR'
$port = $1 if $BSConfig::reposerver =~ /:(\d+)$/;

# strip helpers from cando
my %cando = %BSCando::cando;
for my $hostarch (values %cando) {
s/:.*// for @{$hostarch || []};
my %cando; # = %BSCando::cando;
for my $hostarch (keys %BSCando::cando) {
$cando{$hostarch} = [];
for (@{$BSCando::cando{$hostarch} || []}) {
# do a deep copy, we need unmodified BSCando::cando also
my $targetarch = $_;
$targetarch =~ s/:.*//;
push ( @{$cando{$hostarch}}, $targetarch );
}
}

# 4h build will add .5 to the load
Expand Down Expand Up @@ -1357,7 +1363,7 @@ while (1) {
# a helper is needed for personality change?
my $helper;
/^\Q$arch\E:(.*)$/ && ($helper = $1) for @{$BSCando::cando{$harch}};
if ($helper && $workerinfo{$idle} && $workerinfo{$idle}->{hardware} && $workerinfo{$idle}->{hardware}->{nativeonly}) {
if ($helper && $workerinfo{$idle} && $workerinfo{$idle}->{hardware} && defined($workerinfo{$idle}->{hardware}->{nativeonly})) {
next; # worker is not supporting the needed personality change
}
if ($constraints) {
Expand Down
2 changes: 1 addition & 1 deletion src/backend/bs_worker
Expand Up @@ -676,7 +676,7 @@ if (open(FILE, "<", "/proc/cpuinfo")) {
$hw->{'cpu'}->{'flag'} = \@cpuflags;
} elsif (/^CPU implementer\s*:\s0x43/) {
# aarch64 special case: does not support armvXl instruction set
$hw->{'nativeonly'} = undef;
$hw->{'nativeonly'} = "true";
} elsif (/^cpu\s*:\sPOWER8/) {
# PowerPC kernel does not provide any flags, but we need to be able
# to distinguish between power7 and 8 at least
Expand Down

0 comments on commit 012ae37

Please sign in to comment.