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 61B35ECAAD3 for ; Thu, 1 Sep 2022 18:35:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0B1480040; Thu, 1 Sep 2022 14:35:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96BC98000D; Thu, 1 Sep 2022 14:35:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6101C80041; Thu, 1 Sep 2022 14:35:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4152E8000D for ; Thu, 1 Sep 2022 14:35:55 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0B39A140697 for ; Thu, 1 Sep 2022 18:35:55 +0000 (UTC) X-FDA: 79864370670.03.C7C43AE Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf24.hostedemail.com (Postfix) with ESMTP id C3C72180072 for ; Thu, 1 Sep 2022 18:35:53 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id t11-20020a17090a510b00b001fac77e9d1fso3228614pjh.5 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=Gnbgk6iEX4WihSSMHHoD0pH0cdcgG1dtSoKYOGy4mXyAw0XeNREdavtIDWiexIy4dc 4zw6arHVu9b0yGQdBtPKt69XXi5nxJOiCBSQXmidXEmtUjpfpQUxpRpyYPhHFSFUpqws 74Z4My0tjPH8Oe+xAD/dF3qzpudZvwqC786OvQTetl9LI0+BeMItvgWqYA2kyvy9XqKw kvQGHZL1iY7TvJfAg+JTnL+FoV0QObn4FGjq4IydLRLmB7r2idDAUOg2jF0ZhKmR8Usx 6VPOoXv7O0YkBjrbMOf/tPflJ9N2nLuoVHxpMUT8iAqcGSIqvD6HYLDjyACPR883/O5r yBxg== X-Gm-Message-State: ACgBeo0BQrZyD3ktB8xkFmuTx4V0xeEiVosruaH+FI8oOOoYk1iZXWXm TjBfLGCCQ8KXl4yKCpmF6J/HmpjmR+O10wKtQ0Y= X-Google-Smtp-Source: AA6agR6jyk3LtLKA0zuMZAbutNLOKIGcWvcAQrbLS5YsEwKlseOYfH6newzvEimzGqoNaJ7zZOGgg7cioZHVttTcziA= 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662057353; 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=AX3fzHYEs7u6kdVK4Qs+eOMX44O84bf2e3kDlHfwCsw=; b=PKRtiPq23JFENSojTfNhEbE9cGBrKfN3U43gW+SIaQkAOx9MpDOLUbyCKKJOM+oy+tJ7xx rr8eB9RIUyW0F7ymWO80/UPg4FJy1SmB3mgLNpwvF2KVXhuF/JGIb3dRjpEC+K9uKYvgjw JedD0LK6rfZg9awCOukj13HDtulUAeQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HzzGeH9P; spf=pass (imf24.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662057353; a=rsa-sha256; cv=none; b=r7PTPTAq06Yde6aqBVW8wGZoryM/cmmpU4eUmmXgNgFLKRPBGkaJ2gEEctd6AFYEfAb7w0 R11O5B53jZvRIepJfQ591W/KOSGzWsIR1keVkTM9Np/u73O8Fqwe38XsWyJ0Q5ZumWmGNR LjUzXDFQjHnRWtTLNeMHcdV7RJ3DPRY= Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HzzGeH9P; spf=pass (imf24.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Stat-Signature: jifyaw4u1o86nexe3q8n9f5rjxoqbfng X-Rspamd-Queue-Id: C3C72180072 X-Rspamd-Server: rspam05 X-HE-Tag: 1662057353-153951 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 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 >