From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0082571ED4 for ; Wed, 28 Feb 2024 18:44:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709145863; cv=none; b=RssDUuouxPDXfZGI67a6Q25Bd/PUAmcRMV0YmGMlBD9s2WgeWBe2MN5+25pUr1iw5R2pJADQXa+Z3e3VMTWZ9yKoUjvO6I1OnNagSslJZ9F0HlOKsj3NovMZG8E3anY2nf3aeF6JNL0PzjBQPEAuJ3+4EhgDaF13hAoh0q+Ql4o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709145863; c=relaxed/simple; bh=6Qt3twI1TqKynZ6Hn2RINsIkpOlzZSp2WOWjAHhOShQ=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Acpq+rqweZ02z5wZkm+uwr8wI6B7gTLGqkZoKS1p2zbjVDqePN5Tt19PrcnNVBqTDuUZgOBgJqyQIWTF492OOuYSua/yo57EnQdnE7omwPQHUI3+NpcrmDQdjtczMKef3iSkbvJP7TgAnr16Jzt62pQ20V14gWeiUo97eYe1prg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=AeB1GBFU; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="AeB1GBFU" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41SHHq0K010622; Wed, 28 Feb 2024 18:43:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=qcppdkim1; bh=bSo4+TpCIpKA9iK73ekA6 ybmOXrnbL0luk3/aCyRvoY=; b=AeB1GBFU3sw8vhRbnKYXxCqKG14kR9yXz6rm6 Ud4b/y6NBZau3Onf0TQAeok9MWEXpa0ty6Qt1tu5r8nQ1zTEVebLdgWEiP4QfTGw R2SycslKjHpLHT/ODlo82PFad11vnBlCneXbay6Q2aQw33SZtNRdc0rcVIwi81xA 5vB1XkjkeT7DPj47+aWN6Ts99BppABMPWMqNY4kgAL9jCG+AAGq8Zv5baJxLCQvq 5yj5ZUvSBBSWVlSVlarAAY81QvzyIHnR/b1vPaypHpnt5AEcLk4fysgOmnWLcoYC FM6Xfm8kzomGMFegH78eAqxfbrL2Iv3+rtd0qN7VM6sEC1VAQ== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wj1d9sk6c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 18:43:29 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41SIhSir023355 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 18:43:28 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 28 Feb 2024 10:43:27 -0800 Date: Wed, 28 Feb 2024 10:43:27 -0800 From: Elliot Berman To: Quentin Perret CC: David Hildenbrand , Matthew Wilcox , Fuad Tabba , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: Re: folio_mmapped Message-ID: <20240228103842643-0800.eberman@hu-eberman-lv.qualcomm.com> Mail-Followup-To: Quentin Perret , David Hildenbrand , Matthew Wilcox , Fuad Tabba , kvm@vger.kernel.org, kvmarm@lists.linux.dev, pbonzini@redhat.com, chenhuacai@kernel.org, mpe@ellerman.id.au, anup@brainfault.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, seanjc@google.com, viro@zeniv.linux.org.uk, brauner@kernel.org, akpm@linux-foundation.org, xiaoyao.li@intel.com, yilun.xu@intel.com, chao.p.peng@linux.intel.com, jarkko@kernel.org, amoorthy@google.com, dmatlack@google.com, yu.c.zhang@linux.intel.com, isaku.yamahata@intel.com, mic@digikod.net, vbabka@suse.cz, vannapurve@google.com, ackerleytng@google.com, mail@maciej.szmigiero.name, michael.roth@amd.com, wei.w.wang@intel.com, liam.merwick@oracle.com, isaku.yamahata@gmail.com, kirill.shutemov@linux.intel.com, suzuki.poulose@arm.com, steven.price@arm.com, quic_mnalajal@quicinc.com, quic_tsoni@quicinc.com, quic_svaddagi@quicinc.com, quic_cvanscha@quicinc.com, quic_pderrin@quicinc.com, quic_pheragu@quicinc.com, catalin.marinas@arm.com, james.morse@arm.com, yuzenghui@huawei.com, oliver.upton@linux.dev, maz@kernel.org, will@kernel.org, keirf@google.com, linux-mm@kvack.org References: <20240222141602976-0800.eberman@hu-eberman-lv.qualcomm.com> <40a8fb34-868f-4e19-9f98-7516948fc740@redhat.com> <20240226105258596-0800.eberman@hu-eberman-lv.qualcomm.com> <925f8f5d-c356-4c20-a6a5-dd7efde5ee86@redhat.com> <755911e5-8d4a-4e24-89c7-a087a26ec5f6@redhat.com> <99a94a42-2781-4d48-8b8c-004e95db6bb5@redhat.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: BFRptV3lhNexvrzyysi2BMBXycZH1YyV X-Proofpoint-ORIG-GUID: BFRptV3lhNexvrzyysi2BMBXycZH1YyV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=630 mlxscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 impostorscore=0 spamscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402280147 On Wed, Feb 28, 2024 at 01:34:15PM +0000, Quentin Perret wrote: > Alternatively, the shared->private conversion happens in the KVM vcpu > run loop, so we'd be in a good position to exit the VCPU_RUN ioctl with a > new exit reason saying "can't donate that page while it's shared" and > have userspace use MADVISE_DONTNEED or munmap, or whatever on the back > of that. But I tend to prefer the rmap option if it's workable as that > avoids adding new KVM userspace ABI. > You'll still probably need the new exit reason saying "can't donate that page while it's shared" if the refcount tests fail. Can use David's iouring as example of some other part of the kernel has a reference to the page. I can't think of anything to do other than exiting to userspace because we don't know how to drop that extra ref. Thanks, Elliot