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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1F51EB64DD for ; Fri, 28 Jul 2023 21:03:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232552AbjG1VDn (ORCPT ); Fri, 28 Jul 2023 17:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229605AbjG1VDk (ORCPT ); Fri, 28 Jul 2023 17:03:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 260634490 for ; Fri, 28 Jul 2023 14:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690578171; 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=Wkcm2vsBSrFML/GWUxYGG5U3iYViWt9LTI9JWBRvcyA=; b=b3UIJ/i/D4VGzdzFodQTc2ywOJWfvab0l8VAm13HF+WBSegBkRurcEJkTmQMkRStPtVnpm +W/8hfxB8ffeja+f3EHROUF+wFSNLiOhO3xrAEuUWINq8bXfesM0l1AKUmoZii8ipOjMcd LnJdOK0CwM0li/6lrMpWzvx22EqsfU0= 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_256_GCM_SHA384) id us-mta-379-DLH4jYWRP6iIErfNGz070w-1; Fri, 28 Jul 2023 17:02:49 -0400 X-MC-Unique: DLH4jYWRP6iIErfNGz070w-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3fbe590234aso14054375e9.1 for ; Fri, 28 Jul 2023 14:02:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690578168; x=1691182968; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Wkcm2vsBSrFML/GWUxYGG5U3iYViWt9LTI9JWBRvcyA=; b=e8DONzOZrLDKFWku9jbz84ArDN0oKwSJMeXGliOA55VGLL4bkY6scY+WTZS3XZ0lkn qRK1AG2nOf/EPwZypI06SHPFcbdqq7ngNOgNxlEkMU5PecGbtH8NwwsCM6qbBZLo7wD+ lnss1rOoaqhSsTPZ9K+hPW2XGutVuiv90aE3uSO8bZFflSiTL5RwMP0HWIyXgq6iPlhO tMJjYTOQeVj4A+ev4CustreT0FHub/wm1+NW1Hp040Hxb9wNCA2/O2E38UNUAzUgVODG AmJEkDu7PLAgPJFIYkUjwNkjt4JjI8b2RGFABQdobceqnwjkkjG7uX/n74i9/ULEzu5w HhKg== X-Gm-Message-State: ABy/qLbx3P+wk+HQxilWx5z3lb3YmLyl9ys4bScyGkoBhigJbinKxaOL 0VL2gKsAVZ7rmaG3dHBZWSkUFwq68W5mdAdN73rFgJ90WwqxpnIv1MTN1zJJnDC4k4GJN3YYkod 4roS9men4ROP/iM5Ixuu64bX0 X-Received: by 2002:a7b:cc88:0:b0:3fe:10d8:e7ef with SMTP id p8-20020a7bcc88000000b003fe10d8e7efmr2086252wma.19.1690578168575; Fri, 28 Jul 2023 14:02:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlHGDhYAogGggViLK1Uq2Uh1kiDC6aD5EdFYHUetEZH44a98xWY4bpVsN0bm7KKuxmYxzTm9RA== X-Received: by 2002:a7b:cc88:0:b0:3fe:10d8:e7ef with SMTP id p8-20020a7bcc88000000b003fe10d8e7efmr2086233wma.19.1690578168215; Fri, 28 Jul 2023 14:02:48 -0700 (PDT) Received: from ?IPV6:2003:cb:c706:6b00:bf49:f14b:380d:f871? (p200300cbc7066b00bf49f14b380df871.dip0.t-ipconnect.de. [2003:cb:c706:6b00:bf49:f14b:380d:f871]) by smtp.gmail.com with ESMTPSA id g9-20020a05600c308900b003fe15c466f3sm235178wmn.0.2023.07.28.14.02.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 14:02:47 -0700 (PDT) Message-ID: <69a5f457-63b6-2d4f-e5c0-4b3de1e6c9f1@redhat.com> Date: Fri, 28 Jul 2023 23:02:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Linus Torvalds Cc: Peter Xu , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , liubo , Matthew Wilcox , Hugh Dickins , Jason Gunthorpe , John Hubbard References: <20230727212845.135673-1-david@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v1 0/4] smaps / mm/gup: fix gup_can_follow_protnone fallout In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28.07.23 22:50, Linus Torvalds wrote: > On Fri, 28 Jul 2023 at 13:33, David Hildenbrand wrote: >> >> So would you rather favor a FOLL_NUMA that has to be passed from the >> outside by selected callers or a FOLL_NUMA that is set on the GUP path >> unconditionally (but left clear for follow_page())? > > I'd rather see the FOLL_NUMA that has to be set by odd cases, and that > is never set by any sane user. Thanks! > > And it should not be called FOLL_NUMA. It should be called something > else. Because *not* having it doesn't disable following pages across > NUMA boundaries, and the name is actively misleading. > > It sounds like what KVM actually wants is a "Do NOT follow NUMA pages, > I'll force a page fault". > > And the fact that KVM wants a fault for NUMA pages shouldn't mean that > others - who clearly cannot care - get that insane behavior by > default. For KVM it represents actual CPU access. To map these pages into the VM MMU we have to look them up from the process -- in the context of the faulting CPU. So it makes a lot of sense for KVM. (which is also where autonuma gets heavily used) > > The name should reflect that, instead of being the misleading mess of > FOLL_FORCE and bad naming that it is now. > > So maybe it can be called "FOLL_HONOR_NUMA_FAULT" or something, to > make it clear that it's the *opposite* of FOLL_FORCE, and that it > honors the NUMA faulting that nobody should care about. Naming sounds much better to me. > > Then the KVM code can have a big comment about *why* it sets that bit. Yes. > > Hmm? Can we please aim for something that is understandable and > documented? No odd implicit rules. No "force NUMA fault even when it > makes no sense". No tie-in with FOLL_FORCE. I mean, I messed all that FOLL_NUMA handling up because I was very confused. So I'm all for better documentation. Can we get a simple revert in first (without that FOLL_FORCE special casing and ideally with a better name) to handle stable backports, and I'll follow-up with more documentation and letting GUP callers pass in that flag instead? That would help a lot. Then we also have more time to let that "move it to GUP callers" mature a bit in -next, to see if we find any surprises? -- Cheers, David / dhildenb