Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6885576rwr; Tue, 2 May 2023 06:54:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ46fVspY3ABNlz7k32+nDe6BsBY4ge011BtBpnZMIfR9G9Bku7muqWR4T/+QIKXiJPT8f7Z X-Received: by 2002:a17:903:1cb:b0:1a6:83fa:b370 with SMTP id e11-20020a17090301cb00b001a683fab370mr21601166plh.2.1683035662483; Tue, 02 May 2023 06:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683035662; cv=none; d=google.com; s=arc-20160816; b=0VLM76kTjsCNTe20YGQ+7aKyh0LdwZbmU5FftfG7gsYtJy13vKCE0SE64BVmXuftPz wF/XG/Nv4onn5zn3eZqVge8ltu52Q0Y79f5b3IwnL0RAR69tl1vR1wY658TcSBkfgaaN sVPO1tDoNafT7P7lV3a4hr4MwY/jC8kagIT97mk5WIkkRg0DoYpzcHmEl8U8atFRqctg QzGAF1ql9y2Z2LY1bDzpoRWeEw0nNgTncLZGQkSejXPD2twF7/S2fe3ReWQ0rOVIxeWD raDS3/nypvdLBqcX0s05hXsjRKBVB/br3uXzaVRpy1w8KNHDQgIhBcpGltzrzkHRIDKw 7Bhw== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=J3J2uAw/ly+PNbny+QW1yUQ6DEbuSoPG3Zwu6k/I8hM=; b=RGfyEQuWXbM+4ZCiqorgwY2AaGw/vKkpcdQFmIdTw+UyEAxwRbA/fuSL6eJ5ZynYjv lrdqJTY7VQ4UL3m1YqLn74CM2L1/bpyj5nah/5WNFjIJWXmZMrwq4fXnYP4eDauiuWHa ky/S/RXLTCx4vF+5BNGss3MkavRr4PJ9k8WjIewRLBgtgyh+TMFsdgINm3vLJJpBQaSg vBA2TGdLbsPOFCJTpJJzaxat9AcEZKWI8A/lw9j/ny+o8YVYbSJu7+Z2v+SugMCeJe40 chH8hKEMq5qKwszbcb9YbZD60Ytmt1w4bNVSvzyKYkQc3Tq/xusCU2rDKCTiNzshwOT1 7tpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fozI/mZc"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x18-20020a170902ea9200b001aafb271d16si3994116plb.461.2023.05.02.06.54.03; Tue, 02 May 2023 06:54:22 -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=@redhat.com header.s=mimecast20190719 header.b="fozI/mZc"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234299AbjEBNtE (ORCPT + 99 others); Tue, 2 May 2023 09:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233998AbjEBNtC (ORCPT ); Tue, 2 May 2023 09:49:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E459C65B6 for ; Tue, 2 May 2023 06:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683035269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J3J2uAw/ly+PNbny+QW1yUQ6DEbuSoPG3Zwu6k/I8hM=; b=fozI/mZc92pFL+/0eqXM3yQCfGfxEs2OJ8Ej0lP6qiI7zyeYU2nFSNzP5myYt21CmZ+uws D3VVy/Mqp6z0WQpvHaWNv6ZKXCEfnMswAAwGuiUmb96k3WpdxO+A6pviy+mPMW+TzVfJk8 5KTFTf+mh3BLGDDbB/aab3fzHbr0BVI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-656-m-y9Gdw8P3-JWF-DLiLm-A-1; Tue, 02 May 2023 09:47:48 -0400 X-MC-Unique: m-y9Gdw8P3-JWF-DLiLm-A-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f16f50aeb5so12484045e9.3 for ; Tue, 02 May 2023 06:47:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683035267; x=1685627267; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=J3J2uAw/ly+PNbny+QW1yUQ6DEbuSoPG3Zwu6k/I8hM=; b=V65y5AoUdrwbCsaa4td2wYah0VzhU1re5h8pjM0GVoSdpoNwrYwgBlSUvfhQRNhLAf fG+d94nVtECaBeE+5TU8Rg3uZZUMW3bR5AuySC/gJ8ntaFJ63xfSaB6ktue9YYfVWRZ+ jlMmLvmxKojFmJ7uM7ienqV1rirdPzu1re3Bw00I8cSnMfZOCqYOlRcSLPoCk9a81YpE 0PlIIfZCiJREgs/+YdeoBkSAxppBeVSI5Ha+BR7m1bzbBGI1+nxnYY55EcByQSESTmyw XrLAr0egEM7PF6/80Sw9HXG9OKb1rESGgFwhDmiPa1xvzpQighdY/b7gKnekwz1QgQll Qk4w== X-Gm-Message-State: AC+VfDxMRgZ6PPXi/W53Ga22gELZDrTOzTqEQgcP/nA/PPpwTvRO8KW/ oGGg+ws+0XqLBeng7FggJqOXP9kZOe3JKbDASFs74d9ojU7g86Mum5eElI5kD3Nbqj74Zy+eyLD uWCmKASQ8072Y+NU521766CLn X-Received: by 2002:a1c:7404:0:b0:3f1:92aa:4eb8 with SMTP id p4-20020a1c7404000000b003f192aa4eb8mr13150699wmc.16.1683035267229; Tue, 02 May 2023 06:47:47 -0700 (PDT) X-Received: by 2002:a1c:7404:0:b0:3f1:92aa:4eb8 with SMTP id p4-20020a1c7404000000b003f192aa4eb8mr13150657wmc.16.1683035266844; Tue, 02 May 2023 06:47:46 -0700 (PDT) Received: from ?IPV6:2003:cb:c700:2400:6b79:2aa:9602:7016? (p200300cbc70024006b7902aa96027016.dip0.t-ipconnect.de. [2003:cb:c700:2400:6b79:2aa:9602:7016]) by smtp.gmail.com with ESMTPSA id u19-20020a05600c00d300b003f17eaae2c9sm35746626wmm.1.2023.05.02.06.47.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 May 2023 06:47:45 -0700 (PDT) Message-ID: Date: Tue, 2 May 2023 15:47:43 +0200 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: Matthew Rosato , Jason Gunthorpe Cc: Christian Borntraeger , Lorenzo Stoakes , 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: <7d56b424-ba79-4b21-b02c-c89705533852@lucifer.local> From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 02.05.23 15:43, Matthew Rosato wrote: > On 5/2/23 9:39 AM, David Hildenbrand wrote: >> On 02.05.23 15:36, Jason Gunthorpe wrote: >>> On Tue, May 02, 2023 at 03:28:40PM +0200, David Hildenbrand wrote: >>>> On 02.05.23 15:10, Jason Gunthorpe wrote: >>>>> On Tue, May 02, 2023 at 03:04:27PM +0200, Christian Borntraeger wrote: >>>>> \> > We can reintroduce a flag to permit exceptions if this is really broken, are you >>>>>>> able to test? I don't have an s390 sat around :) >>>>>> >>>>>> Matt (Rosato on cc) probably can. In the end, it would mean having >>>>>>     >>>>>>       >>>>>>     >>>>> >>>>> This s390 code is the least of the problems, after this series VFIO >>>>> won't startup at all with this configuration. >>>> >>>> Good question if the domain would fail to start. I recall that IOMMUs for >>>> zPCI are special on s390x. [1] >>> >>> Not upstream they aren't. >>> >>>> Well, zPCI is special. I cannot immediately tell when we would trigger >>>> long-term pinning. >>> >>> zPCI uses the standard IOMMU stuff, so it uses a normal VFIO container >>> and the normal pin_user_pages() path. >> >> >> @Christian, Matthew: would we pin all guest memory when starting the domain (IIRC, like on x86-64) and fail early, or only when the guest issues rpcit instructions to map individual pages? >> > > 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. > However, per Jason's prior suggestion, the initial implementation for s390 nesting via iommufd will pin all of guest memory when starting the domain. I have something already working via iommufd built on top of the nesting infrastructure patches and QEMU iommufd series that are floating around; needs some cleanup, hoping to send an RFC in the coming weeks. I can CC you if you'd like. Yes, please. -- Thanks, David / dhildenb