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 072BCEB64DD for ; Fri, 28 Jul 2023 21:32:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78BF96B0071; Fri, 28 Jul 2023 17:31:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73C198D0002; Fri, 28 Jul 2023 17:31:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DD848D0001; Fri, 28 Jul 2023 17:31:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 516106B0071 for ; Fri, 28 Jul 2023 17:31:59 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 25C8A140620 for ; Fri, 28 Jul 2023 21:31:59 +0000 (UTC) X-FDA: 81062318358.14.8C2EECA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id C6392C0005 for ; Fri, 28 Jul 2023 21:31:56 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fSD4xNR9; spf=pass (imf28.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@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=1690579916; 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=S6lbOkGydlirE9nA3kdmMXZFBN+LXCd5vET/ZOFTDEo=; b=pZde67czzxx6ulUHxezj2eBBVz0W6cir9CA0AML8PnhpvQMDl08ibzgofO6Wf9YO6W6nna o2b0DCRpJWRb8EuvoflLHJrlBrhKUYSAql87K6WNbvwFdzqqFmNZ2eplmmfaereu+CPIHd f00v/aDDtjIUrKQd1R2syA8I34Y9Qr8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690579916; a=rsa-sha256; cv=none; b=g2UDUNjmE/YYraFlGFCP8C2ZOznBeKYH1VmY/+G3AYIM3zjR2FpZ7BxAH9KWP3mClKAIQZ iLxVg4s2fFtxmytcGiUHOifOvjPOHAW9UTPz2JGW4mCj1H4aXsqaLL8HLVv8Qs3cTxykRQ 7Kx+kMxKJAs7s47ET7K2G2TGJercDzA= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fSD4xNR9; spf=pass (imf28.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com 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-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-498-Tlwcbr6vOyuJxIPD0Oa5eg-1; Fri, 28 Jul 2023 17:31:52 -0400 X-MC-Unique: Tlwcbr6vOyuJxIPD0Oa5eg-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3fbffd088a9so15172885e9.1 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=Scalm7Bw/OLbX05PThfmdnQEop1VEKCd8Ep9iHv50ii689V/Ifix6+KUP+RPsKVnKp tq0e+GxeA4q6qCdHC5Y5ExzhnzbR/LyvVMgRBVDALHrn+gsr9nWC5xkUbTskr0ZI1wy6 79PnpyikytL/7pzP1GIy5cKQyXbIPYHKEumcH007603EQTyvLbItxis/ZKuYGoCzSsJw BVgySBjU/iDerZTdto6E5vLRycruGAneh4f8mWRXWMrOA8H6j+eb1QsD2aXlv0NS0ejN RwCe6iazl5FIE3BnuVY4EL/Kg847mxtmHwn3x0BkWlfzePOw/vzDuXEhtEKxaf7bcO0p vsrg== X-Gm-Message-State: ABy/qLaTl5AxhZm/JOIzUBVWLuE5VgUqZLYuCRXEdjeHl9csfqbguP8p 6eRZQfZchIqP5l1NfAVQZ1wpBP1bFzwUVK52mQOxcI+7yura+oZto9LjITHBk3AYrq+2UxG1hg9 zN6aT45P3+a0= X-Received: by 2002:a7b:cd95:0:b0:3fc:92:73d6 with SMTP id y21-20020a7bcd95000000b003fc009273d6mr2621801wmj.11.1690579911129; Fri, 28 Jul 2023 14:31:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlGEmQpF8Yul3mD8s5S8bvwWjm0+sgBoWmTFYFiAx780XZFTCm0bK5IQyqZa/Pqk+guYrETtoA== 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 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: 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 X-Rspamd-Queue-Id: C6392C0005 X-Rspam-User: X-Stat-Signature: ttz3ejkn8rise3ewbazzbte4ybpki4xr X-Rspamd-Server: rspam03 X-HE-Tag: 1690579916-926758 X-HE-Meta: U2FsdGVkX182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EC/rRSm1Qhk/pZqCarGtVAilYC0dINkGUjs8sMxdattNBi0FVNmxx/g22MipRVBned5kzX7YKFuo6Ec/avmhLXVYR2scJYLi1pz7ONiim9eV1nI8lWVJUSxPwLYFxqbr+ilYszhsTUwCJ/5Wonnh0OI6YXcPX9CacnEySVLaZrYS2WxLUif2Et/iVy1xSWPcrkeb+VKwjQBfyUNqkt7zl4SAxDUPNVMW6/2Erbh9GBsHkBFRGZvBdDkq8BN6iqUFoeDWIJzOVtYYrRe3HBWOpXQUD2haGUy7cvXJdiB7wLa808FCWqu/7cjckOHqaBjWRQ== 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 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