Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1850754rwb; Fri, 28 Jul 2023 16:32:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlERBd8W0r4HcIBk3KoKqjSe9kEsbFSUZGNxbj1VTgRYRA1hwqvQG4VG2HCtsvDrdkyhulTJ X-Received: by 2002:a05:6a20:3d8a:b0:132:ce08:1e28 with SMTP id s10-20020a056a203d8a00b00132ce081e28mr4871571pzi.22.1690587153898; Fri, 28 Jul 2023 16:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690587153; cv=none; d=google.com; s=arc-20160816; b=AXxAIveVbcN0Juu6OQ/xUKpUgVzpaVJRTLO7AyWINzZEP2tT6OX18cNsbbmHViJCVV 4daxwbiVzWMm6hX372mF+oVM8LPnWvu0yCvdPAntszpoGG2N/7fjRSGA/PM9yUnC57ao Igb2twSJgz161UXmFA8WI6O6BQT748oRQHBhsmzk9sEAdFleN1MvQJBJfWi0XmWOgNDG RPBv2kC3aYo4G48OcHjveu1inV2Wxg0lwK4Y4QtELPvoN1/afSrOrnKyVbzvBuaMR7r1 DMh1GeDWx3MTErrqIKXAnVWN549IYudwvIEe7yCBllGbtnYhoObFWT98afWa5Y/TUz5f LzWg== 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:subject :organization:from:references:cc:to:content-language:user-agent :mime-version:date:message-id:dkim-signature; bh=S6lbOkGydlirE9nA3kdmMXZFBN+LXCd5vET/ZOFTDEo=; fh=zKDfNJ9c2yvsMSfvVt5IErQcb1P6IkoehhxnTW31GSk=; b=YBp7HXz2T33kE8irCYdTp02ZAmIfXeCpPdE9VF9P9Cb0WCzCqLwBaE2lJgueCnxAjT pVQzCgXf7uGHyE4AKRIeK8Jyff4mb0/wqzXBxHe5Jbz0sA1yhxsRiUQIeGu+wR2jxyMb dYvHAw+x69N0zzIm41ZjxujpgrtkwYSdbikn3e8z+SNumm1+A/4thU+tU/eLUcEbLOOF C0EsJfWGN4CUxJYUIubzKcOpLisQBReLIZx6zAKTh64246gRFbRi1+XuYmA0SPSBSaNK VagMI+7QV7yax4B6AMpieH4GWshwHHypUCg++AVf7efr8Osrvwafhz8fXEuBZlhw/sVq 33KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fSD4xNR9; 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 p7-20020a056a000b4700b0067e18c6d2d2si3853534pfo.14.2023.07.28.16.32.21; Fri, 28 Jul 2023 16:32:33 -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=fSD4xNR9; 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 S234059AbjG1Vcl (ORCPT + 99 others); Fri, 28 Jul 2023 17:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232542AbjG1Vcj (ORCPT ); Fri, 28 Jul 2023 17:32:39 -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 DFFA53AA8 for ; Fri, 28 Jul 2023 14:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690579916; 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=S6lbOkGydlirE9nA3kdmMXZFBN+LXCd5vET/ZOFTDEo=; b=fSD4xNR9259Db9typIbMczqpwQJQK+ZY6H8Z7vHiieg/DpAazCiYQ1AlMX9BqNyDqGP7qy M7p516meDU8teOx3EDo82ZDEB1efVI78fcz88mTe0xvICjj6RCyuH3iN437LBmuq6xbJdl a3NwS4LmpEuDYxGSYDH3NdeGobW3wfg= 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-498-lKFFth8VNr-rQP1NWNoi4g-1; Fri, 28 Jul 2023 17:31:52 -0400 X-MC-Unique: lKFFth8VNr-rQP1NWNoi4g-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3fd2dec82a6so15114385e9.3 for ; Fri, 28 Jul 2023 14:31:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690579911; x=1691184711; 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=S6lbOkGydlirE9nA3kdmMXZFBN+LXCd5vET/ZOFTDEo=; b=NF3X7ycyrznhTWHs3OsgRaR1YykiN3gMjgukHjo1qdfX93DOmYAGiR3Fk3Om21+CHI dwHu96WndqSAwfZ4aNTJ0Ff2EdDijNnoCqq2UCCnp2tTdPxA3CCV5YgwIN8wCapy3kPi TXb7hsPIGgksfmODsU4twXg0b2ENBqY6x09fuSrKLG2l23FzuZy4PxPtqhiRQvGCy3Bj h4MW5KoL3iWs94xQUcdSiKTy2Jd0o59fGpkC4/7NaK6dad1fDnB6yhY/JRn2wJb+Hjvb xLEVyk13/L0ELeQdSj+GOUyx3R1ZIRBg/p8IaBQDVFgwnusPtgscV7dSjHRoIDKq2wOY pHjg== X-Gm-Message-State: ABy/qLa7njGx+zvX5elJofjCMlkAbl/PPofMxQco0XvqCrCNy2Y3Eeh/ RbS1vQr1NS6RiW1kUKxEbpKtUXboBVWoUnNAxjCXB8KiwQnYKDIV/t5reJ9PIqmBNj9hmOv7Ium SmoFpQXGTN4ohtLqUp13LNc5O X-Received: by 2002:a7b:cd95:0:b0:3fc:92:73d6 with SMTP id y21-20020a7bcd95000000b003fc009273d6mr2621796wmj.11.1690579911127; Fri, 28 Jul 2023 14:31:51 -0700 (PDT) X-Received: by 2002:a7b:cd95:0:b0:3fc:92:73d6 with SMTP id y21-20020a7bcd95000000b003fc009273d6mr2621779wmj.11.1690579910792; Fri, 28 Jul 2023 14:31:50 -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 f14-20020a7bcd0e000000b003fba94c9e18sm5097861wmj.4.2023.07.28.14.31.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 14:31:50 -0700 (PDT) Message-ID: <22262495-c92c-20fa-dddf-eee4ce635b12@redhat.com> Date: Fri, 28 Jul 2023 23:31:49 +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: Peter Xu Cc: Linus Torvalds , 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> <69a5f457-63b6-2d4f-e5c0-4b3de1e6c9f1@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 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=ham 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 On 28.07.23 23:20, Peter Xu wrote: > On Fri, Jul 28, 2023 at 11:02:46PM +0200, David Hildenbrand wrote: >> 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? > > As I raised my concern over the other thread, I still worry numa users can > be affected by this change. After all, numa isn't so uncommon to me, at > least fedora / rhel as CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y. I highly > suspect that's also true to major distros. Meanwhile all kernel modules > use gup.. > > I'd say we can go ahead and try if we want, but I really don't know why > that helps in any form to move it to the callers.. with the risk of > breaking someone. > Indeed, that's why I suggest to be a bit careful, especially with stable. > Logically it should also be always better to migrate earlier than later, > not only because the page will be local earlier, but also per I discussed > also in the other thread (that the gup can hold a ref to the page, and it > could potentially stop numa balancing to succeed later). I get your point, but I also see the following cases (QEMU/KVM as example): * User space triggers O_DIRECT. It will be short-lived. But is it really an access from that CPU (NUMA node) to that page? At least for KVM, you much rather want to let KVM trigger the NUMA fault on actual memory access from a guest VCPU, not from a QEMU iothread when pinning the page? * vfio triggers FOLL_PIN|FOLL_LONGTERM from a random QEMU thread. Where should we migrate that page to? Would it actually be counter- productive to migrate it to the NUMA node of the setup thread? The longterm pin will turn the page unmovable, yes, but where to migrate it to? -- Cheers, David / dhildenb