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=-3.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 A3DCBC433DF for ; Thu, 8 Oct 2020 17:06:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D5E1B21D7D for ; Thu, 8 Oct 2020 17:06:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="PfQfZsaR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5E1B21D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2AA196B0068; Thu, 8 Oct 2020 13:06:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 280B8900002; Thu, 8 Oct 2020 13:06:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 196036B0070; Thu, 8 Oct 2020 13:06:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id DFBD06B0068 for ; Thu, 8 Oct 2020 13:06:57 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 70DBF3629 for ; Thu, 8 Oct 2020 17:06:57 +0000 (UTC) X-FDA: 77349388074.16.root10_4f09396271d9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 46E5E100603E8 for ; Thu, 8 Oct 2020 17:06:57 +0000 (UTC) X-HE-Tag: root10_4f09396271d9 X-Filterd-Recvd-Size: 4826 Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Thu, 8 Oct 2020 17:06:56 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id d24so7334122lfa.8 for ; Thu, 08 Oct 2020 10:06:56 -0700 (PDT) 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=m9iELUOUH2gSDZ+KGxu3KnkYY6SG+fTRDi1yjPRUUik=; b=PfQfZsaRVICKvNpGp8G6VluglndK7J962ZsTyDyp+zMzCpT9B3UMJ6Az1pLJiM3CdK tRPwiZiCoybF02TW+zofVU0z33pqqhrcdVmCdeOr/S4loUhaK/tr3d732BrwXy7lp/kE CrdZUBHPup88/Mbm0F9HHuMiDptpUy0ZlGqiE= 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=m9iELUOUH2gSDZ+KGxu3KnkYY6SG+fTRDi1yjPRUUik=; b=uWMW8MQWUEP1cBAZNRaO46dKLqfyWzk7Jk1K4LCiObZxdXnjSeJ2HNRN6p26q8XKzx 6I3WakKfpyNqo+IZDZY83ddEro6eO+yXrAgZP4E812LYPIz1BDLOWqAaPuYYkG2ZJho4 DK+RAHD3PBGnq78S46s8PkZHqo6GwX/mwwJgid3IATzhQR4hq0u9LuNnqzjmrjVdiniS CigFsPX3pcfdOn7Tnd5O7p++eynm8242RvLLhG9OiDg0HjPgv1h57AoZBnYlKUHwMgQc AO7euXLr5tyw280NfDGq8+Ps1VmATqmoDXJxh8t/9BC3TWn4ZZ1KgGeasgLCus6y/L0n CtXA== X-Gm-Message-State: AOAM533D1FGr57PszB7w4VpDlLcUO8kWUm/4qod5CBWEa5Mi4QXnNHa8 LYoTNmjqHEg1MD++2fmR8ejhMorqqaJqng== X-Google-Smtp-Source: ABdhPJyQpsciPmS2XMVfE2ARqBFnvbHYyiI14Td2pgR8QQBJby8g+5zKOCOBlZcv4Q3xDcGFHbvl1A== X-Received: by 2002:a19:7408:: with SMTP id v8mr2914644lfe.142.1602176815114; Thu, 08 Oct 2020 10:06:55 -0700 (PDT) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id n125sm333792lfd.7.2020.10.08.10.06.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Oct 2020 10:06:52 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id d24so3576568ljg.10 for ; Thu, 08 Oct 2020 10:06:51 -0700 (PDT) X-Received: by 2002:a2e:994a:: with SMTP id r10mr3514705ljj.102.1602176810912; Thu, 08 Oct 2020 10:06:50 -0700 (PDT) MIME-Version: 1.0 References: <20201008092627.399131-1-aneesh.kumar@linux.ibm.com> In-Reply-To: From: Linus Torvalds Date: Thu, 8 Oct 2020 10:06:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] mm: Fetch the dirty bit before we reset the pte To: "Aneesh Kumar K.V" , Leon Romanovsky Cc: linuxppc-dev , Michael Ellerman , Nick Piggin , Peter Xu , Jason Gunthorpe , John Hubbard , Linux-MM , Linux Kernel Mailing List , Andrew Morton , Jan Kara , Michal Hocko , Kirill Shutemov , Hugh Dickins Content-Type: text/plain; charset="UTF-8" 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: [ Just adding Leon to the participants ] This patch (not attached again, Leon has seen it before) has been tested for the last couple of weeks for the rdma case, so I have no problems applying it now, just to keep everybody in the loop. Linus On Thu, Oct 8, 2020 at 10:02 AM Linus Torvalds wrote: > > On Thu, Oct 8, 2020 at 2:27 AM Aneesh Kumar K.V > wrote: > > > > In copy_present_page, after we mark the pte non-writable, we should > > check for previous dirty bit updates and make sure we don't lose the dirty > > bit on reset. > > No, we'll just remove that entirely. > > Do you have a test-case that shows a problem? I have a patch that I > was going to delay until 5.10 because I didn't think it mattered in > practice.. > > The second part of this patch would be to add a sequence count > protection to fast-GUP pinning, so that GUP and fork() couldn't race, > but I haven't written that part. > > Here's the first patch anyway. If you actually have a test-case where > this matters, I guess I need to apply it now.. > > Linus