From patchwork Fri Oct 7 23:41:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 13001547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE020C433F5 for ; Fri, 7 Oct 2022 23:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jXGduL2MdyHxu1goWmbGpGIu9i28yHJQ/A+HQWr/3kg=; b=HK6tAG0TIuWkYB eAZZ4mVvgySZ1iYYOwHUGZzo/HmHcODXSR9BrxLx/rm5jSeOYiCRUc8ohjui1xm7PTkKgJ7hVi9o7 LJxH0qVrByVqlx3O3AKK015uYKOij0iQXnxolMDTzvzhPy7VWKJUFihbFE0s4E9Wx+nFawK8DFxhi cRe2npxHSR6lLtfKHqQ6hzGgyioEJ/p8GwZF/EHW+23QUrwASxp0TD6TEVGM6ezDPPZBbgKFYWm5F hURt4AJGfEReWiMWK008anfyj7tn2kdfCxkWoLKW0JEekqtDINNLFpeGtOlMyqY0lfs/nprCv04ed v3YiGTNzPn99I584EevQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogwyx-00Azfs-0I; Fri, 07 Oct 2022 23:42:19 +0000 Received: from out2.migadu.com ([188.165.223.204]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogwyl-00AzYT-F9 for linux-arm-kernel@lists.infradead.org; Fri, 07 Oct 2022 23:42:09 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1665186123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=8gk76JRqjPqMzkfoKmXkwFy1NQbQ1ICsFcGyhsYU5J0=; b=v/KiVBTDrWvVn+101zSX+yMTklfcDfKoScD2vAnF13qg7YbpUTAe7yBbTpCiXRoBauVVq6 u4QQyKsJyiZHkTVlzpoDMQoMyEwou6RWbcC1OnniQKHbu1HXKUNwF+xXqNFfUlc4wCga/N PJeClBh18muHjmvswN/3a9VXwgI940o= From: Oliver Upton To: Marc Zyngier , James Morse , Alexandru Elisei Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Ricardo Koller , David Matlack , Quentin Perret , kvmarm@lists.linux.dev, Oliver Upton Subject: [PATCH v3 0/2] KVM: arm64: Limit stage2_apply_range() batch size to largest block Date: Fri, 7 Oct 2022 23:41:49 +0000 Message-Id: <20221007234151.461779-1-oliver.upton@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221007_164207_696156_22B361BF X-CRM114-Status: UNSURE ( 6.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Continuing with MMU patches to post, a small series fixing some soft lockups caused by stage2_apply_range(). Depending on the paging setup, we could walk a very large amount of memory before dropping the lock and rescheduling. Applies to kvmarm-6.1. Tested with KVM selftests and kvm-unit-tests with all supported page sizes (4K, 16K, 64K). Additionally, I no longer saw soft lockups with the following: ./dirty_log_perf_test -m -2 -s anonymous_thp -b 4G -v 48 v2: https://lore.kernel.org/kvmarm/20220926222146.661633-1-oliver.upton@linux.dev/ v2 -> v3: - Just use the largest block size as the batch size (Marc) Oliver Upton (2): KVM: arm64: Work out supported block level at compile time KVM: arm64: Limit stage2_apply_range() batch size to largest block arch/arm64/include/asm/kvm_pgtable.h | 18 +++++++++++++----- arch/arm64/include/asm/stage2_pgtable.h | 20 -------------------- arch/arm64/kvm/mmu.c | 9 ++++++++- 3 files changed, 21 insertions(+), 26 deletions(-) base-commit: b302ca52ba8235ff0e18c0fa1fa92b51784aef6a