From patchwork Tue Apr 23 12:11:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 10912855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9AD1B1390 for ; Tue, 23 Apr 2019 12:13:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CAF428644 for ; Tue, 23 Apr 2019 12:13:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80B3E28657; Tue, 23 Apr 2019 12:13:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09CDF28644 for ; Tue, 23 Apr 2019 12:13:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hIuHD-0006OP-0J; Tue, 23 Apr 2019 12:11:55 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hIuHC-0006OA-Fx for xen-devel@lists.xenproject.org; Tue, 23 Apr 2019 12:11:54 +0000 X-Inumbo-ID: fa3a6c70-65c0-11e9-8a7c-8b3d94c3594d Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id fa3a6c70-65c0-11e9-8a7c-8b3d94c3594d; Tue, 23 Apr 2019 12:11:51 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,385,1549929600"; d="scan'208";a="84180797" From: Ian Jackson To: Date: Tue, 23 Apr 2019 13:11:39 +0100 Message-ID: <20190423121139.25996-4-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190423121139.25996-1-ian.jackson@eu.citrix.com> References: <20190423121139.25996-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [OSSTEST PATCH 3/3] builds: Run i386 builds on amd64 kernels X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Wei Liu , Andrew Cooper , Ian Jackson , Paul Durrant , Boris Ostrovsky Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Most hardware that supports i386 supports amd64 too. When doing builds we do need the right userland, but we don't actually care what the kernel is doing. With Linux 32-on-64 is good for that. Especially, there is a kernel regression (evident in the Debian stretch kernel, but not present in jessie's) where 32-bit Linux mismanages the memory on hosts with moderately large amounts of RAM (ie, significantly more RAM than can be addressed at once), resulting in what amounts to a near-stall of the paging system. Since the paging system is used for filesystem writes too, the effect is that commands run by builds can take totally unreasonable amounts of time. Ie, this version of Linux is broken when i386 PAE is needed. In practice this is causing significant trouble in the Xen Project CI. This kernel bug probably won't affect our test jobs because (i) we use our own kernels, so we would probably detect this regression when switching kernel branches etc. (ii) test jobs run with a dom0_mem setting which avoids the preconditions for the particular bug. CC: Juergen Gross CC: Boris Ostrovsky CC: Wei Liu CC: Andrew Cooper CC: Paul Durrant Signed-off-by: Ian Jackson --- Osstest/Debian.pm | 35 +++++++++++++++++++++++++++++++++++ ts-host-install | 8 ++++++++ 2 files changed, 43 insertions(+) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index 600f18b1..0f10a9c3 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -1334,6 +1334,41 @@ END preseed_hook_command($ho, 'late_command', $sfx, $cmds); }); + my $kern_arch = $xopts{LinuxKernArchMap}{$r{arch}}; + if ($kern_arch && + $ho->{Flags}{"arch-$r{arch}"} && !$ho->{Flags}{"arch-$kern_arch"}) { + # We check the flag for $r{arch} because for various reasons + # it may not be set. For example, in standalone mode it is + # currently not normally necessary to set any arch hostflags. + # In that situation we bet that the kern arch can be used; + # this is a good bet because currently this is used for + # running amd64 kernels with i386 userland and hosts that can + # do only i386 are fairly rare, especially server hosts. + # If this causes a problem, setting the i386 host flag will + # (somewhat counterintuitively) cause this check to miss + # the amd64 host flag + logm("NOT using $kern_arch kernel (flags say not supported by host)"); + $kern_arch = undef; + } + if ($kern_arch) { + logm("Using $kern_arch kernel for $r{arch} userland"); + preseed_hook_command($ho, 'late_command', $sfx, <{Flags}{'need-uboot-bootscr'} ) { my @bootargs = uboot_common_kernel_bootargs($ho); diff --git a/ts-host-install b/ts-host-install index 7094559f..35601a42 100755 --- a/ts-host-install +++ b/ts-host-install @@ -31,6 +31,7 @@ my $debconf_priority; my $poweron_test_only; our %xopts; +our %linux_kern_arch_map; while (@ARGV and $ARGV[0] =~ m/^-/) { $_= shift @ARGV; @@ -42,6 +43,12 @@ while (@ARGV and $ARGV[0] =~ m/^-/) { } elsif (m/^--rescue$/) { $xopts{RescueMode}= 1; } elsif (m/^--build$/) { + # When installing to do builds rather than tests, we can use an + # amd64 kernel on i386 hosts, and this is generally faster. + # Also, it avoids a kernel regression in Debian stretch - + # a regression which Linux upstream do not consider a bug. Eg + # https://lkml.org/lkml/2017/8/2/394 + $linux_kern_arch_map{i386} = 'amd64'; } else { die "$_ $!"; } @@ -61,6 +68,7 @@ sub install () { ($ho, '', DiskDevice => $ho->{DiskDevice}, Properties => $ho->{Properties}, + LinuxKernArchMap => \%linux_kern_arch_map, ExtraPreseed => <{Name} d-i netcfg/get_ipaddress string $ho->{Ip}