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 465C7ECAAD3 for ; Thu, 1 Sep 2022 16:40:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D60B78000E; Thu, 1 Sep 2022 12:40:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D10638000D; Thu, 1 Sep 2022 12:40:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD8158000E; Thu, 1 Sep 2022 12:40:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A7B7A8000D for ; Thu, 1 Sep 2022 12:40:43 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 643501605B1 for ; Thu, 1 Sep 2022 16:40:43 +0000 (UTC) X-FDA: 79864080366.01.495324E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 0DCDE1C005E for ; Thu, 1 Sep 2022 16:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662050442; 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=A/nMIHK86arro9noAagcH6dFQdyi31EgjkmWhoBXsjo=; b=JvCbHA38cUUZPupCFOAhO8+iQn4cb5J43T3gzzuC0Umqw6oBYM5isPHMGdlmeLn4z62bGA DmYny5/G8COD9smUDCtVB+g5q5QHM+9uKkdGLD4w6nOPLmcH3SCHBleEMclGLG3Kqci8mi 6PewQf+bRHADyMK6cD25+8Md8aaef+g= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-622-i16TFqjjMzqpJjFyiNKc1A-1; Thu, 01 Sep 2022 12:40:41 -0400 X-MC-Unique: i16TFqjjMzqpJjFyiNKc1A-1 Received: by mail-qk1-f199.google.com with SMTP id h8-20020a05620a284800b006b5c98f09fbso15016168qkp.21 for ; Thu, 01 Sep 2022 09:40:41 -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=A/nMIHK86arro9noAagcH6dFQdyi31EgjkmWhoBXsjo=; b=0GYPvtb18RdMU7iyYh14gxc8DjUwAA1dK/2RejQHjHNR1I1RVzwiLlkpCRC8DS0l9C y/z8g8z9J7YqLRSZZfkINVOaZ6JAW+k5psnetSBIfNh7WoqB5yl8lwc9xlx38EcFEUL8 RhIggaFip5qdXRZScbtzhy5m/kpH9n82Ed4cJNQlAN2EWj18U9gemHXFEz9HSpG9iX5N Q3gwsWfVOj4rDTPUC1he3JsJHdmP/nweySexnPE0Ih3iXzyFcVsHf/hTJcNM+w6JawWh P0qAM88Nw0itQGd3F1hiydtsuKecajInF4ZomZyMSJvvyWTVAKAO1i13fW1WiGKkfbDJ zEJw== X-Gm-Message-State: ACgBeo0bQMzqXPb7Nia0aUU5QfeUqse1n2fXyoUyHLfptHnBbgfRe5rt jXdk0Mm5ijnawOOCLVxMfMR5qr9VcUKrVcnBge35vUd1kD/CVh4bTwxSw2XOLMTgDccce6CqfJ5 cYJkgpiaNDXw= X-Received: by 2002:a05:6214:246b:b0:497:28b7:d411 with SMTP id im11-20020a056214246b00b0049728b7d411mr24701941qvb.128.1662050441198; Thu, 01 Sep 2022 09:40:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR6MS53lmxGSQT61ajcBBr0tov+zWwrNh1g766JGRTCtjpX/L+p5GXxooVqt8Z75SFx2xdREzg== X-Received: by 2002:a05:6214:246b:b0:497:28b7:d411 with SMTP id im11-20020a056214246b00b0049728b7d411mr24701907qvb.128.1662050440899; Thu, 01 Sep 2022 09:40:40 -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 fg15-20020a05622a580f00b0034456277e3asm10657307qtb.89.2022.09.01.09.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 09:40:40 -0700 (PDT) Date: Thu, 1 Sep 2022 12:40:38 -0400 From: Peter Xu To: David Hildenbrand 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 Subject: Re: [PATCH v1] mm/gup: adjust stale comment for RCU GUP-fast Message-ID: References: <20220901072119.37588-1-david@redhat.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=1662050443; a=rsa-sha256; cv=none; b=MQi3ylN3s5dDPxtaoGIOkqPIkiyjcOWmv0hv8Z3dYUW7XWs5TbGvflUt7vkecgRM6F4P30 xuTitLtT8VliRQ++pbvPSm6Us2OhdcAaqsMr5M2jm+kuqccXph13Fn1iP9jfUGVLbiJUSO FmQ5JQV1lR6HJo8KzMWfyHqv/GKZK+0= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=JvCbHA38; spf=pass (imf20.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=1662050443; 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=A/nMIHK86arro9noAagcH6dFQdyi31EgjkmWhoBXsjo=; b=V5Hqtuhn1jSEo5OZvnvb/Z7HjII0HlQ0lcKUxtGNK5ze4A0Vn/CP2VTsXfiDtLITTLI5nC LafREMZXeYbjwmDHL712akLaR4evVmxqgvyTwfKZcxT3F1jdazhepY6T1cBJg9amQQQT4D iWo0uwcd5nGI5t78zTSP+LZkEOBEOwU= X-Rspam-User: X-Stat-Signature: kwwkpw4bhbe3tdoaoqfwxwb513yb74f4 X-Rspamd-Queue-Id: 0DCDE1C005E X-Rspamd-Server: rspam06 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=JvCbHA38; spf=pass (imf20.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-HE-Tag: 1662050442-168595 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 01, 2022 at 06:34:41PM +0200, 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. Ah OK. Shall we still keep some "IPI broadcast" information here if we're modifying it? Otherwise it gives a feeling that none needs the IPIs. It can be dropped later if you want to rework the thp collapse side and finally remove IPI dependency on fast-gup, but so far it seems to me it's still needed. Or just drop this patch until that rework happens? > > > > > 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. Yeah from an initial thought that looks valid to me. It'll also allow pmdp_collapse_flush() to be dropped too, am I right? -- Peter Xu