Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7015422rwr; Tue, 2 May 2023 08:23:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7oGBA3+cdZEpSYrL9uxHZZqpLiFtILYcWg+mFEgO9r6xtsg/PwnbIESLEj63SvauFonAae X-Received: by 2002:a05:6a20:1455:b0:ee:d266:32b9 with SMTP id a21-20020a056a20145500b000eed26632b9mr23603721pzi.10.1683040995265; Tue, 02 May 2023 08:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683040995; cv=none; d=google.com; s=arc-20160816; b=faURLZEjAkrJnEOshjZPqzPU/7YsWNO9W2hsAqQY9A9H1oDEO/pW85WHqjku+ODHQZ 8ssE5j6n9E9UPQUXwDPrWZ8SYf4IIVlouqE/G56i/U/fhWo6RXEh6chSaivgwuZfpLd8 fn81yFb7sqChdCRF4I7UaATCxz8EsZYFWfgO5eQtvyP+ORsUfNSF6Xd69SlBUiya5lT+ NtxGBLaF/EQQTWvqR+RifteJPKFK9iSuOionSDECXZET1MG0hgzhYX1prsL2tSxtQIed pz/hoM5noCKkVHhPtSpiDfNdOLsZTWdPBP72jzeTAgxTIawNKlEmYxYCQGw+MeOLiZ3y 8ghg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Hj/s3lR6nyUy7ypNUNRgynKQ3Lb4T+V5ldc2OLzY79g=; b=X+VlHJgyPobiG7iec/55D8ev0LGv5KDNz7CM140jbTpZF64mRkWJGuhw4xcs6+KSyc uaGLio1rDkapAizfem2ftmlfr8RAWIvrxnYrI2/4xTEljr3tQ0e6Q702jCWoWnyO1CV/ h+4adqqJU9gkU3ANmh/k1VRN/KRv/lMAr63w0XO4ftLepVWFNcuB4q+TpXoh3wcnE/+e LV8ikussQPaUpknbfH0YUzBQcIqE0iZuj0BfjTuhUy/MtmPjb8kXHw2ztq91pwiplyw2 c6MpU1l+VjWJT1r6D3E+WxGYnrIAddoqY67KmaJtMo9NdxUOWd/aXbHJfzPrGk/1k34V 61rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=n0wSkVDp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a6540cb000000b00517f7c24652si31150514pgp.890.2023.05.02.08.23.01; Tue, 02 May 2023 08:23:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=n0wSkVDp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234561AbjEBPV2 (ORCPT + 99 others); Tue, 2 May 2023 11:21:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234556AbjEBPVP (ORCPT ); Tue, 2 May 2023 11:21:15 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD9A930FA; Tue, 2 May 2023 08:21:13 -0700 (PDT) Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 342F6tap025185; Tue, 2 May 2023 15:20:35 GMT 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=Hj/s3lR6nyUy7ypNUNRgynKQ3Lb4T+V5ldc2OLzY79g=; b=n0wSkVDp2ncJdEUX4yvqIhZ3wk3W9ANXK1sSt0SqsFg5rur8tzwQFyagFz5f5fW+Wo7S E96G1QcuZ2/fBCiG44qbmvNBD3WCZwa2dJDoNdunzRt2CmFItiEFDmTzr3OIK5FDxojp 9nuFk1Ta/Tjec50WIQaII8yHRXvvxYXHLVQaRyTW5izOToLr/fIR4JE10aq3wm3hg6Sn qrA490r03JbeDtArVhHiEEBG+TtpIjKkwURBo4zC4K497oaPBuAMQT4+WMd6N1wvbdgM Q3rBjMRZLgxK+SehqplsYG+31Zwe7h6D0da4j/vIHI4DATOYuLQAlwmx2orw68HqV4rr Jg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2s3dfc2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 15:20:34 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 342F7LOY027877; Tue, 2 May 2023 15:20:33 GMT Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2s3dfar-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 15:20:33 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 342DOa5S005193; Tue, 2 May 2023 15:20:31 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([9.208.130.97]) by ppma03dal.us.ibm.com (PPS) with ESMTPS id 3q8tv83wsv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 15:20:31 +0000 Received: from smtpav06.wdc07v.mail.ibm.com (smtpav06.wdc07v.mail.ibm.com [10.39.53.233]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342FKSsB31195544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 15:20:28 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB10D58062; Tue, 2 May 2023 15:20:27 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C6A15803F; Tue, 2 May 2023 15:20:23 +0000 (GMT) Received: from [9.60.89.243] (unknown [9.60.89.243]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 15:20:23 +0000 (GMT) Message-ID: Date: Tue, 2 May 2023 11:20:22 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v6 3/3] mm/gup: disallow FOLL_LONGTERM GUP-fast writing to file-backed mappings Content-Language: en-US To: Lorenzo Stoakes , David Hildenbrand Cc: Jason Gunthorpe , Christian Borntraeger , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Jens Axboe , Matthew Wilcox , Dennis Dalessandro , Leon Romanovsky , Christian Benvenuti , Nelson Escobar , Bernard Metzler , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Bjorn Topel , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Brauner , Richard Cochran , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Oleg Nesterov , John Hubbard , Jan Kara , "Kirill A . Shutemov" , Pavel Begunkov , Mika Penttila , Dave Chinner , "Theodore Ts'o" , Peter Xu References: <1d4c9258-9423-7411-e722-8f6865b18886@linux.ibm.com> <1f3231c0-34b2-1e78-0bf0-f32d5b67811d@redhat.com> <25b7aa40-fad0-4886-90b2-c5d68d75d28b@lucifer.local> From: Matthew Rosato In-Reply-To: <25b7aa40-fad0-4886-90b2-c5d68d75d28b@lucifer.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: rfLAjTTulw13fKXOtGjGnm_aAOkuBqYu X-Proofpoint-GUID: oVBVbBc-uzNloCzKkffN5Y7ublV-eC2P X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-02_09,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 suspectscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=611 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020128 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/2/23 11:19 AM, Lorenzo Stoakes wrote: > On Tue, May 02, 2023 at 05:09:06PM +0200, David Hildenbrand wrote: >> On 02.05.23 15:56, Matthew Rosato wrote: >>> On 5/2/23 9:50 AM, Jason Gunthorpe wrote: >>>> On Tue, May 02, 2023 at 03:47:43PM +0200, David Hildenbrand wrote: >>>>>> Eventually we want to implement a mechanism where we can dynamically pin in response to RPCIT. >>>>> >>>>> Okay, so IIRC we'll fail starting the domain early, that's good. And if we >>>>> pin all guest memory (instead of small pieces dynamically), there is little >>>>> existing use for file-backed RAM in such zPCI configurations (because memory >>>>> cannot be reclaimed either way if it's all pinned), so likely there are no >>>>> real existing users. >>>> >>>> Right, this is VFIO, the physical HW can't tolerate not having pinned >>>> memory, so something somewhere is always pinning it. >>> >>> I might have mis-explained above. >>> >>> With iommufd nesting, we will pin everything upfront as a starting point. >>> >>> The current usage of vfio type1 iommu for s390 does not pin the entirety of guest memory upfront, it happens as guest RPCITs occur / type1 mappings are made. >> >> ... so, after the domain started successfully on the libvirt/QEMU side ? :/ >> >> It would be great to confirm that. There might be a BUG in patch #2 (see my >> reply to patch #2) that might not allow you to reproduce it right now. >> > > Yes apologies - thank you VERY much for doing this Matthew, but apologies, I > made rather a clanger in patch 2 which would mean fast patch degrading to slow > path would pass even for file-backed. > > Will respin a v7 + cc you on that, if you could be so kind as to test that? > Sure, will do!