Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1227407rwo; Wed, 2 Aug 2023 10:30:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlGn8LmYHQG4eMbmnJZZNeIeGDH+4K2KqUxlldJvFZ0uNJBXJAAhLXUXMGxalv6r2xWgTLfZ X-Received: by 2002:a17:903:24f:b0:1a6:45e5:a26a with SMTP id j15-20020a170903024f00b001a645e5a26amr17373479plh.27.1690997452367; Wed, 02 Aug 2023 10:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690997452; cv=none; d=google.com; s=arc-20160816; b=Aqti59dwFdqat2h9TSAMd32OQ1GnKg2UGuNY53DqFdqMyVZ3MtZhYL4WN/WtsDdglH guvdh4oRAP5fFKL4SCjwz7ZlTtoOPXiUeE5n2DFMw/xrDj81lPu0tKkxZCYqFO/T3E54 kUjHn8t6EVti9oNUz67rQTxYwujIJUK2T4hOuc+Ndl6ahRY0669XiAa1VuW+PJi/wQSP ar1Lf9VN2TDIcqoYFNXnZimR6HTavIHPKfPEAhOkaHW6JVgP2jO15M4kL4hQstOYVQgA TkqP+BMWsurDtzaRgcx9TRHGGkadxQVVu1QLGJSu3q0ISTqd3yWOEwe9w0V8Aa34N0lA vDiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=w+0KWNa1xwubY/Ggk8izjhhZVuMUOv4VLooz2GsqEHg=; fh=xghPUE02LuUasNIQMQsBaFJfrfkEseUvI5gzKytyyI8=; b=bATE9dKRsXFz2UKQyPs7RXa7pIoGGhWjsqRRNHbxZA90quo575AQQehUzTOcBoljLU EfLYw/gZS0veiMla+vg0Hnc46U1fAYY9I40D8TwCRvzKneQWDpaVQlwo0UGW56sEL3mk 4AMSXO5FQjYwouqkQOdL9zpPz6MDC5cc7vaiAhxgrv5R4FT8yNFY7TA4RNRthZGGObla ow+Kv02px9uxPUf70sgsW/fbDLObhKOw46X0LX7MjkSqz17P0EAzBuI1cKvbJNlQGTiD limOxWneSIqzSvc5Wm4KfJy+zELbq4K+49hwQ26nMlkywfpWU6k/hTRzLsuyoSC4Tkaa 7Pow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SWxW84pY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a170903024f00b001bbdd44bbd0si11365397plh.176.2023.08.02.10.30.25; Wed, 02 Aug 2023 10:30:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SWxW84pY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234141AbjHBPNX (ORCPT + 99 others); Wed, 2 Aug 2023 11:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234959AbjHBPNB (ORCPT ); Wed, 2 Aug 2023 11:13:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DACF91BFD for ; Wed, 2 Aug 2023 08:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690989133; 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=w+0KWNa1xwubY/Ggk8izjhhZVuMUOv4VLooz2GsqEHg=; b=SWxW84pY93ZvXp+k57vxxvhS52f/J8VeuKAdimshI5vQJG9fOBK0C6EumwXWAr69VXptGj nV16gglJ77czKbVcSTExE5hsakSo3h1QY5gUHExyXHpYQlRiH+MTTC87wUPMj2Sqb6r8cn AEVSXjJ5y4FfRBQkJvfMzgCowpUvPkU= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-96-442c_iImMLCbMUbGsF0VBA-1; Wed, 02 Aug 2023 11:12:11 -0400 X-MC-Unique: 442c_iImMLCbMUbGsF0VBA-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3fe232ba9e5so19043875e9.2 for ; Wed, 02 Aug 2023 08:12:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690989130; x=1691593930; 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:message-id :reply-to; bh=w+0KWNa1xwubY/Ggk8izjhhZVuMUOv4VLooz2GsqEHg=; b=ao6clywThGRj8s8FuoLOggnomroXqDW12xMQvjJrWrpOyvaOBh2Sf95IbF1EB8Pgy3 PlYLMzWZ5OKqlqKwg0BLRQqKt3pysPLEXTza9wbfuiVofRt8NvWcaYw5+pOLn7l12Nnl /4+ZfRpGAD1RWM2Mb8gY7TgZuzx/PYtgqRQ6e078LP+c+hVSzimax3GpCDOQY6VuwckV KMYWUtNRIakBtLKsH+BoM5iFXdjEP9fJhU4O7pz/MODM88pJZNFNeKrEC4sf0cqmVCOD 9+9M0XA2SPlhVxzzN8hi6tPpHmKtLpWyRex/vVeunVSqVWQ6lirxcJEVWeBs3OCN8CCq f5Lw== X-Gm-Message-State: ABy/qLZV5VOo4C1sISdl/dQ8WC8zXOraVj3DSvsAyylFI3ywX0ufdlas vSFRwiqN9fUMmE7eKLatpotEu8SV/Kam9P4BM6ue+BAGYXybmssdPT41bDyvm0+aQYzskt80ekB BPLILM9vpT2VJDCP5spDswkeS X-Received: by 2002:a5d:595b:0:b0:316:f3cf:6f12 with SMTP id e27-20020a5d595b000000b00316f3cf6f12mr4856138wri.48.1690989130092; Wed, 02 Aug 2023 08:12:10 -0700 (PDT) X-Received: by 2002:a5d:595b:0:b0:316:f3cf:6f12 with SMTP id e27-20020a5d595b000000b00316f3cf6f12mr4856114wri.48.1690989129710; Wed, 02 Aug 2023 08:12:09 -0700 (PDT) Received: from ?IPV6:2003:cb:c70b:e00:b8a4:8613:1529:1caf? (p200300cbc70b0e00b8a4861315291caf.dip0.t-ipconnect.de. [2003:cb:c70b:e00:b8a4:8613:1529:1caf]) by smtp.gmail.com with ESMTPSA id c18-20020a5d4f12000000b0030647449730sm19346391wru.74.2023.08.02.08.12.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Aug 2023 08:12:09 -0700 (PDT) Message-ID: Date: Wed, 2 Aug 2023 17:12:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 1/8] mm/gup: reintroduce FOLL_NUMA as FOLL_HONOR_NUMA_FAULT Content-Language: en-US To: Mel Gorman Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, Andrew Morton , Linus Torvalds , liubo , Peter Xu , Matthew Wilcox , Hugh Dickins , Jason Gunthorpe , John Hubbard , Mel Gorman , Shuah Khan , Paolo Bonzini , stable@vger.kernel.org References: <20230801124844.278698-1-david@redhat.com> <20230801124844.278698-2-david@redhat.com> <20230802150816.aaubbx4t7745lqik@techsingularity.net> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230802150816.aaubbx4t7745lqik@techsingularity.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> Reported-by: liubo >> Closes: https://lore.kernel.org/r/20230726073409.631838-1-liubo254@huawei.com >> Reported-by: Peter Xu >> Closes: https://lore.kernel.org/all/ZMKJjDaqZ7FW0jfe@x1n/ >> Fixes: 474098edac26 ("mm/gup: replace FOLL_NUMA by gup_can_follow_protnone()") >> Cc: >> Signed-off-by: David Hildenbrand > > I agree that FOLL_REMOTE probably needs separate treatment but also agree > that it's outside the context of this patch, particularly as a -stable > candidate so > > Acked-by: Mel Gorman > > I've a minor nit below that would be nice to get fixed up, but not > mandatory. Thanks Mel for taking a look, so I don't mess up once more :) > >> --- >> include/linux/mm.h | 21 +++++++++++++++------ >> include/linux/mm_types.h | 9 +++++++++ >> mm/gup.c | 29 +++++++++++++++++++++++------ >> mm/huge_memory.c | 2 +- >> 4 files changed, 48 insertions(+), 13 deletions(-) >> >> diff --git a/mm/gup.c b/mm/gup.c >> index 2493ffa10f4b..f463d3004ddc 100644 >> --- a/mm/gup.c >> +++ b/mm/gup.c >> @@ -2240,6 +2244,12 @@ static bool is_valid_gup_args(struct page **pages, int *locked, >> gup_flags |= FOLL_UNLOCKABLE; >> } >> >> + /* >> + * For now, always trigger NUMA hinting faults. Some GUP users like >> + * KVM really require it to benefit from autonuma. >> + */ >> + gup_flags |= FOLL_HONOR_NUMA_FAULT; >> + >> /* FOLL_GET and FOLL_PIN are mutually exclusive. */ >> if (WARN_ON_ONCE((gup_flags & (FOLL_PIN | FOLL_GET)) == >> (FOLL_PIN | FOLL_GET))) > > Expand on *why* KVM requires it even though I suspect this changes later > in the series. Maybe "Some GUP users like KVM require the hint to be as > the calling context of GUP is functionally similar to a memory reference > from task context"? It's raised later in this series but it doesn't hurt to discuss it here in a bit more detail. Sounds good to me. > > Also minor nit -- s/autonuma/NUMA Balancing/ or numab. autonuma refers to > a specific implementation of automatic balancing that operated similar to > khugepaged but not merged. If you grep for it, you'll find that autonuma > is only referenced in powerpc-specific code. It's not important these > days but very early on, it was very confusing if AutoNUMA was mentioned > when NUMAB was intended. Ah, yes, thanks. That's the one of the only place where that terminology accidentally slipped in. I'll wait for more feedback and resend! -- Cheers, David / dhildenb