Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp710917rwd; Tue, 16 May 2023 06:55:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xHFru0NHXetOIKbaWPXn4wKeyTKROsCpmnoXkQUqsgSnsZP+7ZkFWUSHL2vzM/ErE1TFj X-Received: by 2002:a17:90b:19d3:b0:253:27d2:78a0 with SMTP id nm19-20020a17090b19d300b0025327d278a0mr1926485pjb.15.1684245348589; Tue, 16 May 2023 06:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684245348; cv=none; d=google.com; s=arc-20160816; b=WviwnRFCWelg560bZ5N+7Mkt/J85J8ybyEDluNbxqXoOpV4nWxPNDetOfzunY2mQsV xBGd/P5DYqIELFjEvjOE2e7elUVBvnC0+QkFTeiZR8OBpAzdrgOW5I67XEQNJbU7SY65 V8Q1BsNo3n3MlEdVmuwY4MCqo9wrbZi+lWL+JedZPZnRbWU8d93shoMdCQ3hKaZ+Tp8G K84GsWwCF1X/7PMrgVvnTFoBis15ZHbdElGduZ7jiREivogSbxQScTxs/IFQKU8es34t m0tOK3ZPNt7WRxgB8KACC6xDT3KBkWxnyk1IOgE9SMYw3tL6+hrfGM92QBX/avEvyjyD RLXQ== 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=H4WKCdbuZXrmowcWv+oxI/osiNdEe2yY+VSOSYJSfVU=; b=DPFeQ8Xm7cVG8yOh9hs8pntTRdmezxZumAYNe5r2VGbL/SrhgR+DwqSHIX2UgNxH/H /t/C5rrHvFsSBHL/RlomLZ+zO066OCjoVvvQUPd8vmxqJ37duCJGj8MrkKDafIdVmQQX nrbXMyMRFdoroGaLZtUemzQL91o4eE9QKSdiohAv3vu+QEgtTBpj2K3L1oWNi95VZY7Y mVTYZH1p0Q6GRNyA5aUHIguMuT2y1CLqCKT3sDzbnXApJp0VvgnJfuDpQ0CbBBQO1s3L TZZOcympyB41qnuTzMCOMx6VG+toq0UhB52gYxsZBJkvSsH0UrmCbn+xbOXXcT/bDzkR ZrVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=D73n14xk; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d63-20020a17090a6f4500b0025049be6267si1800099pjk.133.2023.05.16.06.55.33; Tue, 16 May 2023 06:55:48 -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=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=D73n14xk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233278AbjEPNUC (ORCPT + 99 others); Tue, 16 May 2023 09:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233126AbjEPNT7 (ORCPT ); Tue, 16 May 2023 09:19:59 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2617A35BB for ; Tue, 16 May 2023 06:19:55 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6439bf89cb7so2515408b3a.0 for ; Tue, 16 May 2023 06:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1684243194; x=1686835194; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=H4WKCdbuZXrmowcWv+oxI/osiNdEe2yY+VSOSYJSfVU=; b=D73n14xkNZ0zYWAfu+D9/zERZmjsGnclrNclfwbrnYvXdKydCAM6XXUxP2m6AKjw9k b7DrpnkxpJ+Z0aRuB3wun0x8dtBoeijqC+32ligWep5AlzcsoQswye5v5kmJhwM0ckEA /tspQmFWZkOAij0vir4X0awGwbkH6EYQMvHsyeoW0ReJ0MQRswPBdAOPp34BH79xhbTX yOY3DrZlG1QVbDvp0qJJFISARYyqIIZYBZ88Ihs1Nu3fXbLciLK7P4pu6Id6D7XVt6uX V0ErAmZ5pTUZ8vWdFAiCssJprIc1xiBwRAzMgywt7JCnYpOr6xyDTxcb9X/ZLpGgsQqb G7WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684243194; x=1686835194; h=content-transfer-encoding:in-reply-to: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=H4WKCdbuZXrmowcWv+oxI/osiNdEe2yY+VSOSYJSfVU=; b=fAKU9Sj2slqXGoNeahcACKvbRxGps50t+SkoNrUpQmJaRJPt03YL0B6H4DFPigawCD V9ZuExLPouWerXt3dDPJT85lUXQtoS/oHg6gnhVbeCLVYkCixBqbVwr16F9YOWJmUU+S VauO0MuWw43GKDASLAFyEKyJ7p8TrVywZOVH+/5PLhJEowmWO80xVCcZA80+WtNOvrY5 TF3jyta7496LGwG11qyaNiDlBfozi3rISrknFeVlck+S4a8qtEtlyvJ9UOSwStgfA6i7 ARHK2ta8DjifyfjZZdnYxKKf4y8SRAihuKcHzIhWszbFuI3JRmd18kFoR3FWc3kBy5RY sPxw== X-Gm-Message-State: AC+VfDwfl4a92mc2xA0tZknQkQEm5m/ByVJUvoBcpsfbpyXD3JWHmrOh HrCOmRZSroLBe1fBKUQMfUO5aQ== X-Received: by 2002:a05:6a00:2790:b0:644:c382:a380 with SMTP id bd16-20020a056a00279000b00644c382a380mr3134121pfb.0.1684243194518; Tue, 16 May 2023 06:19:54 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id a4-20020a62bd04000000b0063d47bfcdd5sm13459476pff.111.2023.05.16.06.19.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 May 2023 06:19:53 -0700 (PDT) Message-ID: Date: Tue, 16 May 2023 07:19:52 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v5 4/6] io_uring: rsrc: delegate VMA file-backed check to GUP Content-Language: en-US To: David Hildenbrand , Lorenzo Stoakes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton Cc: Matthew Wilcox , Pavel Begunkov , io-uring@vger.kernel.org, Jason Gunthorpe , John Hubbard References: <642128d50f5423b3331e3108f8faf6b8ac0d957e.1684097002.git.lstoakes@gmail.com> <40ed22bb-53e3-ddc2-45ca-f0e763f26242@redhat.com> From: Jens Axboe In-Reply-To: <40ed22bb-53e3-ddc2-45ca-f0e763f26242@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 5/16/23 2:25?AM, David Hildenbrand wrote: > On 15.05.23 21:55, Jens Axboe wrote: >> On 5/14/23 3:26?PM, Lorenzo Stoakes wrote: >>> Now that the GUP explicitly checks FOLL_LONGTERM pin_user_pages() for >>> broken file-backed mappings in "mm/gup: disallow FOLL_LONGTERM GUP-nonfast >>> writing to file-backed mappings", there is no need to explicitly check VMAs >>> for this condition, so simply remove this logic from io_uring altogether. >> >> Don't have the prerequisite patch handy (not in mainline yet), but if it >> just moves the check, then: >> >> Reviewed-by: Jens Axboe >> > > Jens, please see my note regarding iouring: > > https://lore.kernel.org/bpf/6e96358e-bcb5-cc36-18c3-ec5153867b9a@redhat.com/ > > With this patch, MAP_PRIVATE will work as expected (2), but there will > be a change in return code handling (1) that we might have to document > in the man page. I think documenting that newer kernels will return -EFAULT rather than -EOPNOTSUPP should be fine. It's not a new failure case, just a different error value for an already failing case. Should be fine with just a doc update. Will do that now. -- Jens Axboe