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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 143B1C4332B for ; Mon, 11 Jan 2021 19:22:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E511D22CA1 for ; Mon, 11 Jan 2021 19:22:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404087AbhAKTWx (ORCPT ); Mon, 11 Jan 2021 14:22:53 -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-Google-Smtp-Source: ABdhPJx3gkhhRx3zDLh/z85MDJAvBR7oOLxgwpGAaHZSfHNtD1VhGU85wdEk/ogH32N/D9KuSIXrBg== 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