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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AB0FECAAD2 for ; Mon, 29 Aug 2022 15:30:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2032940008; Mon, 29 Aug 2022 11:30:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BCFC4940007; Mon, 29 Aug 2022 11:30:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9816940008; Mon, 29 Aug 2022 11:30:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9A81F940007 for ; Mon, 29 Aug 2022 11:30:41 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 72C0F160477 for ; Mon, 29 Aug 2022 15:30:41 +0000 (UTC) X-FDA: 79853017482.29.EAD7E4A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf11.hostedemail.com (Postfix) with ESMTP id E2D2E40029 for ; Mon, 29 Aug 2022 15:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661787040; 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=uLllbJi1GiDM7BPAm56bYR3kfCL3+VM5NIR1YIMkdDc=; b=d8R/g4dC2Tmu4x7/Xg6cmslEtVAs5WECcW8k5Zlu8Vie58PWDxj1oLZQavaTqN4vTtN0q8 2Rq4M5EyeZTCOgfYzoM7yujlvCUjlKQvRvRR9Hj30UaH3SvqaxdJ8Bo4UjFat+v1Xvf0wN E41l/Afu4CYA2xbjtuWojax4ie/FhxE= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-190-1aPc8D2WP3OBe8TsES1sSg-1; Mon, 29 Aug 2022 11:30:39 -0400 X-MC-Unique: 1aPc8D2WP3OBe8TsES1sSg-1 Received: by mail-il1-f199.google.com with SMTP id l5-20020a056e021c0500b002ea96994711so6150879ilh.9 for ; Mon, 29 Aug 2022 08:30:39 -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=uLllbJi1GiDM7BPAm56bYR3kfCL3+VM5NIR1YIMkdDc=; b=dDc9S10quvW25Kb6m6i7y65mXRKKIzfaZ+gLGD77fkAsOwH+5gVyb9C7LjrkbB2yhC TnL7cnwMvfaDH16omH4qfsiFVF9Hon8yqLaI6GUrSR3kr/MYqeNuj0P5I9EyPqDYFMC1 ZViaEawWbAfSpcVEBUuunjusPoT4t8bK4u0dtALBfeBVlteoQqL48JF5Ygv4yo7Knv05 WgL3Z8olhyYhZ2TA9NI8FtIYZ+ELH1JNn+USsG5u3wsS1lZBKEJfxRpy4wlWKu9OX/Qz e5G3sd5Wuhn79Tz4qIj/Dttz6pmlZb6E8iYwlnjtEW4qfnSNkbmIioCyUegqMqZDqWv3 EeoA== X-Gm-Message-State: ACgBeo3up57/fBxMIc7zRxJBkiBOmtn7+R0aWTE+KXwYLEsNOyKECu5f V2eAoRTWYF63o7OAVNX57FO29GEpUObYKue+x/gq1RaiUUDebJjv7yZOPSVOssvoRuLvgZG7Y4c EFZkjhzrGljU= X-Received: by 2002:a05:6638:1353:b0:344:c072:f4bf with SMTP id u19-20020a056638135300b00344c072f4bfmr10266166jad.49.1661787038500; Mon, 29 Aug 2022 08:30:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR7mq0N9zSdRO9VXSbQCFn3LQxwc23pO4MydsJlmrYm8/qnJpMrgJhVO+FChqVZ4+JqtlM8r2A== X-Received: by 2002:a05:6638:1353:b0:344:c072:f4bf with SMTP id u19-20020a056638135300b00344c072f4bfmr10266158jad.49.1661787038253; Mon, 29 Aug 2022 08:30:38 -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 n28-20020a02a19c000000b00349e0800e49sm4361773jah.156.2022.08.29.08.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 08:30:37 -0700 (PDT) Date: Mon, 29 Aug 2022 11:30:35 -0400 From: Peter Xu To: Alistair Popple Cc: David Hildenbrand , linux-mm@kvack.org, Andrew Morton , peterx@redat.com, John Hubbard , Ralph Campbell Subject: Re: [PATCH] mm/migrate_device.c: Fix a misleading and out-dated comment Message-ID: References: <20220825014905.977168-1-apopple@nvidia.com> <877d2v7rhf.fsf@nvdebian.thelocal> <87tu5v7blr.fsf@nvdebian.thelocal> MIME-Version: 1.0 In-Reply-To: <87tu5v7blr.fsf@nvdebian.thelocal> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="d8R/g4dC"; spf=pass (imf11.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661787041; a=rsa-sha256; cv=none; b=BkTDuchREEzyeAqU9pfYhCC8roPFFyRKEK4E7iJYccQXezMacCyg8qJDWK+VJLaJP5Y+Rp bVnsZoGzp2V9U9gdcx4Ekf628TMctW0m1MsTlZfwPmv6mvNLel2sXyOg51vOuJBT96bHPQ j79nuw7cW4Vu5p62wk5qSUJgzCdN2Io= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661787041; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uLllbJi1GiDM7BPAm56bYR3kfCL3+VM5NIR1YIMkdDc=; b=TjkyU04RRXN1/78OH5D6czVTMS40TOETioAzFXbxC7UBYLBQ0mOmPxMNri4D0/om5Mz3KH u+o+kmZOr7lucDPzcGY93bOFSnoxa7rClfEc4B9qkig14Wg4BT0YK2qYhtr7H4AtnCl7dB p9gBGQV6EPMbuptBvYfsBTteNjSPYZY= X-Rspam-User: X-Stat-Signature: ekyf5gycd4syd8jzehsqsdknuzm99y4c X-Rspamd-Queue-Id: E2D2E40029 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="d8R/g4dC"; spf=pass (imf11.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam07 X-HE-Tag: 1661787040-705457 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 Mon, Aug 29, 2022 at 05:09:25PM +1000, Alistair Popple wrote: > So how about the following: > > /* > * We rely on trylock_page() to avoid deadlock between > * concurrent migrations where each is waiting on the others > * page lock. If we can't immediately lock the page we fail this > * migration as it is only best effort anyway. > * > * If we can lock the page it's safe to set up a migration entry > * now. In the common case where the page is mapped once in a > * single process setting up the migration entry now is an > * optimisation to avoid walking the rmap later with > * try_to_migrate(). > */ Good to me, thanks. -- Peter Xu