From patchwork Fri May 22 13:34:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 1296263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49T6t109LNz9sTJ; Fri, 22 May 2020 23:34:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jc7oy-0003if-1i; Fri, 22 May 2020 13:34:44 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jc7ow-0003ho-BW for kernel-team@lists.ubuntu.com; Fri, 22 May 2020 13:34:42 +0000 Received: from mail-wm1-f69.google.com ([209.85.128.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jc7ow-0008W4-36 for kernel-team@lists.ubuntu.com; Fri, 22 May 2020 13:34:42 +0000 Received: by mail-wm1-f69.google.com with SMTP id v23so2693282wmj.0 for ; Fri, 22 May 2020 06:34:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=shkXddPLw9iREsuer7TZPg7Tns3xDt6FVKwMvEQP5qE=; b=ln4WoAYJ0wrGNoX/UNiA/I+8vp8w/dlzDZQXCv9ThNw1arqaCD0xA96RkvSJIofE/I e15O9rwp+qKzNwmWUSGL7o/F06JqdfIZWad68BU4b4da44k2P2/F6Mo3EVC0Tnlj4qon tgeXumB8i+TxsjF3S9sZXofVJK1KLS3uBc7PQSKYJHafvS2RZEhG31Lf6B30ShhF3Sw7 cT44gNn3hYklivQDLnsOKwNvIs4Ww+eqOQDf0dIWZrmmMIYSC8DqByT3pWBVzbIT/2F4 vRJsTZuaFvid5F1XPgptzHzypNx1SbU2/T16i6c9MBN+nwImHvKnN9NoKHSH12YJJqUO 3Avg== X-Gm-Message-State: AOAM533zDT5EJGKijI8217aKtazLyjxnf9FqlOh7CfALMlvkHieJaFKE BY4wcP5U7p/m7YNIhX73E+vtJfCA8j7ZhtRAq6TNyto84LPkHMCeyr5qvPu9eKKSWBPysh+rN0+ vpaKySS+n00WMyu4i5rXzfKl9AqAZUOWfpQBb3ZJYSQ== X-Received: by 2002:adf:d841:: with SMTP id k1mr3356395wrl.129.1590154481417; Fri, 22 May 2020 06:34:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/nJmN7kPD+PLAcB5x/KNmnMPrA1chk2VbUC/ZTSIj+s1AmtfUsw1xWM7OdRbqIeg8DR8PtA== X-Received: by 2002:adf:d841:: with SMTP id k1mr3356373wrl.129.1590154481109; Fri, 22 May 2020 06:34:41 -0700 (PDT) Received: from localhost.localdomain (host105-135-dynamic.43-79-r.retail.telecomitalia.it. [79.43.135.105]) by smtp.gmail.com with ESMTPSA id d6sm10294018wrj.90.2020.05.22.06.34.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 06:34:40 -0700 (PDT) From: Andrea Righi To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][E][aws] UBUNTU: [Config] aws: disable CONFIG_DMA_CMA Date: Fri, 22 May 2020 15:34:33 +0200 Message-Id: <20200522133433.164289-3-andrea.righi@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522133433.164289-1-andrea.righi@canonical.com> References: <20200522133433.164289-1-andrea.righi@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1879711 This option seems to introduce failures when resuming from hibernation on Xen t2 instance types, especially those with a small amount of memory (e.g., t2.nano and t2.small). With this option enabled device drivers are allowed to use the Contiguous Memory Allocator (CMA) for DMA operations. So, drivers can allocate large physically-contiguous blocks of memory, instead of relying on the I/O map or scatter-gather support. However, on resume, the memory used by DMA needs to be re-initialized / re-allocated, but it may fail to allocate large chunks of contiguous memory due to the fact that we also need to restore the hibernation image, using more memory and causing a system hang during the resume process. Such failures are more likely to happen in systems with a small amount of memory (e.g., t2.nano and t2.small) that were showing a significant higher rate of failures. Make sure to disable this option for now on amd64 and re-align the config and annotations file with the master kernel. NOTE #1: this option has been disabled in the generic kernel because, according to the associated bug link (LP: #1362261), it seemed to introduce performance regressions on amd64, so there is no reason to do differently in the aws kernel. NOTE #2: this also disables the module 'etnaviv' (that is really not needed in the aws kernel); update the modules list accordingly. Signed-off-by: Andrea Righi --- debian.aws/abi/5.3.0-1018.20/amd64/aws.modules | 1 - debian.aws/config/amd64/config.common.amd64 | 2 ++ debian.aws/config/annotations | 12 +++++++----- debian.aws/config/arm64/config.common.arm64 | 2 ++ debian.aws/config/config.common.ubuntu | 4 +--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/debian.aws/abi/5.3.0-1018.20/amd64/aws.modules b/debian.aws/abi/5.3.0-1018.20/amd64/aws.modules index b3df1bd1c708..60333442a3a2 100644 --- a/debian.aws/abi/5.3.0-1018.20/amd64/aws.modules +++ b/debian.aws/abi/5.3.0-1018.20/amd64/aws.modules @@ -801,7 +801,6 @@ esp_scsi et1011c et131x ethoc -etnaviv eurotechwdt evbug extcon-adc-jack diff --git a/debian.aws/config/amd64/config.common.amd64 b/debian.aws/config/amd64/config.common.amd64 index e7f1bb703895..741d66b3ea8a 100644 --- a/debian.aws/config/amd64/config.common.amd64 +++ b/debian.aws/config/amd64/config.common.amd64 @@ -63,7 +63,9 @@ CONFIG_ATA_PIIX=y # CONFIG_CHARGER_SMB347 is not set # CONFIG_COMEDI is not set CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 +# CONFIG_DMA_CMA is not set CONFIG_DMA_VIRTUAL_CHANNELS=m +# CONFIG_DRM_ETNAVIV is not set # CONFIG_DRM_NOUVEAU is not set # CONFIG_FIREWIRE is not set # CONFIG_FPGA is not set diff --git a/debian.aws/config/annotations b/debian.aws/config/annotations index 9f1db26e6b77..9f9fa05b3e3b 100644 --- a/debian.aws/config/annotations +++ b/debian.aws/config/annotations @@ -1489,11 +1489,12 @@ CONFIG_DEVTMPFS note note note # Menu: Device Drivers >> Generic Driver Options >> DMA Contiguous Memory Allocator -CONFIG_DMA_CMA policy<{'amd64': 'n', 'arm64': 'n', 'armhf-generic': 'y', 'armhf-generic-lpae': 'n', 'i386': 'n', 's390x': 'n'}> -CONFIG_CMA_SIZE_MBYTES policy<{'armhf-generic': '16'}> -CONFIG_CMA_ALIGNMENT policy<{'armhf-generic': '8'}> +CONFIG_DMA_CMA policy<{'amd64': 'n', 'arm64': 'y', 'armhf': 'y', 'i386': 'n', 's390x': 'n'}> +CONFIG_CMA_SIZE_MBYTES policy<{'arm64': '32', 'armhf': '32', }> +CONFIG_CMA_ALIGNMENT policy<{'arm64': '8', 'armhf': '8', }> # -CONFIG_DMA_CMA note +CONFIG_DMA_CMA mark note note +CONFIG_CMA_SIZE_MBYTES mark note # Menu: Device Drivers >> Generic Driver Options >> DMA Contiguous Memory Allocator >> Selected region size CONFIG_CMA_SIZE_SEL_MBYTES policy<{'armhf-generic': 'y'}> @@ -1751,7 +1752,8 @@ CONFIG_DRM_STM_DSI policy<{'armhf': 'm'}> CONFIG_DRM_STI policy<{'armhf': 'n'}> CONFIG_DRM_VC4 policy<{'arm64': 'm'}> CONFIG_DRM_VC4_HDMI_CEC policy<{'arm64': 'y'}> -CONFIG_DRM_ETNAVIV policy<{'armhf-generic': 'm'}> +CONFIG_DRM_ETNAVIV policy<{'amd64': 'n', 'arm64': 'm', 'armhf': 'm', 'i386': 'n', 'ppc64el': 'n', 's390x': 'n'}> +CONFIG_DRM_ETNAVIV_THERMAL policy<{'arm64': 'y', 'armhf': 'y'}> CONFIG_DRM_ETNAVIV_REGISTER_LOGGING policy<{'armhf-generic': 'n'}> CONFIG_DRM_ARCPGU policy<{'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm'}> CONFIG_DRM_HISI_HIBMC policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'i386': 'm', 'ppc64el': 'm'}> diff --git a/debian.aws/config/arm64/config.common.arm64 b/debian.aws/config/arm64/config.common.arm64 index 2caf7cea232f..8cb2571bf46a 100644 --- a/debian.aws/config/arm64/config.common.arm64 +++ b/debian.aws/config/arm64/config.common.arm64 @@ -63,7 +63,9 @@ CONFIG_CHARGER_SBS=m CONFIG_CHARGER_SMB347=m CONFIG_COMEDI=m CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 +CONFIG_DMA_CMA=y CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_DRM_ETNAVIV=m CONFIG_DRM_NOUVEAU=m CONFIG_FIREWIRE=m CONFIG_FPGA=m diff --git a/debian.aws/config/config.common.ubuntu b/debian.aws/config/config.common.ubuntu index 8dafe2a1d057..49c71998de92 100644 --- a/debian.aws/config/config.common.ubuntu +++ b/debian.aws/config/config.common.ubuntu @@ -1286,7 +1286,7 @@ CONFIG_CMA_ALIGNMENT=8 CONFIG_CMA_AREAS=7 # CONFIG_CMA_DEBUG is not set # CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SIZE_MBYTES=16 +CONFIG_CMA_SIZE_MBYTES=32 # CONFIG_CMA_SIZE_SEL_MAX is not set CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_MIN is not set @@ -1975,7 +1975,6 @@ CONFIG_DMAR_TABLE=y CONFIG_DMA_ACPI=y # CONFIG_DMA_API_DEBUG is not set CONFIG_DMA_BCM2835=y -CONFIG_DMA_CMA=y CONFIG_DMA_DECLARE_COHERENT=y CONFIG_DMA_DIRECT_REMAP=y CONFIG_DMA_ENGINE=y @@ -2062,7 +2061,6 @@ CONFIG_DRM_DP_CEC=y CONFIG_DRM_DUMB_VGA_DAC=m CONFIG_DRM_DW_HDMI=m CONFIG_DRM_DW_HDMI_CEC=m -CONFIG_DRM_ETNAVIV=m CONFIG_DRM_ETNAVIV_THERMAL=y CONFIG_DRM_FBDEV_EMULATION=y # CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set