Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1744033rwb; Fri, 28 Jul 2023 14:22:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlHPQY/pdDUHgfDf7n5rx/2txDQCzLLQ6z/7mb7mpnHAME2NUWwGi5plbWr5rl9VYTOuXn9k X-Received: by 2002:a17:906:254:b0:99b:db4f:68b8 with SMTP id 20-20020a170906025400b0099bdb4f68b8mr424724ejl.76.1690579351873; Fri, 28 Jul 2023 14:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690579351; cv=none; d=google.com; s=arc-20160816; b=Ri+ibpB0Bg+/VHILJ4Pck871TmL1TUNxK2VXpv6KH8VHpfhq+CfJ6DZRVqhMIuLE7G ApjI7zqs5E45kgkiRrT3MT2a4W81pt5WL8i7Wy1UB3wVZgxvOyI0wa763wR0yte8Hg0d xw5dI94juZWzIbQ17UBparUb6wOuO7WrizKgPRtg/CgnCtv3YI5Z/oFpNiygpBTsumBz WJJ0XR0aQrB5kNnkAA4xW1oXyQ2HxXRlNXPpa+AUHwuJdcTdGKeW9yMNLkXvnsa6JtQg BA5Ayp8cmcdCsLvBiyO1cV2/3qQarpEGrtdjG3tbLFlFzL7be9deUyFX8iFfgKw7oWDv 1iAw== 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=rRmfJ1mT/OZN1AggXltoKPDhI99E2rErINEqrU1NhAY=; fh=G+LsyAcapVjMg7PT/BMYoy2Th48EYyEg9sqDwAR3lpU=; b=wgq1yyCcOfNgwDnrpGWwzoyg+fjHfeL5iYMBRoga1bZcaIEg3Qtdn7ajCszvv6rLQe OF9wZFqz+WGoszNMR7m6idbPrEZYXuwbA4H6spboUUl/RweOp4sfzniVUKeb0/SfNUeR +Ir+VLAKbf+PiK1pnvFO0P63ji1NEEBd9TmpWf/t/UCA3n6lXoc6FAeRWgKW6rAmAbzC 9jutAfxq0R4bZdwToboelVt3bOAMFdgCaV0uX1KejXwCwYnid6qjXi4D9LCQsMNNZvM9 bGmh+I9LWKgeDTGH9Qi/xoPQov//AAJtuxGPY/T5CVxuPsepfKpAnzf6PGNV4ffSUnAT jjBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gzp8NZZG; 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 f25-20020a1709067f9900b00991cbb3d4a6si3172899ejr.115.2023.07.28.14.22.05; Fri, 28 Jul 2023 14:22:31 -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=gzp8NZZG; 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 S231768AbjG1UBu (ORCPT + 99 others); Fri, 28 Jul 2023 16:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229651AbjG1UBo (ORCPT ); Fri, 28 Jul 2023 16:01:44 -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 5B6083C1D for ; Fri, 28 Jul 2023 13:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690574459; 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=rRmfJ1mT/OZN1AggXltoKPDhI99E2rErINEqrU1NhAY=; b=gzp8NZZGew3QvUm+G07X/0GTWf1ctu50XRd9R4kW6SMo9uvb/iB9c06KmL+W7QMrGKRwFY 8lxqKPjnxkG9sqvcG6req6udCRgiyf3YuvkfelXPI4mV23byz7fH+L+CZN9vNQXrAgVOwY Oa8Kw6nSGdnFZuy67yjbV18h9v0ovvk= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-567-Fj9Rnf4WMoi_AyPvB1RpCQ-1; Fri, 28 Jul 2023 16:00:56 -0400 X-MC-Unique: Fj9Rnf4WMoi_AyPvB1RpCQ-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-30e6153f0eeso1284713f8f.0 for ; Fri, 28 Jul 2023 13:00:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690574455; x=1691179255; 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=rRmfJ1mT/OZN1AggXltoKPDhI99E2rErINEqrU1NhAY=; b=Cu0VJupxEe8hBYMOPsp0vd1UdHbdlZpBCAdqEi2nhUaOo8s8rj98KddXwsu92HKqFR 1JG5Mmk+Uc2eLus/tSt9MSjnkVLmtuwO26/xBBuQKVWb9ev2DEzYrBCVU0d318eL3bzC r3oWfWcyzx7pJ/llPndH1AoPg4V8m5K+1OpU0PgA65jTzrPlY1DucqC4uN1YOIV4KoIV gguAQgrFSx9WLiHr5GRTsW9uQx/P7cFuIsc9vgc+vqCsAAob30VUwnHjVY7sukZ60MbH w88D8fMEReq89rqz/2Hr/uBtltTSi/W3wsWb4Lv5lvnwhKDLE7OCzxj4TBRkIivjnQp3 S7EA== X-Gm-Message-State: ABy/qLZJ4sm/rhbsw1gMtW/8a9yjV22Bs3m8OTiyCe1jDOl1yzdfs4Cp P6OxeJB3wmP2pXGUNC+7t/UacTUFFp8LTIm3vnl8G7YomowoE7gKZQp2nJ4pvizwDsQWGDgoPlK LwX/MDEM9lq3o3n3o9J0iCF3F X-Received: by 2002:a5d:608a:0:b0:314:415:cbf5 with SMTP id w10-20020a5d608a000000b003140415cbf5mr2570948wrt.51.1690574455581; Fri, 28 Jul 2023 13:00:55 -0700 (PDT) X-Received: by 2002:a5d:608a:0:b0:314:415:cbf5 with SMTP id w10-20020a5d608a000000b003140415cbf5mr2570943wrt.51.1690574455226; Fri, 28 Jul 2023 13:00:55 -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 i8-20020adfefc8000000b0030ada01ca78sm5634933wrp.10.2023.07.28.13.00.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 13:00:54 -0700 (PDT) Message-ID: Date: Fri, 28 Jul 2023 22:00:53 +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 v1 0/4] smaps / mm/gup: fix gup_can_follow_protnone fallout 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 , Mel Gorman References: <20230727212845.135673-1-david@redhat.com> From: David Hildenbrand Organization: Red Hat 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=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 On 28.07.23 21:50, Peter Xu wrote: > On Fri, Jul 28, 2023 at 09:40:54PM +0200, David Hildenbrand wrote: >> Hmm. So three alternatives I see: >> >> 1) Use FOLL_FORCE in follow_page() to unconditionally disable protnone >> checks. Alternatively, have an internal FOLL_NO_PROTNONE flag if we >> don't like that. >> >> 2) Revert the commit and reintroduce unconditional FOLL_NUMA without >> FOLL_FORCE. >> >> 3) Have a FOLL_NUMA that callers like KVM can pass. > > I'm afraid 3) means changing numa balancing to opt-in, probably no-go for > any non-kvm gup users as that could start to break there, even if making > smaps/follow_page happy again. > > I keep worrying 1) on FOLL_FORCE abuse. > > So I keep my vote on 2). Linus had a point that we can nowadays always set FOLL_NUMA, even with FOLL_FORCE. ... so maybe we want to let GUP always set FOLL_NUMA (even with FOLL_FORCE) and follow_page() never set FOLL_NUMA. That would at least decouple FOLL_NUMA from FOLL_FORCE. -- Cheers, David / dhildenb