Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3348142imw; Mon, 11 Jul 2022 07:03:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ue+hSMFV7HGeSXRJf0pD7NykikLouJi0TUZFiygThnUgoEqaXdHKudiqFhsrs33NDe9ZRS X-Received: by 2002:a05:6402:48c:b0:43a:8bc7:f440 with SMTP id k12-20020a056402048c00b0043a8bc7f440mr24591231edv.8.1657548189630; Mon, 11 Jul 2022 07:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657548189; cv=none; d=google.com; s=arc-20160816; b=eIAa4oeKOYUGIDx3AICYguSSOveuETvlSJQvKfh8LX7X/bsUtUHDq6eTO6EyoQGX0W RWVc+9aX8tJTGnc7sHS4gnS0m94SQaU+9/CJUNqg+6R3NZXRR7jyIUrsxocvvmizQzk8 bkdTUaazb+/aXNqz0sPavVqwRua9yeZL+07HQvqF1VWkm/KbXx90z1AaOeraCL2IMSWL 4M8/0sH/gIqX+gyWsNV+ls3j9vuOJfhsqyv94RwxQZqZxkc+JikCUHFMGcxHnmGzJJJH 0MANvrJ08bYjTH9G16/q0q86I/7Zsg+k6lug4pctolqwBYrOjQj+iZRTKDqQg2y1V/8y uXCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rcQF7iugd2cu8An1gTYADBIF1lWVn+jc8HlNL1UeLoM=; b=aGUCmZQKliVyt3ohnWe4fzH5yWViYDgUne0BSLdPenn3PQlHZuOKkIU9bIGo/756oq 2BJHCI8LqBBfmMsR0R206venizsv/N4X2zARwFnNoHHjVeEAdgRavKoNTjd/TR/dvFaI TOjxUJnqCOwbnl6W5VfAaw68yfY62N9VBCihc3hoO3wkdtDTVlhFj/yQJYYynD8F+Vli wnJc4afTunR+MG8NOVcfOicMujgiG28ANq8WwEh6zgL9cjak5enPRszSvGi1BPn5kZ7C R3HOwaTNm+O1wXBXgrsS0P9IsopdOdcfnwWz0Yq4l5GLAd2ub5BPXwbPrsai5uXZxer6 QMsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=gVStaT9K; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u22-20020a509516000000b0043aa5c0495esi11315058eda.281.2022.07.11.07.02.36; Mon, 11 Jul 2022 07:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=gVStaT9K; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbiGKOAY (ORCPT + 99 others); Mon, 11 Jul 2022 10:00:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbiGKOAX (ORCPT ); Mon, 11 Jul 2022 10:00:23 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21149627E; Mon, 11 Jul 2022 07:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rcQF7iugd2cu8An1gTYADBIF1lWVn+jc8HlNL1UeLoM=; b=gVStaT9Kg0MMbppoH83xjPscGs IFbnv81Y2Qux27iyh2Ytl5RYRUv/rrc/FF853SfUcRswpEscsP7xj4ckdRrrmFlKVPdCkfjDFWPJV a6BE4mHwC98MjNV7ILSxNmudVQYo/YACzEjfygVSi9TN8tlCjTOLQQUWznoWY739TfIIQPlyYa2mY OsowUrkakCcxofte6qfDxJ43ipH5CUD9JiHbZadiUR5ps47qHAgjlAHSPevIEYvLqBZsGOC2JKq8i KFOLAViCUYEoLKdytMRp4fnJce4T+X2CknDxNQzRotjz/y2NXtCO92RF15eLW0OoWR33g46bZ3vax fHzP8VIg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAtxM-0060dO-5n; Mon, 11 Jul 2022 14:00:12 +0000 Date: Mon, 11 Jul 2022 15:00:12 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Alex Sierra , jgg@nvidia.com, Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jglisse@redhat.com, apopple@nvidia.com, akpm@linux-foundation.org Subject: Re: [PATCH v8 07/15] mm/gup: migrate device coherent pages when pinning instead of failing Message-ID: References: <20220707190349.9778-1-alex.sierra@amd.com> <20220707190349.9778-8-alex.sierra@amd.com> <2c4dd559-4fa9-f874-934f-d6b674543d0f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c4dd559-4fa9-f874-934f-d6b674543d0f@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Jul 11, 2022 at 03:35:42PM +0200, David Hildenbrand wrote: > > + /* > > + * Device coherent pages are managed by a driver and should not > > + * be pinned indefinitely as it prevents the driver moving the > > + * page. So when trying to pin with FOLL_LONGTERM instead try > > + * to migrate the page out of device memory. > > + */ > > + if (folio_is_device_coherent(folio)) { > > + WARN_ON_ONCE(PageCompound(&folio->page)); > > Maybe that belongs into migrate_device_page()? ... and should be simply WARN_ON_ONCE(folio_test_large(folio)). No need to go converting it back into a page in order to test things that can't possibly be true.