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 0D980ECAAD5 for ; Mon, 5 Sep 2022 08:02:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30BC9801B7; Mon, 5 Sep 2022 04:02:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BB1B801B3; Mon, 5 Sep 2022 04:02:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18321801B7; Mon, 5 Sep 2022 04:02:25 -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 093F4801B3 for ; Mon, 5 Sep 2022 04:02:25 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id CC327C0D06 for ; Mon, 5 Sep 2022 08:02:24 +0000 (UTC) X-FDA: 79877289408.08.683DC7C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 6373480072 for ; Mon, 5 Sep 2022 08:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662364944; 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=80o6ny7YakZDOnj5vfvOfcJ/mpd+JzIMV0KWiRtG7lU=; b=fJFy4GlBd8BLA2gOWTEELgZ0uyLV8AY738ZP6jInPqMGhEPWDBvDF2ItO5gWNLhadSnFr5 Hc19HEX7A+jNyc0wK+JRHIcxQUETUlhfU7b02//Q+WyO2Zmx7rsUA6MrN9Y/L98ZPYfndW jv0bp4ICaGFkghuRXGElTRsETdJuObQ= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-557-hU4O41SDOyaha7AhEZgdPQ-1; Mon, 05 Sep 2022 04:02:23 -0400 X-MC-Unique: hU4O41SDOyaha7AhEZgdPQ-1 Received: by mail-wr1-f69.google.com with SMTP id t11-20020adfba4b000000b00226eb5f7564so1024541wrg.10 for ; Mon, 05 Sep 2022 01:02:22 -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=80o6ny7YakZDOnj5vfvOfcJ/mpd+JzIMV0KWiRtG7lU=; b=7Lkp/cCpkP47zXGwzK6YURDH90gcp6Ze2rVc+eZrPKWCaHdR84Nc0YCgPMCmPCam3B /QpS0QhVtVhbVbOh0/51EJ+8ahvZ3XuiYnV0N6CLeLHTZfrBgA0NxpoSQvqeRva/quMS mGKIGj+twCYocgiSDpKpZQJlPM2NFT/+6EAXcV9Ssg7ld4HZtGZG9w40RmQWP4jYvUFv Z5kfpKAfGwuIGiyZPfqQMiZGmyDEy3qDLZaLMcXAmn8VuMHOAyCUrZNchMlCxOh3FutU oPiQiZrHt4Viuf3jk1ukRfh0UElSefkp97Y2BPe7PYyXpFiMxYZqH9AKp4xJWUS7dFXt DM1w== X-Gm-Message-State: ACgBeo3E4HM+khrBJwPX3DvhD+zF6IUpDQ8zVO+3mXyYnwE+/ylDJNm2 VhdpcwJZkUuVxFVJMtFNGZY7ihs529CsNgW+z7ci4Tt38LpdDTSJVYLgviGhgVCVD+rS9++/497 bHR1F68hHNl4= X-Received: by 2002:adf:a70b:0:b0:226:e1f5:7889 with SMTP id c11-20020adfa70b000000b00226e1f57889mr16352331wrd.108.1662364941756; Mon, 05 Sep 2022 01:02:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR5VeKqJD8BKp8XpvDhFCd96ryOyjUPbABjHSgBOg/ayTO4RsUpd+w9B1tIi6UZfKUFXOQv4wQ== X-Received: by 2002:adf:a70b:0:b0:226:e1f5:7889 with SMTP id c11-20020adfa70b000000b00226e1f57889mr16352310wrd.108.1662364941490; Mon, 05 Sep 2022 01:02:21 -0700 (PDT) Received: from ?IPV6:2003:d8:2f0d:ba00:c951:31d7:b2b0:8ba0? (p200300d82f0dba00c95131d7b2b08ba0.dip0.t-ipconnect.de. [2003:d8:2f0d:ba00:c951:31d7:b2b0:8ba0]) by smtp.gmail.com with ESMTPSA id a19-20020a1cf013000000b003a5537bb2besm10092257wmb.25.2022.09.05.01.02.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Sep 2022 01:02:20 -0700 (PDT) Message-ID: Date: Mon, 5 Sep 2022 10:02:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v1] mm/gup: adjust stale comment for RCU GUP-fast To: Aneesh Kumar K V , 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; format=flowed Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fJFy4GlB; spf=pass (imf02.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662364944; a=rsa-sha256; cv=none; b=Xx8jsbhl0hI+cGjVmWScWVJgzvmoxrAS0TeRt9dBxPGz++ldxsgECpQpr1OWg0WjpKMz9d 5M3eGM1iQkaSPhSiMHb5Tc6R+mZiIqrAmD0kUEbX0GRQvXwD3x0G06dBvAgEtwN4CjLk4A RvfZmpx9P7j4lDZaVhV/kFjUBCx2GNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662364944; 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=80o6ny7YakZDOnj5vfvOfcJ/mpd+JzIMV0KWiRtG7lU=; b=ZKVRpJ2Xy9MnKz+2VKcsHGCu27xPHumsKpRY7T69mKtSbXfzBYiZJC/Y+crB31+LwssYSy /qNleAMgZ7aFw7gtk1AMHeQLwpDmOx9ZX1vK4oWiCtHlCTQiVIP3On+rCL6SCn+imRBPUV KptG1DpK7/xReIzKG6p297JDE6iDR8w= Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fJFy4GlB; spf=pass (imf02.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-Rspamd-Server: rspam06 X-Stat-Signature: 7kojwa9ubwkuwaxbxn5th1edgapsyotd X-Rspam-User: X-Rspamd-Queue-Id: 6373480072 X-HE-Tag: 1662364944-361609 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 04.09.22 18:49, Aneesh Kumar K V wrote: > On 9/1/22 10:04 PM, David Hildenbrand wrote: >> 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. >> > > Can you point to the other thread ? Sure see https://lkml.kernel.org/r/CAHbLzkqeDAnCdt3q4E2RZw64QEzVaO_pseR3VaoHUhB+rZFcZQ@mail.gmail.com and a resulting patch from that discussion https://lkml.kernel.org/r/20220901222707.477402-1-shy828301@gmail.com -- Thanks, David / dhildenb