Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2508462pxb; Mon, 11 Jan 2021 11:25:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1cHVE+P69cfdwiGffw4kW5h3TC/Qv2qbYXsHxP3WhWg8VA7fWdaDmEGuhzF58oY6JLExF X-Received: by 2002:a17:906:16d6:: with SMTP id t22mr697019ejd.154.1610393110039; Mon, 11 Jan 2021 11:25:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610393110; cv=none; d=google.com; s=arc-20160816; b=WrQQv/guPis6ENLUO7t1o4HpqtMv6VZGeO6TERwxGpdXux8cKiX1XgOJ2QtTRGig/Q lNmWv/vp+aumIO/LWU7Kt6gIAWdaKVJmT9VhENEbNfXNr/pbySzzUDMZhRR2kL7oX96K ewrYtgdLeW4nsPOXYKbZfdo3oFlHcQ7yQpNNIY7ol/7VtC+c2LJROT1wcrCzJztg+iT3 drDi1Uz+zk9BSRh2iJtU5VWDqYXgpBV9ntyV1WsAvMrLxBxVlpVhDnoG66xOh+zijrhu OqeoqiTW8n7YNwDJ2e66YJ7HIzhzYn7ohAh1NDPevZBkG5mROyC14W7E/AogcyZgDaRi Ubyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EuYMAUtCWmYJ++DX8IPtB8qketeodafT0GlTpxIamMM=; b=J0GWq/mWkAHH/GBKviDNJf99jxbkspC40AOrUoEwNk1CJUE7PpSs3llQ5ZshSH2k2P udNU8LYmpx3VdzNlFpA/TFjHKxCFGahSn3EtHbm56+lDD3tfvrYE3w8N9M5G8yOTfujI mymhHq0DhSuGM36vHo28+52Eff2FIBnDV9d29zPO052HvrSsA7tq3E+f5YWacxltQUsI xNrZ+eo8QZB7zwQNrsM4Jref9SHftzlw+9430MFmw19DX1FUEezeh+HNrKViU/oY9rOA 4K4GoWAZWlpPP/PL9BPkUWLIQEaXQ6x7LzXeAWMNcNZ9sd8Wi1rRbjhpYBiGz+RlFeZF L2nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=dtKHegwF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si252851edt.456.2021.01.11.11.24.46; Mon, 11 Jan 2021 11:25:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=dtKHegwF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404077AbhAKTWw (ORCPT + 99 others); Mon, 11 Jan 2021 14:22:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391022AbhAKTVL (ORCPT ); Mon, 11 Jan 2021 14:21:11 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E87DAC0617BC for ; Mon, 11 Jan 2021 11:19:52 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id m25so1119912lfc.11 for ; Mon, 11 Jan 2021 11:19:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EuYMAUtCWmYJ++DX8IPtB8qketeodafT0GlTpxIamMM=; b=dtKHegwF45Wek/elGqYJZI7jetDQ65SX9gUGgih3Jo/DonYqL1thaNxEGTkkI1Aee9 Mwa5m+3Mn3ZSCSpM1xgh45gwwD6oNir5EEBwrEx3yzagNgE+DVv4Wgi6HyoEqtUJVury 76e16Kp1cz5Y37THwADpjULOnpo8ffddRW5f0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EuYMAUtCWmYJ++DX8IPtB8qketeodafT0GlTpxIamMM=; b=MGdA28myOXrebLAMhMxHH5M9z977rZ2x25JD8JXTFJUpnR9JwzpTzlvsA+xnh2kCXU CouSPHCknaarJA4597OzCnL3iTCQ3FbmqGYoocf2B9x2owmAf1mLo7R67UHIBfUJB8SU Cq0XiK/KSauA1PhZqV2gjY8QTBymuDOCuysYhG6jTJbbHHxGSt+QHiuuxplmxLypFxrf 5gpX5ebzlBzuKiz/nntDST/SBLQO4BVNP8Q8aZQcr2xtwOF+gu2pby3dE3lZvE5t58VF gmjUQ57Ym1Zs8J/jSSCnakHaJLzGw+NbVIh+esvaqMhnZz3kxY4BeL2uYMzVFZdxhS1+ f5sw== X-Gm-Message-State: AOAM5315fxx/mg1mwr6D/7xjIpXhE01Rw2qDAFlLthC/Kkfa1jR9ligW e++JlihCXmY3YHadR+0f+AHAu7VgW0Zw4Q== X-Received: by 2002:ac2:4d4a:: with SMTP id 10mr422285lfp.556.1610392791151; Mon, 11 Jan 2021 11:19:51 -0800 (PST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id p4sm82243lfc.214.2021.01.11.11.19.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jan 2021 11:19:50 -0800 (PST) Received: by mail-lf1-f51.google.com with SMTP id m12so1161756lfo.7 for ; Mon, 11 Jan 2021 11:19:49 -0800 (PST) X-Received: by 2002:a19:f014:: with SMTP id p20mr426031lfc.421.1610392789412; Mon, 11 Jan 2021 11:19:49 -0800 (PST) MIME-Version: 1.0 References: <20210110004435.26382-1-aarcange@redhat.com> <45806a5a-65c2-67ce-fc92-dc8c2144d766@nvidia.com> In-Reply-To: <45806a5a-65c2-67ce-fc92-dc8c2144d766@nvidia.com> From: Linus Torvalds Date: Mon, 11 Jan 2021 11:19:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/1] mm: restore full accuracy in COW page reuse To: John Hubbard Cc: Andrea Arcangeli , Andrew Morton , Linux-MM , Linux Kernel Mailing List , Yu Zhao , Andy Lutomirski , Peter Xu , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , Minchan Kim , Will Deacon , Peter Zijlstra , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oleg Nesterov , Jann Horn , Kees Cook , Leon Romanovsky , Jason Gunthorpe , Jan Kara , Kirill Tkhai , Nadav Amit , Jens Axboe Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 10, 2021 at 11:27 PM John Hubbard wrote: > > There is at least one way to improve this part of it--maybe. It's problematic.. > IMHO, a lot of the bits in page _refcount are still being wasted (even > after GUP_PIN_COUNTING_BIAS overloading), because it's unlikely that > there are many callers of gup/pup per page. It may be unlikely under real loads. But we've actually had overflow issues on this because rather than real loads you can do attack loads (ie "lots of processes, lots of pipe file descriptors, lots of vmsplice() operations on the same page". We had to literally add that conditional "try_get_page()" that protects against overflow.. Linus