Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1484186rdb; Mon, 2 Oct 2023 10:52:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjM6cD6jJV5jTiICb4BSedL9ART+IDsFuVzckYI7c/W0FH29r7GLK3nvXLkTizjuiE7I0V X-Received: by 2002:a17:90a:d30c:b0:26d:4312:17e5 with SMTP id p12-20020a17090ad30c00b0026d431217e5mr9707897pju.6.1696269121370; Mon, 02 Oct 2023 10:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696269121; cv=none; d=google.com; s=arc-20160816; b=lfiaVI+FXDJ1vsoHT+13nC2XzI5eoJT29gkT/NdRN86MYPrLd+e7l5Dw4cyz1fA39S sukONSHUl8UcI9u2pm51haY/jE7mINFYXsofh+NxwuI/zP3Uche+BTAIfTEjluJaD61x LJe9yJd2RG+vcMxwt0/eZf1oPM3FhMNtzsE0GxMOI0V2p/bMpBdBLZqv57TBir0bcSKO NLq07bFWdINUWLFbOPjPq6xmWvtisQ1Szr/TreJwxR5sAUK9vgX7FFyKi1PffSTUvhKb jVRAjru9S5mKWyZgw9alcu61vTztUVlTa15lfwcfm5MYDUmUhX2kgsz98I4r6IT5LTPM /GjQ== 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:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=JyF1pnZ6qkmXa4qXcGzIhipUJOWvJDJpCe2ELEDUqZE=; fh=u2QaK0Fii6BNUYtN6nfYX99hGuP/PDKe2n+jbXcdk6w=; b=x5BrXI+saLCdUl4/vMfso7XESOGcnwk33UyZduclk6xx9TK+5rgPfvhq19RuhV4u/Y lsiVGT7MGV2+F8IgD92woX9PSl2V79glyEA+VEgyPUSmlgK8lFwrTy34EDaYq0lm8Cio HT7d52ZB1nEX9zxSkyF1nY3N8fxgU5iLXWhfGUmwGtzQ4RQXqAUFRRJk7wv3m+HBfQ1y as4pO0Jslp1SAlQ2Gm82PewbTh4X5xlB79nMCdM6Yi3Zj4/VCTmMVCbIc0R8jzohNJAp jGKSrlziCmuGNSP+7CfJVTNRkCSK69PHSWsb5llYQiQDGj6s7hvfMYaQiiGIzpE0IQmM PlQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Tx/PcI0a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id nu3-20020a17090b1b0300b00279054d0408si8762154pjb.95.2023.10.02.10.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 10:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Tx/PcI0a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7E6278097170; Mon, 2 Oct 2023 07:43:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237831AbjJBOns (ORCPT + 99 others); Mon, 2 Oct 2023 10:43:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237823AbjJBOnr (ORCPT ); Mon, 2 Oct 2023 10:43:47 -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 22BADB0 for ; Mon, 2 Oct 2023 07:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696257775; 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=JyF1pnZ6qkmXa4qXcGzIhipUJOWvJDJpCe2ELEDUqZE=; b=Tx/PcI0aIJ6Dj5VWmraIIglYrfDpvJ7WUKFO16hFtZ2Za6O5jmxKHp83Z/tU6x1pOJ10iw 4QUzpW9Q8zjR7oet9hjTKzR4XfcswZ02QenYP/NBzAxRylQLktHaWkrm8rCfwCfPDqzeYp vLqgqA1zydudr1vHgFJ5ev7Y+gobuRo= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-86-VyBoLyQYNY67slij8-PGRQ-1; Mon, 02 Oct 2023 10:42:54 -0400 X-MC-Unique: VyBoLyQYNY67slij8-PGRQ-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-325a78c806eso2026906f8f.1 for ; Mon, 02 Oct 2023 07:42:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696257773; x=1696862573; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JyF1pnZ6qkmXa4qXcGzIhipUJOWvJDJpCe2ELEDUqZE=; b=lkAv+/S17Z/19el+ZjTNcQoSlyb/1E7HEf6frEo81DZ7KXsPK3XxkNnEDhs4qdhXCP fxiqURHp75CceZbIeDq/z5SbqbCpZpveM1Pko04LZQvM6W4BUAsb5l2GNA6yIcue1rif ugDCSbWAYip+Haqn4w0g1v6stk6X66oEPpEyqt4Lxp+zoUXjDvhhOVqVS3oscVBO2rP+ +gSIZWrolf9lkaRyCWLX9XyCgBEM7wINg2YGA41IoDZEWBgIzUCLe7Zn+HamUB3YyzKj Emtxsb/K7mRxPMptU2nhTsHUVVwDYYPwdf+7c9uDT3osK5/u/AznIbBJ0M+W/u8CcC4d 88IA== X-Gm-Message-State: AOJu0YyKbGFf/diuNi0ZXSWVLN8kCv0/KMOJVrXmo2Lw9Qo7HBGICGaM RYv1PV4UJGApbuRoGxsMjlg5S6MZrnT3nP+K+WT2DB7dK/GxCqz72bOatopWsJVo6GL1Qq5+KZp Y/Ho8GqnXLvGeYWdSXLm+wew2 X-Received: by 2002:a05:6000:1d0:b0:322:707e:a9fd with SMTP id t16-20020a05600001d000b00322707ea9fdmr8891402wrx.34.1696257772808; Mon, 02 Oct 2023 07:42:52 -0700 (PDT) X-Received: by 2002:a05:6000:1d0:b0:322:707e:a9fd with SMTP id t16-20020a05600001d000b00322707ea9fdmr8891355wrx.34.1696257772272; Mon, 02 Oct 2023 07:42:52 -0700 (PDT) Received: from ?IPV6:2003:cb:c735:f200:cb49:cb8f:88fc:9446? (p200300cbc735f200cb49cb8f88fc9446.dip0.t-ipconnect.de. [2003:cb:c735:f200:cb49:cb8f:88fc:9446]) by smtp.gmail.com with ESMTPSA id j6-20020a5d6046000000b003259b068ba6sm7972412wrt.7.2023.10.02.07.42.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Oct 2023 07:42:51 -0700 (PDT) Message-ID: <27f177c9-1035-3277-cd62-dc81c12acec4@redhat.com> Date: Mon, 2 Oct 2023 16:42:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 1/3] userfaultfd: UFFDIO_REMAP: rmap preparation To: Suren Baghdasaryan , akpm@linux-foundation.org Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, shuah@kernel.org, aarcange@redhat.com, lokeshgidra@google.com, peterx@redhat.com, hughd@google.com, mhocko@suse.com, axelrasmussen@google.com, rppt@kernel.org, willy@infradead.org, Liam.Howlett@oracle.com, jannh@google.com, zhangpeng362@huawei.com, bgeffon@google.com, kaleshsingh@google.com, ngeoffray@google.com, jdduke@google.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com References: <20230923013148.1390521-1-surenb@google.com> <20230923013148.1390521-2-surenb@google.com> Content-Language: en-US From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230923013148.1390521-2-surenb@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 02 Oct 2023 07:43:54 -0700 (PDT) On 23.09.23 03:31, Suren Baghdasaryan wrote: > From: Andrea Arcangeli > > As far as the rmap code is concerned, UFFDIO_REMAP only alters the > page->mapping and page->index. It does it while holding the page > lock. However folio_referenced() is doing rmap walks without taking the > folio lock first, so folio_lock_anon_vma_read() must be updated to > re-check that the folio->mapping didn't change after we obtained the > anon_vma read lock. I'm curious: why don't we need this for existing users of page_move_anon_rmap()? What's special about UFFDIO_REMAP? -- Cheers, David / dhildenb