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=-4.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 7009BC2D0A8 for ; Mon, 28 Sep 2020 17:13:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E07422100A for ; Mon, 28 Sep 2020 17:13:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Jd7MejtQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E07422100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B9586B00A9; Mon, 28 Sep 2020 13:13:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 041696B00AB; Mon, 28 Sep 2020 13:13:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E23966B00AC; Mon, 28 Sep 2020 13:13:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id C452B6B00A9 for ; Mon, 28 Sep 2020 13:13:28 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 77B558249980 for ; Mon, 28 Sep 2020 17:13:28 +0000 (UTC) X-FDA: 77313116496.01.mouth62_2c03a9c27183 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 67F7D100473D3 for ; Mon, 28 Sep 2020 17:13:28 +0000 (UTC) X-HE-Tag: mouth62_2c03a9c27183 X-Filterd-Recvd-Size: 5366 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Mon, 28 Sep 2020 17:13:27 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601313207; 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: in-reply-to:in-reply-to:references:references; bh=UzQTCyovgCSHNssns7ubkEo1CFFnZWpp62TbhfNMAPE=; b=Jd7MejtQbvhWtGoGQLC7/YRs5d6rJELscTwkC4jshG88kIPwZCgKcjjSmVn8O7X4gng+sq 1ERHb4cdEgzISUBpk8u/A3GSCIxt7DVZO2s/mr1VPFADg4hxzEovfHREniNiNn8t5ASs4D LTX9W5GXKk5/3x90od5jVeefJMJ0P5M= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-cZGvR8wzM4C5MTc7gTvi0Q-1; Mon, 28 Sep 2020 13:13:25 -0400 X-MC-Unique: cZGvR8wzM4C5MTc7gTvi0Q-1 Received: by mail-qt1-f200.google.com with SMTP id h31so1126914qtd.14 for ; Mon, 28 Sep 2020 10:13:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UzQTCyovgCSHNssns7ubkEo1CFFnZWpp62TbhfNMAPE=; b=swnWlUF7c0CrJnmekRik1X+Heu23n/XyHvs6a3yWj1SHHgIANBScGVjDpMwGD1KsDa l8S2nVS+yrETCjAfhVRmAEGFLRECxlo7j7U2zgjH59c2fHKykcSPxAu3cOKosL6xADy7 P0pKk+ZFrSswrZJmmwSTX1MHp8hom/mx4EFW3VHFtK5QsX1fkbiuZpJCnd8VhHoPzMUw Ij3uUNOY3Q3lPPNg4rYG76K0OpuW8xe2bp114VSQ40QcR4LIDcv3JGJQMY6paGjfrUzq ggvRbNAKQx3OCy5yjrIhOulwHqgO5pCjxPWyWLmb0kS9vQMckcequchvZh4oSZihR8bu Awaw== X-Gm-Message-State: AOAM531D2POLoTitL9nEkWJL03FgYRmCbz1dF+ZNSnOv3g7bjzIpU3Y8 H1h27K/zCdH1yd4FxBnATsG38rNNz0te3Kcsu03PRuUss5dM9rgx3iIeySQbGGRWn/3idA307kD OC9xNB23fhZ4= X-Received: by 2002:a37:67c2:: with SMTP id b185mr428189qkc.366.1601313204606; Mon, 28 Sep 2020 10:13:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8V0QTYYkPQmLtfyIlkETX0gJaSvH40Uw2u573hFkYNil5ggvnca1qt9qmtZ+05ikBg4cfqQ== X-Received: by 2002:a37:67c2:: with SMTP id b185mr428149qkc.366.1601313204131; Mon, 28 Sep 2020 10:13:24 -0700 (PDT) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-11-70-53-122-15.dsl.bell.ca. [70.53.122.15]) by smtp.gmail.com with ESMTPSA id g12sm1647356qke.90.2020.09.28.10.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 10:13:23 -0700 (PDT) Date: Mon, 28 Sep 2020 13:13:21 -0400 From: Peter Xu To: Linus Torvalds Cc: Leon Romanovsky , Jason Gunthorpe , John Hubbard , Linux-MM , Linux Kernel Mailing List , Andrew Morton , Jan Kara , Michal Hocko , Kirill Tkhai , Kirill Shutemov , Hugh Dickins , Christoph Hellwig , Andrea Arcangeli , Oleg Nesterov , Jann Horn Subject: Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned Message-ID: <20200928171321.GA59869@xz-x1> References: <20200924183418.GJ79898@xz-x1> <20200924183953.GG9916@ziepe.ca> <20200924213010.GL79898@xz-x1> <20200926004136.GJ9916@ziepe.ca> <20200927062337.GE2280698@unreal> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Sun, Sep 27, 2020 at 11:16:34AM -0700, Linus Torvalds wrote: > - split up the "copy page" into its own function kind of like I had > done for my minimal patch I didn't do that majorly because of the wrprotect() (of the fast-gup race) that can potentially be kept if it's a normal cow. Maybe we'd add one more comment above the caller of copy_present_page() (even if we have a "NOTE!" section already inside the helper) since it'll change *src_pte and it's hard to notice from the function name "copy_present_page()". Not that important, though. Thanks for doing the changes. I went over the whole patch and it looks indeed cleaner than before (I also didn't spot anything wrong either). Regarding the other even rarer "hardware race on dirty/access bits" - maybe we can simply set all these two bits always when page copy happens and we want to recover the ptes? I also agree it's trivial enough, so that maybe we even don't need to care about that. -- Peter Xu