Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp162605rwd; Wed, 24 May 2023 16:02:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5fv/xIA2GXjQTOcM5TCP2lyhBlwVKOUyPZ3gBvUYHUvMlOaZ1uPpNql+TmbWJJf/cQ20w6 X-Received: by 2002:a05:6a00:13a9:b0:63d:2f13:200 with SMTP id t41-20020a056a0013a900b0063d2f130200mr5326460pfg.16.1684969347373; Wed, 24 May 2023 16:02:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684969347; cv=none; d=google.com; s=arc-20160816; b=RVnzMk/HdYSAF4MYG/pyQajGTMVM0asP2eASC7GN/1hJSF0Ql/viJ2bVgiIxb4y84N 1xiMT9Q+wM8CB9YOQYFuFgoOzzRFH57Aiv9Am/nNXnRY1fst4ukAlVijQYHhltsBFVR5 gsKClStwmPd+jyjC9FoyT+H+GsuoWPz4SFrJE54aftp580CfBEixNb42wFcYHmf35Zev jFxthw8RhpsEY5hPuS9RPwUHf/dN14J126CEe9PYjOGSsQppd8ZInX6WvPrPQ2f5GfjB ROHVrw1Xf4dHH04CBR/mOxCSL450X92RA7vfp0RXGmctIsAJFBh/UGJHriOdAeee7xf7 W4RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JPoOjhwLXPec5N/XBPFEXrHrpaUF5lpSnwsns99mvPk=; b=hB2fA8mQVhUdQAw+q1mxPAat7as38fYLmBHUA22MGk+zAg6X94fjv/N8kM9ewsVSgy WFiJdvBbRZFGb/aB5TilAP9aK3VwZmsV1f3bQPuZRsZLbsipMpFEHCold/bXSJBxa79U tL7wYs7gdegAPYGsm6OCu1EM3XeqQTEYx28J94XH9gMQ1mkuWjsgGe9Blzs3ePhWNDbt LDv4Qfm3jMxf3hGEUnGUwRVqbxL/XnOXUVt8FzL8h73Ii6K8hnl9sd7V+EqHZmK6lFme NgSBgKxDh0/CBMmMVftb/NTA0wey1RdXkUjpzN6UiYX5HoR0oxGUZIYbUhETnPPklIEK Z6GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="V/EXWyUS"; 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 g71-20020a636b4a000000b00502f0d858e9si7529448pgc.174.2023.05.24.16.02.13; Wed, 24 May 2023 16:02:27 -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="V/EXWyUS"; 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 S238488AbjEXWpK (ORCPT + 99 others); Wed, 24 May 2023 18:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238442AbjEXWpI (ORCPT ); Wed, 24 May 2023 18:45:08 -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 F2F8090 for ; Wed, 24 May 2023 15:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684968264; 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=JPoOjhwLXPec5N/XBPFEXrHrpaUF5lpSnwsns99mvPk=; b=V/EXWyUSflBB0qvnJ4quQdVCq4LC6STnCnl9sPUJE6ztKCTDAXJfMA+BaB8neyfm/Maxq6 NAUnmgA19Qsq9saMYGQGnwAgtLzJvGUa3OS9FonvvN1IJTjcxEu8Wcc8baVDZjZsvOfp7A KcG07qOugxW02lHBwJl3eHLa4sXQouY= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-dJeOY7hmNjKbj6EYJX4rOw-1; Wed, 24 May 2023 18:44:15 -0400 X-MC-Unique: dJeOY7hmNjKbj6EYJX4rOw-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-3f386bb966cso2529331cf.1 for ; Wed, 24 May 2023 15:44:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684968255; x=1687560255; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JPoOjhwLXPec5N/XBPFEXrHrpaUF5lpSnwsns99mvPk=; b=Lri2b1Usnc07HyzO0TABEfO4HsA5scf2atx3XfNvht6b6kIXGzwi/UXjGEQ3vjjXne HXwrlRoYX2GZ9gdbIclGeJF78cVmBOi1fTXJ9SNjbpEVcxrEPm8x5KoqcNkjXkjHNcMh MkhEi5NSSr7Qv0QskHkSTf5UBGepCbfoOf684x7Tjr6ZuAOCAdMoUn1ORTyik1EvtD8l XLZKWtaYX4S+wxACuYNesL8zj6rV7yrpM0d8KgAB3RvVsi3XDZbbIqV37Lp74L3RTMxc R84ANT9CJWaniUFBaJwd0l5sfcT4fIvl+VetdJt/fU+11n/NAxSPr+sarWwnkiyU/r+T xSxQ== X-Gm-Message-State: AC+VfDzHtUl5+a9aVLoHoN2SPKVoQ+ZMw2Bh4zZPPw5ccgSowlCIhSfe tyb6UhAVrXAzv8WQLW83EWOrLNp0ZGwhTTb3P8FSlQeC/OLnHPhJC6iWSBr+6mm8O+BFkj2gdRc Y1onOcEUNItdakKZVIWkrHwrZ X-Received: by 2002:a05:620a:2b92:b0:75b:3a99:241c with SMTP id dz18-20020a05620a2b9200b0075b3a99241cmr3995852qkb.7.1684968254996; Wed, 24 May 2023 15:44:14 -0700 (PDT) X-Received: by 2002:a05:620a:2b92:b0:75b:3a99:241c with SMTP id dz18-20020a05620a2b9200b0075b3a99241cmr3995817qkb.7.1684968254738; Wed, 24 May 2023 15:44:14 -0700 (PDT) Received: from x1n (bras-base-aurron9127w-grc-62-70-24-86-62.dsl.bell.ca. [70.24.86.62]) by smtp.gmail.com with ESMTPSA id m5-20020ae9e005000000b007578b6d060bsm3573906qkk.126.2023.05.24.15.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 15:44:14 -0700 (PDT) Date: Wed, 24 May 2023 18:44:11 -0400 From: Peter Xu To: Hugh Dickins Cc: Andrew Morton , Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 15/31] mm/userfaultfd: allow pte_offset_map_lock() to fail Message-ID: References: <68a97fbe-5c1e-7ac6-72c-7b9c6290b370@google.com> <49d92b15-3442-4e84-39bd-c77c316bf844@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <49d92b15-3442-4e84-39bd-c77c316bf844@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 Hi, Hugh, On Sun, May 21, 2023 at 10:07:35PM -0700, Hugh Dickins wrote: > mfill_atomic_install_pte() and mfill_atomic_pte_zeropage() treat > failed pte_offset_map_lock() as -EFAULT, with no attempt to retry. Could you help explain why it should be -EFAULT, not -EAGAIN or -EEXIST? IIUC right now if pte existed we have -EEXIST returned as part of the userfault ABI, no matter whether it's pte or thp. IMHO it may boil down to my limited knowledge on how pte_offset_map_lock() is used after this part 2 series, and I assume the core changes will be in your 3rd series (besides this one and the arch one). Please shed some light if there's quick answers (IIUC this is for speeding up collapsing shmem thps, but still no much clue here), or I can also wait for reading the 3rd part if it'll come soon in any form. Thanks, -- Peter Xu