Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1055389rwe; Thu, 1 Sep 2022 11:44:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR6wkC3xtDCY1S8mQEP/LiS7do/hDJkwgVnx4PyGFowUvYkzXAsYOPGcyDTWfcQrjmI1+T/2 X-Received: by 2002:a17:902:c949:b0:172:d2cd:a9b2 with SMTP id i9-20020a170902c94900b00172d2cda9b2mr32537687pla.38.1662057866015; Thu, 01 Sep 2022 11:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662057866; cv=none; d=google.com; s=arc-20160816; b=NntEBaVGp3sY0jR9ovZNZygxOVHb9RuG2/b2A4Nwg2TeBppbGO8a8cyjHA0PBisek8 dPDWD7YThybyBzEFzDMEBLJ3vAy4YZRZ/XSWu3qGZ1zHCcmPJNUxyFhvhKu6m3s/ZEqn OqmqSXysmg8K+V21Tl7L2bg45iEDCevZFhDeWaOIDUDx8tNPz8VOAeZxS2zL8OmXA/xt 3ZYZD4ou4zgYuNur2ACrQlF00J5Fkgd3QDLSjzwS7hQwO1jO6Z0o7N+MuJf8/zWCDwIC R0BNAIKb0Xs9TpvHyZO+jqXyB36WDHi5PqjYyM8+LZbNG3lZqRS+q2PrvfW9XuPAuxRC rxMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AX3fzHYEs7u6kdVK4Qs+eOMX44O84bf2e3kDlHfwCsw=; b=qRbTSbsw2LI8C6amS4Ku0Y6acEwe/zvF9bK38txxzt/ue3AnOq+XEHgAvlfU15RinA DEZM4GHqsu42Q0QppfNrp1ZMMiIYYj82+RQyhGeXz47b9uTmXhkNVkdloFDAx1arQQ9T 8ssPaxVmGPKd+LyTtEoXi65+zozmDxSMh3YCiLrnJVBVUfeYKchmy96AgLgVtWUCMSzl DP0jR61FBqwzW5oTUKTjeLmyQuA/XrrAXStiIxnp1opUhpqAP0kxsT4yr/aGf9xaZ5UG M0N8byhVoKbxxWFnyCLIqvQXA03y8FDBMxdJyAf115LwLYbZU5H2SKdd0ZmRmeh6b92h X6yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HzzGeH9P; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a84-20020a621a57000000b0053836f22d73si11824819pfa.214.2022.09.01.11.44.11; Thu, 01 Sep 2022 11:44:26 -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=@gmail.com header.s=20210112 header.b=HzzGeH9P; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234675AbiIAShR (ORCPT + 99 others); Thu, 1 Sep 2022 14:37:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234594AbiIASgs (ORCPT ); Thu, 1 Sep 2022 14:36:48 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF976844E8 for ; Thu, 1 Sep 2022 11:35:53 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id fa2so10286104pjb.2 for ; Thu, 01 Sep 2022 11:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=AX3fzHYEs7u6kdVK4Qs+eOMX44O84bf2e3kDlHfwCsw=; b=HzzGeH9PUSqbJBaIv0M6qWaufMd1sypFAfiavflRADgj+pQSIkXGfY3gh586qtu/Uf mbSzlvTgPdZdhJ/vypXl9jl2fsePGaXz4B260Kpx27oX8skWydJhgxA5h+lus50POgtB SYb9KqmTkTv/dgafq36/WAjYr9de12J7pW2+Z/nwPiehZO7np0nLLs60eXGxkbhmVVpB wOm81GfpOQdOg46aJsaqjX+A6StnYuku/MUIGq/n5XqZPYHJ0zjsbNQ4iHsbIBiiETA1 oZfJODrsT7tBTR2hjj5ptCWVPx9X5jdLVQgfIVqtodOX8FKoM+dlwry0pwHhypylixRT 0VTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=AX3fzHYEs7u6kdVK4Qs+eOMX44O84bf2e3kDlHfwCsw=; b=EnW2HaB62nNC3+EpkvJjSJAwN0uwat3wUREQkl8CC0ej1/Mk+Zrdl+sIpMzqYaI6XW uipBcBfAyO/UXgZTzWxB/I6eOPY+n9W3wyo2OJVfDirjYWDsXXB5agJMdWbRmtG4IKlb bUl1frQHE6IUUc0UAJBBfyNblFeLi+kMByb9o4ggHmpaen67x3FekQxBq4waCkBVo3NG Np3ktv8Lb6FyiyuoM4l6QG/q/j4FzPl2ZnPok20P6aeQCb5RnTw203oyhB4em4N+O6v0 TJvspQPxwqv3lSiwHN+J8sfF1kogfEMGHYHs1bUYpapZluXKEJR36x5oOBe651Uiewc9 aqdw== X-Gm-Message-State: ACgBeo28/JNKgLla5E4COhIj+8gIsMUGrpdBqGako77Db7UuRwVbKmae CRFpPHybL5pRG3WGn4Ny9s1Jh8/daCCAMZkgNtA= X-Received: by 2002:a17:902:e5c3:b0:175:534:1735 with SMTP id u3-20020a170902e5c300b0017505341735mr15867766plf.87.1662057352663; Thu, 01 Sep 2022 11:35:52 -0700 (PDT) MIME-Version: 1.0 References: <20220901072119.37588-1-david@redhat.com> In-Reply-To: From: Yang Shi Date: Thu, 1 Sep 2022 11:35:40 -0700 Message-ID: Subject: Re: [PATCH v1] mm/gup: adjust stale comment for RCU GUP-fast To: Peter Xu Cc: David Hildenbrand , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 On Thu, Sep 1, 2022 at 11:07 AM Peter Xu wrote: > > On Thu, Sep 01, 2022 at 10:50:48AM -0700, Yang Shi wrote: > > Yeah, because THP collapse does copy the data before clearing pte. If > > we want to remove pmdp_collapse_flush() by just clearing pmd, we > > should clear *AND* flush pte before copying the data IIRC. > > Yes tlb flush is still needed. IIUC the generic pmdp_collapse_flush() will > still be working (with the pte level flushing there) but it should just > start to work for all archs, so potentially we could drop the arch-specific > pmdp_collapse_flush()s, mostly the ppc impl. I'm don't know why powperpc needs to have its specific pmdp_collapse_flush() in the first place, not only the mandatory IPI broadcast, but also the specific implementation of pmd tlb flush. But anyway the IPI broadcast could be removed at least IMO. > > This also reminded me that the s390 version of pmdp_collapse_flush() is a > bit weird, since it doesn't even have the tlb flush there. I feel like > it's broken but I can't really tell whether something I've overlooked. > Worth an eye on. I don't know why. But if s390 doesn't flush tlb in pmdp_collapse_flush(), then there may be data integrity problem since the page is still writable when copying the data because pte is cleared after data copying. Or s390 hardware does flush tlb automatically? > > -- > Peter Xu >