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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9197ECAAD4 for ; Fri, 26 Aug 2022 15:56:33 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4MDkwJ0bXxz3bmL for ; Sat, 27 Aug 2022 01:56:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BckzJXwo; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BckzJXwo; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=peterx@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BckzJXwo; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BckzJXwo; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4MDkvW29ckz3bY8 for ; Sat, 27 Aug 2022 01:55:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661529347; 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=kxP+Dmq/9QrBSNE7t25KnXniHyhrvm0D5T7RzuSjQVM=; b=BckzJXwoci2ns9E9yfw/86jPHpQKs9xHUuTgB04a61ObWrE/GjkMlfGkizRzrgeLSh6102 VdSC3T9bWcjGy7OR0WNyWSqiVx2RAs0lCXToLlpNWFoVMEccbDnSOcXLmDFE66DjJo9J91 N5ugMYbRfRuHR/fSe59qGNfWsRmTfxo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661529347; 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=kxP+Dmq/9QrBSNE7t25KnXniHyhrvm0D5T7RzuSjQVM=; b=BckzJXwoci2ns9E9yfw/86jPHpQKs9xHUuTgB04a61ObWrE/GjkMlfGkizRzrgeLSh6102 VdSC3T9bWcjGy7OR0WNyWSqiVx2RAs0lCXToLlpNWFoVMEccbDnSOcXLmDFE66DjJo9J91 N5ugMYbRfRuHR/fSe59qGNfWsRmTfxo= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-388-7kWXdYmXNSe1JPImNPWPPQ-1; Fri, 26 Aug 2022 11:55:46 -0400 X-MC-Unique: 7kWXdYmXNSe1JPImNPWPPQ-1 Received: by mail-qt1-f198.google.com with SMTP id i19-20020ac85e53000000b00342f05b902cso1564513qtx.7 for ; Fri, 26 Aug 2022 08:55:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=kxP+Dmq/9QrBSNE7t25KnXniHyhrvm0D5T7RzuSjQVM=; b=1blZDWnN5Hxv79VZyQCMj/gl7S/MANUR6XTVw4yTWgquPyx2yFEQOCGxHAyluJBKuH ofErWUGkBEk0e7eFyOfXeBg6hfQkOes3AGLpv9BwSLOKFNrl63NOybTzsOpLbxTxKmhr qYMwXtlYhyX1x5wotdg2SlcEGtLYHT6f7ysrCZigykM5C+mb0v5gm8dPfsMSCvqbwR9p +zlw5ml8gH0LTzYVZd06GhjdA65Ia1UEFZtkEI4ZvDbT2gr3OVQ9fZlsX+NqPdM+qTrG l2ZH6ZkqnlLK/eDBG0XtRXGoWffHOAIew7Ail8dz+fLmf05yjQYmrACDN9bCyYYaTAep eqqg== X-Gm-Message-State: ACgBeo1ZLuGqTQdcYlpKDn2yKbt0/OgxKullJ/EchgvzPPCa8FYFNLuj s4llpE8ZGV8P4P43xECzUggn5x1Sat5D42yjndxQfN91cxjK3YPXlcAwoktZkXoZZpdn36ZCSys 7SErYzwRmjJuT3MVtT5HnIRCoQw== X-Received: by 2002:a05:620a:4549:b0:6bb:bcd5:bebd with SMTP id u9-20020a05620a454900b006bbbcd5bebdmr237497qkp.281.1661529345629; Fri, 26 Aug 2022 08:55:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ptvaOj1PH8113xcy+IwXkhfYIf0njU7CP9Dg6jANrLlzn5ahE+pvxpqeln6UJrgFHbun7Bg== X-Received: by 2002:a05:620a:4549:b0:6bb:bcd5:bebd with SMTP id u9-20020a05620a454900b006bbbcd5bebdmr237473qkp.281.1661529345399; Fri, 26 Aug 2022 08:55:45 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-35-70-27-3-10.dsl.bell.ca. [70.27.3.10]) by smtp.gmail.com with ESMTPSA id y6-20020a05620a25c600b006b59f02224asm2017524qko.60.2022.08.26.08.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 08:55:44 -0700 (PDT) Date: Fri, 26 Aug 2022 11:55:42 -0400 From: Peter Xu To: David Hildenbrand Subject: Re: [PATCH v3 2/3] mm/migrate_device.c: Copy pte dirty bit to page Message-ID: References: <3b01af093515ce2960ac39bb16ff77473150d179.1661309831.git-series.apopple@nvidia.com> <8735dkeyyg.fsf@nvdebian.thelocal> <8735dj7qwb.fsf@nvdebian.thelocal> <72146725-3d70-0427-50d4-165283a5a85d@redhat.com> MIME-Version: 1.0 In-Reply-To: <72146725-3d70-0427-50d4-165283a5a85d@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Sierra Guiza, Alejandro \(Alex\)" , Huang Ying , Ralph Campbell , linuxppc-dev@lists.ozlabs.org, Lyude Paul , Karol Herbst , Nadav Amit , Felix Kuehling , Alistair Popple , LKML , Matthew Wilcox , linux-mm@kvack.org, Logan Gunthorpe , Ben Skeggs , Jason Gunthorpe , John Hubbard , stable@vger.kernel.org, akpm@linux-foundation.org, huang ying Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Aug 26, 2022 at 04:47:22PM +0200, David Hildenbrand wrote: > > To me anon exclusive only shows this mm exclusively owns this page. I > > didn't quickly figure out why that requires different handling on tlb > > flushs. Did I perhaps miss something? > > GUP-fast is the magic bit, we have to make sure that we won't see new > GUP pins, thus the TLB flush. > > include/linux/mm.h:gup_must_unshare() contains documentation. Hmm.. Shouldn't ptep_get_and_clear() (e.g., xchg() on x86_64) already guarantees that no other process/thread will see this pte anymore afterwards? -- Peter Xu