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 55999ECAAD5 for ; Fri, 2 Sep 2022 20:34:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC5E580129; Fri, 2 Sep 2022 16:34:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C754880120; Fri, 2 Sep 2022 16:34:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3D4880129; Fri, 2 Sep 2022 16:34:06 -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 A641A80120 for ; Fri, 2 Sep 2022 16:34:06 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6BB131207FA for ; Fri, 2 Sep 2022 20:34:06 +0000 (UTC) X-FDA: 79868297292.16.AF48D03 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id B6E3B1A0048 for ; Fri, 2 Sep 2022 20:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662150845; 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=bzVIoDE74/+VAO67vvsLdiWzQ40qTEUZOmIctAhfkOk=; b=KVsT724BQG33tn2ebtcdWme3wcyxJS48I+2Tdz7E88JG4B7JvFon+PsNSLaSSDQElvFkNb OJ2ew0jvzrAsDlz+1KnHD20CEPqx7WyIyWoVsJKSlTpHASH1SH1T6/eSBJlVGom90jOH45 1rAj9H29Nt0LrarQvfdth/0Zs7whuoY= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-182-4zUI6FAtNp6JLhu3_3pSOg-1; Fri, 02 Sep 2022 16:34:02 -0400 X-MC-Unique: 4zUI6FAtNp6JLhu3_3pSOg-1 Received: by mail-qv1-f71.google.com with SMTP id c1-20020a0cfb01000000b00495ad218c74so2000201qvp.20 for ; Fri, 02 Sep 2022 13:34:02 -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=bzVIoDE74/+VAO67vvsLdiWzQ40qTEUZOmIctAhfkOk=; b=SDYdyVrE7zMA5gt2psLqcU5a4XgKxujdbA5h0/YBadmcPn6UkdiD76YsoAB7i4IYZ/ oZvoptFpUFp6u5V2n00Yn3Y+Pbuc8yQZMWVT1x12fq3Y7t618zguPRXCEFgKMbvNL34S KoVwU05rkJtGhj4/i6Bcotj/C1O5onKALyJy4pNVHXTzKLiis1tuRh4Fhda3mL6Nkoxj qUxP5wVbp/hr4OV+Is2+b98ny/4Go/6sTvZvPVstqddfhmSxlGRjyH92lvDLl4SyxnLL RNxZYDi8On1U3zO7jVy0CRHfUVrXsswtM91vmEQ5RaibciJTL+Isk+NKxUx6X366xrgx 4+TA== X-Gm-Message-State: ACgBeo1wpgyA/gGgBvR1tErmc0LwhAe8iKsOSWFDqol7wBJwS78TIrwg 4ZvCDfgGz5QePgOYe4q0XESvPqleXTkH1pSk+T0Y/HfyyR5tJJl0Hi80SQgnUrzNOdFOs9TbOiY JpKL/0OyFwt0= X-Received: by 2002:a05:6214:f21:b0:498:fada:9416 with SMTP id iw1-20020a0562140f2100b00498fada9416mr27426234qvb.84.1662150841652; Fri, 02 Sep 2022 13:34:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR66IV/RH+gSIrgn9dSAl9c65XLtxRKXEx/Lv53pYBTVoUka8qJRbitW0RQzp8Z/YjcuFDziUA== X-Received: by 2002:a05:6214:f21:b0:498:fada:9416 with SMTP id iw1-20020a0562140f2100b00498fada9416mr27426220qvb.84.1662150841464; Fri, 02 Sep 2022 13:34:01 -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 f22-20020ac87f16000000b0034456277e3asm1664849qtk.89.2022.09.02.13.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 13:34:00 -0700 (PDT) Date: Fri, 2 Sep 2022 16:33:59 -0400 From: Peter Xu To: Yang Shi Cc: david@redhat.com, kirill.shutemov@linux.intel.com, jhubbard@nvidia.com, jgg@nvidia.com, hughd@google.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: gup: fix the fast GUP race against THP collapse Message-ID: References: <20220901222707.477402-1-shy828301@gmail.com> MIME-Version: 1.0 In-Reply-To: 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=1662150846; a=rsa-sha256; cv=none; b=YeixWnIQxWMPRNfHvxfgAGq0tHGueefPb3Sf6y3t0fXQDxIb9kULntDVVPJTDnX51OuhSe UIPFqdXCJ52si8AfomTwfCSSjUcKIJl+M1XADYLZJwBTM/PPIj7KD1ALIuWUzKWzrCUYGW N488asEBRUdtwm+lCkZ3wc9OvasunJA= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KVsT724B; spf=pass (imf19.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662150846; 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=bzVIoDE74/+VAO67vvsLdiWzQ40qTEUZOmIctAhfkOk=; b=gOl+1jyO2QiK9VD8ZntaEr+x4nG+vdvBALQBb/tuWaFIRnIFIUTaKXRglvOuZMbFYH8aT1 WA9ZySFA66B7Qt1e/xMhw7PWFpBOG5GiT8/w9Rw1Z+Hh/X93p4JzXeGKzXtmGcVgGvHZRo EVlX9x6//aXVDIOxEJe2j09IGTQVsuc= Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KVsT724B; spf=pass (imf19.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Stat-Signature: w35nfaebt5zzp18mmg6xf9c5m89okjdx X-Rspamd-Queue-Id: B6E3B1A0048 X-Rspamd-Server: rspam11 X-HE-Tag: 1662150845-24171 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 10:45:20AM -0700, Yang Shi wrote: > > How about another patch to remove the ppc impl too? Then it can be a two > > patches series. > > BTW, I don't think we could remove the ppc implementation since it is > different from the generic pmdp_collapse_flush(), particularly for the > hash part IIUC. > > The generic version calls flush_tlb_range() -> hash__flush_tlb_range() > for hash, but the hash call is actually no-op. The ppc version calls > hash__pmdp_collapse_flush() -> flush_tlb_pmd_range(), which does > something useful. One thing I found interesting (and also a bit confused..) is that the ppc code used the name flush_tlb_pmd_range() to "flush tlb range in pte level", which is kind of against the tlb API design.. The generic tlb API has a very close function called flush_pmd_tlb_range() which is only used to do pmd-level flushing, while here the ppc version of flush_tlb_pmd_range() is actually flush_tlb_range() in the generic API. Agreed that it may worth having a look from ppc developers. -- Peter Xu