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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B2E4C433EF for ; Mon, 27 Jun 2022 15:29:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98C3F8E0001; Mon, 27 Jun 2022 11:29:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 93CB06B0072; Mon, 27 Jun 2022 11:29:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 803728E0001; Mon, 27 Jun 2022 11:29:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 70A7F6B0071 for ; Mon, 27 Jun 2022 11:29:53 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2E95B20885 for ; Mon, 27 Jun 2022 15:29:53 +0000 (UTC) X-FDA: 79624401066.13.A45CA62 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf05.hostedemail.com (Postfix) with ESMTP id 031A4100016 for ; Mon, 27 Jun 2022 15:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656343791; 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: in-reply-to:in-reply-to:references:references; bh=h1/trUpMNLnNGyxwx4diC/Ki/CZLIBKxLxUT9R2hz7A=; b=ZolJ/8IonSKWTE/g4XrGF9Nz9tot6da63w181aiJOV2bN/CcDz3x0PSu3CuuNxvLBQEGzD xpNbn0nB5d+BK0mnJQtJ1NdDjnk+6H/Te0d9PX0MpAHiJKaAcJZMJvn/SJV3Ytp1YVzUUx iolnPZ8H1PEyR+Dzg72qpzLLUyKMLUE= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-399-qxq-Mw7RMx2zcajBTTmh-Q-1; Mon, 27 Jun 2022 11:29:50 -0400 X-MC-Unique: qxq-Mw7RMx2zcajBTTmh-Q-1 Received: by mail-io1-f72.google.com with SMTP id f1-20020a056602070100b00674f8035487so5813105iox.17 for ; Mon, 27 Jun 2022 08:29:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=h1/trUpMNLnNGyxwx4diC/Ki/CZLIBKxLxUT9R2hz7A=; b=YiQlBV0WEZex92r7x216yEdeEaknv3KvF4V1FzWwtkRTXOinhPTWVFMKtb/7sEqu3v eAWui7RJTYEjxztb8HSIrDjeoFzzG6th3OS0MuWmPuEbS67vKzlyLBH6j8uB1dz9XwPu KYIuITQFQGaxvOIiyzz+cyMAXGlr5M8l6VXfX7jafbsG56LtmwfwJQeshj0Rtr3u8qZo Y3O63l/aSpB8p3OaOOdkPSTuTAFrrVnnJN8WiFWepoO0jVLHfKLm2j7EoxKHSGIKdpHk mB7Li2gPgwX3O0XwdNTuRf0PdrlXbMolbAuKIZA6L7HexUBs/nXBks3UsKmJBlJu7CWf BWQA== X-Gm-Message-State: AJIora/v0NqaK1UdKzQ+EU3C5iToaBvtfX2rIJwUWblUs+EWsafVoyO9 dYlSYLRH4+PofeO2UWqQpXu2eYc/MdnrchRpVrTdwsghDDSIePtD3ONhdXc8CRuooWPCvPHfO0W KJBKaD0a79sk= X-Received: by 2002:a05:6638:13d5:b0:331:a6f2:3dbf with SMTP id i21-20020a05663813d500b00331a6f23dbfmr8013037jaj.9.1656343789724; Mon, 27 Jun 2022 08:29:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uGpsqgUWS6Ce0E8mwLwamXIm8UbctHTOly4JQ9TWGUiHMN6AjyXmJH3vXAr+/oepx37YDf+Q== X-Received: by 2002:a05:6638:13d5:b0:331:a6f2:3dbf with SMTP id i21-20020a05663813d500b00331a6f23dbfmr8013019jaj.9.1656343789476; Mon, 27 Jun 2022 08:29:49 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id d1-20020a026041000000b00331f63a3dfasm4808082jaf.122.2022.06.27.08.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 08:29:48 -0700 (PDT) Date: Mon, 27 Jun 2022 11:29:47 -0400 From: Peter Xu To: Jason Gunthorpe Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Andrew Morton , David Hildenbrand , "Dr . David Alan Gilbert" , Andrea Arcangeli , Linux MM Mailing List , Sean Christopherson Subject: Re: [PATCH 1/4] mm/gup: Add FOLL_INTERRUPTIBLE Message-ID: References: <20220622213656.81546-1-peterx@redhat.com> <20220622213656.81546-2-peterx@redhat.com> <20220625003554.GJ23621@ziepe.ca> <20220625235904.GK23621@ziepe.ca> MIME-Version: 1.0 In-Reply-To: <20220625235904.GK23621@ziepe.ca> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656343792; a=rsa-sha256; cv=none; b=KcoreNK56eyPc5vj5G6pCr68xg26CEE/od0rRH6WQaF0fCCbcik22lq1OsXZ7yDK4FXFVc i61bgzeEIQ7paQ5ilttvubuaVFCUO1+RdXgkjk+m1RbOY/cQEp6oBBQPsMK/ieB1cECJ4o D77sPfkfpGhpQi8JSI8L35E2RMZ7I/M= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ZolJ/8Io"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf05.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656343792; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=h1/trUpMNLnNGyxwx4diC/Ki/CZLIBKxLxUT9R2hz7A=; b=zd2HS0UTpNSLFRRxkSgRL8xp/Yf629y748cX4MaPuo747zbFQaEcjIcjsaEz0+8a8SyS2J Z+1ro2WDPsOTZWPCjb4kcisZyW/jWXaSUAXGbTuVFiGXZM3VLxj8Mph2zbb8us1VfKAbKk Y4xnZFeOaBzVnkO+Zru20mkLvxIc8W0= X-Rspam-User: X-Stat-Signature: ecwthb9apncr8bt7byc8q43yu8wa3cj1 X-Rspamd-Queue-Id: 031A4100016 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ZolJ/8Io"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf05.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1656343791-992290 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Jun 25, 2022 at 08:59:04PM -0300, Jason Gunthorpe wrote: > On Fri, Jun 24, 2022 at 09:23:04PM -0400, Peter Xu wrote: > > If to go back to the original question with a shorter answer: if the ioctl > > context that GUP upon a page that will never be with a uffd context, then > > it's probably not gonna help at all.. at least not before we use > > FAULT_FLAG_INTERRUPTIBLE outside uffd page fault handling. > > I think I would be more interested in this if it could abort a swap > in, for instance. Doesn't this happen if it flows the interruptible > flag into the VMA's fault handler? The idea makes sense, but it doesn't work like that right now, afaict. We need to teach lock_page_or_retry() to be able to consume the flag as discussed. I don't see a major blocker for it if lock_page_or_retry() is the only one we'd like to touch. Say, the only caller currently is do_swap_page() (there's also remove_device_exclusive_entry() but just deeper in the stack). Looks doable so far but I'll need to think about it.. I can keep you updated if I get something, but it'll be separate from this patchset. Thanks, -- Peter Xu