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 3111EC54EE9 for ; Fri, 2 Sep 2022 13:53:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2BBF78D0024; Fri, 2 Sep 2022 09:53:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 26B908D001B; Fri, 2 Sep 2022 09:53:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10D3C8D0024; Fri, 2 Sep 2022 09:53:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0255B8D001B for ; Fri, 2 Sep 2022 09:53:17 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D1BC5141019 for ; Fri, 2 Sep 2022 13:53:16 +0000 (UTC) X-FDA: 79867287192.14.075594C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 3ED5820052 for ; Fri, 2 Sep 2022 13:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662126795; 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=+ap6F3iUwG0XwvBvhq4auq9CyYIKW5QhAfRS88ukOs0=; b=KOolh7sBAfFXejkUPlm+YB5oqz1/Sn/Kl25k/VDaGXoOQWm4yC3WSFL2xmehCzyQ7qmvFJ GnX7bLDALVCTMuXG1XP6w63fF8++/4XDiTGTVSI2pgy8FDqticgd5+ubFbtlSckjkQoSJM WcwXkDPJj1mPOdUz58j28TL882M4Ztg= 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_128_GCM_SHA256) id us-mta-607-d2WYQrVSMeypCKfW1Fn2Uw-1; Fri, 02 Sep 2022 09:53:14 -0400 X-MC-Unique: d2WYQrVSMeypCKfW1Fn2Uw-1 Received: by mail-qt1-f198.google.com with SMTP id o21-20020ac87c55000000b00344646ea2ccso1572238qtv.11 for ; Fri, 02 Sep 2022 06:53:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=+ap6F3iUwG0XwvBvhq4auq9CyYIKW5QhAfRS88ukOs0=; b=wzsdHWEpSWM4fyRJbmbCDqtwqzr+lVAHfajz0A+YfbT4ZKIAjgLbH7hNQJEqlpvi8O 7wjlajNNtgQtvebIBLN/HFbQd87fCqNp/errfVNu0knwCHjdya3sUDteMWA9zMKOpXzT +aZl9gKlRL3l3gUbjtJIXZuTe+X94unLLFnidhdYahalk/udCUskgykMRKE9EBaTdZpk fn2uhIm3g1G4yVzHqkzOcc6kfi6nx8oW5ePluontTyiutf9IAaxDDmYXPxN9vkyVDxlR xliOSxTqA1wLTaFsxErolHvBwOXAzplpTLmTcqm4Sx5OfKl5cI256ryTdsmy//FNtrFS UGeA== X-Gm-Message-State: ACgBeo2Ys6+txDp18dFheuvmbrSlzOGG5pJXXY9FW6QsMXvqiji3JR4d 7pEDKAa9QIz7ctEGbD6A/ZVCJp629OTTwG3eYVaDWheZQ9yfpyQGsJabqCWGy2n57qfT1+JWVMf w1W3b4wa7j4g= X-Received: by 2002:a05:6214:5005:b0:472:e6b0:1fb2 with SMTP id jo5-20020a056214500500b00472e6b01fb2mr28503196qvb.124.1662126794266; Fri, 02 Sep 2022 06:53:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR7eXEaiAmq13RGGl+GkCbnlSnbZ4ozlFXTcz8QgSNrp2IcyLtHYanUGZZ1bg6lGbFXp1eBnBg== X-Received: by 2002:a05:6214:5005:b0:472:e6b0:1fb2 with SMTP id jo5-20020a056214500500b00472e6b01fb2mr28503172qvb.124.1662126794029; Fri, 02 Sep 2022 06:53:14 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-35-70-27-3-10.dsl.bell.ca. [70.27.3.10]) by smtp.gmail.com with ESMTPSA id b184-20020a37b2c1000000b006bb6c63114fsm1443338qkf.110.2022.09.02.06.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 06:53:13 -0700 (PDT) Date: Fri, 2 Sep 2022 09:53:11 -0400 From: Peter Xu To: David Hildenbrand Cc: Yang Shi , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A . Shutemov" , "Aneesh Kumar K . V" , Vlastimil Babka , Jerome Marchand , Andrea Arcangeli , Hugh Dickins , Jason Gunthorpe , John Hubbard Subject: Re: [PATCH v1] mm/gup: adjust stale comment for RCU GUP-fast Message-ID: References: <20220901072119.37588-1-david@redhat.com> <2368d91f-8442-076f-f33a-64b51b44825c@redhat.com> MIME-Version: 1.0 In-Reply-To: <2368d91f-8442-076f-f33a-64b51b44825c@redhat.com> 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=1662126796; a=rsa-sha256; cv=none; b=BKGi2NSd8cCqT42Qw2eQh1tXveujK6SDDttaPRMqIa0MEyWob4unjiCMzfYO6fF0bkM8us pf3fN13qsmXBq6Ojg9YgXip15BfcjaX9FE56bwkIb/v9YgZsJlE8p+WD3ADOWuI2Bru8TP hyiUM8QooFvkhGSCAXh3/a+A4ca6d0c= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KOolh7sB; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf03.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662126796; 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=+ap6F3iUwG0XwvBvhq4auq9CyYIKW5QhAfRS88ukOs0=; b=u8Ygmc6RXvE1Pt7SKpdgDNTom/5NDXXOzYeRrA1wCEGIIB9peivych2wAFcy1qDW3WD8J1 NyAjSbYAPtrK5O92IZ+sb4uiWUQeH4EswHQOllq1ZBIJpDxhFRG1jwPgKcXHUFaLaLXxCB TWkaX3LIMMiDSXhyL88piHgN5o08Gu0= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3ED5820052 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KOolh7sB; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf03.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com X-Rspam-User: X-Stat-Signature: t3hjaf8wp1zryx6nmkg95wgnk8xky9ta X-HE-Tag: 1662126796-978919 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 Fri, Sep 02, 2022 at 08:32:42AM +0200, David Hildenbrand wrote: > Note that this matches ptep_get_and_clear() behavior on s390x. Quoting the comment in there: > > > /* > * This is hard to understand. ptep_get_and_clear and ptep_clear_flush > * both clear the TLB for the unmapped pte. The reason is that > * ptep_get_and_clear is used in common code (e.g. change_pte_range) > * to modify an active pte. The sequence is > * 1) ptep_get_and_clear > * 2) set_pte_at > * 3) flush_tlb_range > * On s390 the tlb needs to get flushed with the modification of the pte > * if the pte is active. The only way how this can be implemented is to > * have ptep_get_and_clear do the tlb flush. In exchange flush_tlb_range > * is a nop. > */ Ah, now I kind of see why s390 has its own world of pte operations. But then we really should be noted on reworking the generic tlb code because s390 is always special; people will think the generic tlb API is for tlb but no-op for s390, e.g. anyone optimizes generic tlb flushing it'll probably never apply to s390. Besides performance, hopefully there'll be no case where the tlb change will be functional then it may affect s390 too. But I don't see any since as long as tlb was flushed earlier than the API then it seems always safe. Just trickier. -- Peter Xu