From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E67AC433EF for ; Tue, 5 Oct 2021 13:26:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62BB460F11 for ; Tue, 5 Oct 2021 13:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234866AbhJEN2Z (ORCPT ); Tue, 5 Oct 2021 09:28:25 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:8622 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234103AbhJEN2Y (ORCPT ); Tue, 5 Oct 2021 09:28:24 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 195D5aPR030991; Tue, 5 Oct 2021 09:26:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=sE+jmMJrpKu3c07k9/lx4goRWbVThzC1XRpesW6sRyA=; b=FOKySmPyn5tJv7JuqME8L5JQeNwyVK1bYVw24AKSgVeQHsKxWAS626oyaoMV/nIm7GLP G87WQ0n3M+D1updRh8GY54yRExQmpG6err6rmkXw25p45tQL633wzk2JEeRN6usxjAWP g3AraBRsA/aqcTmjpkqcD2m/VIJHuAPUBvCEs1ZI2dyjmMPoBSXDy4rKTERV52h2Palu SSpt1eslcDnHG1gVHP6DD47CBvnyy57KtQiUXUI229KBg34RNC5yznS3yHXyxIlD/fhT 96c/xlpoD9mqCh57HRSdDW1gYhGGHna4qupo8R7TuQyNxhxc7rNws1Uc2H8y19tezBR4 Ow== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bgpych0r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Oct 2021 09:26:32 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 195D5hmd031480; Tue, 5 Oct 2021 09:26:32 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bgpych0q4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Oct 2021 09:26:32 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 195DDBja015037; Tue, 5 Oct 2021 13:26:29 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03ams.nl.ibm.com with ESMTP id 3bef2a2s3n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Oct 2021 13:26:29 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 195DQOCe49348870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Oct 2021 13:26:24 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1365A406F; Tue, 5 Oct 2021 13:26:23 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A2AAA404D; Tue, 5 Oct 2021 13:26:23 +0000 (GMT) Received: from [9.145.45.132] (unknown [9.145.45.132]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 5 Oct 2021 13:26:23 +0000 (GMT) Message-ID: Date: Tue, 5 Oct 2021 15:26:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH v5 00/14] KVM: s390: pv: implement lazy destroy for reboot Content-Language: en-US To: Claudio Imbrenda , kvm@vger.kernel.org Cc: cohuck@redhat.com, borntraeger@de.ibm.com, thuth@redhat.com, pasic@linux.ibm.com, david@redhat.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Ulrich.Weigand@de.ibm.com References: <20210920132502.36111-1-imbrenda@linux.ibm.com> From: Janosch Frank In-Reply-To: <20210920132502.36111-1-imbrenda@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 3nAXINJR6Us8crhYMrZ3JiACMP5OZZP_ X-Proofpoint-ORIG-GUID: HaVw2bjXPeXRNuxOT4zOKXbdqfVn9OwF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-05_02,2021-10-04_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 malwarescore=0 clxscore=1015 phishscore=0 impostorscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110050078 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/20/21 15:24, Claudio Imbrenda wrote: > Previously, when a protected VM was rebooted or when it was shut down, > its memory was made unprotected, and then the protected VM itself was > destroyed. Looping over the whole address space can take some time, > considering the overhead of the various Ultravisor Calls (UVCs). This > means that a reboot or a shutdown would take a potentially long amount > of time, depending on the amount of used memory. > > This patchseries implements a deferred destroy mechanism for protected > guests. When a protected guest is destroyed, its memory is cleared in > background, allowing the guest to restart or terminate significantly > faster than before. > > There are 2 possibilities when a protected VM is torn down: > * it still has an address space associated (reboot case) > * it does not have an address space anymore (shutdown case) > > For the reboot case, the reference count of the mm is increased, and > then a background thread is started to clean up. Once the thread went > through the whole address space, the protected VM is actually > destroyed. > > This means that the same address space can have memory belonging to > more than one protected guest, although only one will be running, the > others will in fact not even have any CPUs. > > The shutdown case is more controversial, and it will be dealt with in a > future patchseries. > > When a guest is destroyed, its memory still counts towards its memory > control group until it's actually freed (I tested this experimentally) @Christian: I'd like to have #1-3 in early so we can focus on the more complicated stuff.