Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752969AbbBWWsl (ORCPT ); Mon, 23 Feb 2015 17:48:41 -0500 Received: from mail-bl2on0135.outbound.protection.outlook.com ([65.55.169.135]:21185 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751861AbbBWWsj (ORCPT ); Mon, 23 Feb 2015 17:48:39 -0500 Message-ID: <1424731710.4698.15.camel@freescale.com> Subject: Re: [PATCH 2/2] powerpc/kvm: Limit MAX_VCPUS for guests running on RT Linux From: Scott Wood To: Alexander Graf CC: Bogdan Purcareata , , , , , , Date: Mon, 23 Feb 2015 16:48:30 -0600 In-Reply-To: <54E73A64.5020608@suse.de> References: <1424251955-308-1-git-send-email-bogdan.purcareata@freescale.com> <1424251955-308-3-git-send-email-bogdan.purcareata@freescale.com> <54E73A64.5020608@suse.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.7-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:2:5800:3f7:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: BY1PR00CA0033.namprd00.prod.outlook.com (25.160.102.43) To BY2PR0301MB0728.namprd03.prod.outlook.com (25.160.63.18) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0728; X-Bulk-Sender: Mark as legitimate X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005003);SRVR:BY2PR0301MB0728; X-Forefront-PRVS: 0496DF6962 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(199003)(51704005)(24454002)(377424004)(40100003)(50226001)(122386002)(2950100001)(87976001)(50466002)(110136001)(46102003)(86362001)(36756003)(19580395003)(105586002)(103116003)(23676002)(5820100001)(33646002)(64706001)(62966003)(77156002)(97736003)(19580405001)(101416001)(68736005)(42186005)(50986999)(106356001)(76176999)(92566002)(47776003)(99106002)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0301MB0728;H:[IPv6:2601:2:5800:3f7:12bf:48ff:fe84:c9a0];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0728; X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2015 22:48:35.8991 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0728 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1860 Lines: 42 On Fri, 2015-02-20 at 14:45 +0100, Alexander Graf wrote: > > On 18.02.15 10:32, Bogdan Purcareata wrote: > > Due to the introduction of the raw_spinlock for the KVM openpic, guests with a > > high number of VCPUs may induce great latencies on the underlying RT Linux > > system (e.g. cyclictest reports latencies of ~15ms for guests with 24 VCPUs). > > This can be further aggravated by sending a lot of external interrupts to the > > guest. > > > > A malicious app can abuse this scenario, causing a DoS of the host Linux. > > Until the KVM openpic code is refactored to use finer lock granularity, impose > > a limitation on the number of VCPUs a guest can have when running on a > > PREEMPT_RT_FULL system with KVM_MPIC emulation. > > > > Signed-off-by: Mihai Caraman > > Signed-off-by: Bogdan Purcareata > > Reviewed-by: Scott Wood > > I don't think this patch is reasonable to take upstream. I agree (or at least, I don't think the raw lock conversion should be separated from the vcpu limitation that makes it clear that it's a temporary hack), because it ought to be fixed properly. > If we have a > latency issue, whoever spawned KVM VMs made a decision to spawn such big > VMs. I disagree. The point of PREEMPT_RT is to prevent the majority of kernel code from excessively impacting latency. When you start using raw locks you're stepping outside those bounds and need to ensure that you don't hand things within those bounds (which includes userspace) the ability to excessively impact latency. -Scott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/