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 80996ECAAD3 for ; Thu, 1 Sep 2022 16:34:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2148E6B00BE; Thu, 1 Sep 2022 12:34:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C41B6B00BF; Thu, 1 Sep 2022 12:34:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08D468000D; Thu, 1 Sep 2022 12:34:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EE5F46B00BE for ; Thu, 1 Sep 2022 12:34:45 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A702014061E for ; Thu, 1 Sep 2022 16:34:45 +0000 (UTC) X-FDA: 79864065330.18.D9BA7F2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 4777D14004B for ; Thu, 1 Sep 2022 16:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662050084; 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=/x6/oc1hUeYoqiDjprB/jyaSxWFouy8LEiafZnROgZo=; b=bRNkPFdTDnSMfpm6fNLpZsq18QNdE+XvKhIjQ3Xl+66jsMa2rSFBXWHelIow6jrthpPWXN leOwsxlx30crXHHFH54nRU8Jgq1tRU8G3KV4k+jWBgIxIYimWoSHl7xboJpxyOM6iRZFNl 6Tb+Kr19RXzL4Exy/rP8HWsc/VmCinc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-499-VcE6y7zEMwuqcSWAo2asyg-1; Thu, 01 Sep 2022 12:34:43 -0400 X-MC-Unique: VcE6y7zEMwuqcSWAo2asyg-1 Received: by mail-wm1-f71.google.com with SMTP id 203-20020a1c02d4000000b003a5f5bce876so1504427wmc.2 for ; Thu, 01 Sep 2022 09:34:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=/x6/oc1hUeYoqiDjprB/jyaSxWFouy8LEiafZnROgZo=; b=I1+XSv52MuMTjHXVODNw3iY63V0ulqAOYRRkKuXQWaNErxCFZu9xHB2IrVlR24/a1+ bcMmYZHGFkotO/UqthgJwv/FO88Hg4WJQrsSgLrCrXzLkdw4742ihKrlyTdTleRPFdh0 15d7huUaskH6iklAxZz38aOd4Vqw4JsEI4ehGLyesPhCGx61UC59V5Nmw74pPypdrwsW chl0C8XLEMSvYiCJI9lYje78lSTlgeblcSK8hoLj2tzeezGrZ1bueF4tqmLo14ArJxOr kJu6sj6FL7fN+O3i0bh3IPZLQn27IzARgOIvW1bV75kUfmWoJQzYYajDEwMqzA3lptuV 3dTA== X-Gm-Message-State: ACgBeo0Gkum/qPlI45eKeCKAxHG7n7dF9twFxH0F8NeuQuBG4udif+U5 Yh3iA4zi8nlmkVByyrgKudhvco/3boAok3EmRgEsgSaPdtHvZCkPIM5QakEPINDwE+tM+N6Gs7h IhwfifFe2DOs= X-Received: by 2002:a05:600c:1e05:b0:3a5:b441:e9c with SMTP id ay5-20020a05600c1e0500b003a5b4410e9cmr10080wmb.24.1662050082593; Thu, 01 Sep 2022 09:34:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR503i6mrjvEw1nYqtyo2ppBA/ekjSu4WAn4G9IZgxO0UmV8sujCH8OwwQL2OAfl2JkWvuO8Lw== X-Received: by 2002:a05:600c:1e05:b0:3a5:b441:e9c with SMTP id ay5-20020a05600c1e0500b003a5b4410e9cmr10065wmb.24.1662050082371; Thu, 01 Sep 2022 09:34:42 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:9e00:fec0:7e96:15cb:742? (p200300cbc7079e00fec07e9615cb0742.dip0.t-ipconnect.de. [2003:cb:c707:9e00:fec0:7e96:15cb:742]) by smtp.gmail.com with ESMTPSA id r1-20020a5d4e41000000b00226d1711276sm14940816wrt.1.2022.09.01.09.34.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Sep 2022 09:34:41 -0700 (PDT) Message-ID: Date: Thu, 1 Sep 2022 18:34:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v1] mm/gup: adjust stale comment for RCU GUP-fast To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A . Shutemov" , Sasha Levin , "Aneesh Kumar K . V" , Vlastimil Babka , Jerome Marchand , Andrea Arcangeli , Hugh Dickins , Jason Gunthorpe , John Hubbard , Yang Shi References: <20220901072119.37588-1-david@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662050085; a=rsa-sha256; cv=none; b=N1CCMvci3+7GEEop0owZYw3S2h9KnhIyAyjJGudOsaQ2NkOqMceDo/WfCTsKXo76lNP8/u MzGTFC19pNUmYL+x5S5u/NY1B147Jz+cTIP7FIElzr2+eMMFc9XIEWpQpNIR0miyAyhyKm LanZ87W80Z2HvYGlpMf43fzMYnOUn2s= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bRNkPFdT; spf=pass (imf23.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@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=1662050085; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/x6/oc1hUeYoqiDjprB/jyaSxWFouy8LEiafZnROgZo=; b=oVekQ2rn26Gf7saI2iFOnWBUKGG7kOHvgSwO9upYAeKJsIM1tp9yvxuVb0S+MRHNjbfX5J 6lQnEZb8n0btRTSjsVRvL5/iOjaHbMZpH56U3FJ6kE1/vsaeYpfZolemTIvtunDGFx0a0y K9gjo9V4AY6SkoEWT1a4TFfD68aRYQA= X-Stat-Signature: mpiwwfjkeycc36eycmw8mzkdxq5xiegk X-Rspam-User: X-Rspamd-Queue-Id: 4777D14004B X-Rspamd-Server: rspam07 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bRNkPFdT; spf=pass (imf23.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1662050085-561106 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 01.09.22 18:28, Peter Xu wrote: > On Thu, Sep 01, 2022 at 09:21:19AM +0200, David Hildenbrand wrote: >> commit 4b471e8898c3 ("mm, thp: remove infrastructure for handling splitting >> PMDs") didn't remove all details about the THP split requirements for >> RCU GUP-fast. >> >> IPI broeadcasts on THP split are no longer required. >> >> Cc: Kirill A. Shutemov >> Cc: Sasha Levin >> Cc: Aneesh Kumar K.V >> Cc: Vlastimil Babka >> Cc: Jerome Marchand >> Cc: Andrea Arcangeli >> Cc: Hugh Dickins >> Cc: Jason Gunthorpe >> Cc: John Hubbard >> Cc: Peter Xu >> Cc: Yang Shi >> Signed-off-by: David Hildenbrand >> --- >> mm/gup.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/mm/gup.c b/mm/gup.c >> index 5abdaf487460..cfe71f422787 100644 >> --- a/mm/gup.c >> +++ b/mm/gup.c >> @@ -2309,9 +2309,8 @@ EXPORT_SYMBOL(get_user_pages_unlocked); >> * >> * Another way to achieve this is to batch up page table containing pages >> * belonging to more than one mm_user, then rcu_sched a callback to free those >> - * pages. Disabling interrupts will allow the fast_gup walker to both block >> - * the rcu_sched callback, and an IPI that we broadcast for splitting THPs >> - * (which is a relatively rare event). The code below adopts this strategy. >> + * pages. Disabling interrupts will allow the fast_gup walker to block the >> + * rcu_sched callback. > > This is the comment for fast-gup in general but not only for thp split. "an IPI that we broadcast for splitting THP" is about splitting THP. > > I can understand that we don't need IPI for thp split, but isn't the IPIs > still needed for thp collapse (aka pmdp_collapse_flush)? That was, unfortunately, never documented -- and as discussed in the other thread, arm64 doesn't do that IPI before collapse and might need fixing. We'll most probably end up getting rid of that (undocumented/forgotten) IPI requirement and fix it in GUP-fast by re-rechecking if the PMD changed. Thanks! -- Thanks, David / dhildenb