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 06BC1C433EF for ; Mon, 11 Jul 2022 14:01:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8464F6B00EB; Mon, 11 Jul 2022 10:01:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F6766B00EC; Mon, 11 Jul 2022 10:01:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BE246B00ED; Mon, 11 Jul 2022 10:01:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5C86D6B00EB for ; Mon, 11 Jul 2022 10:01:00 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 352093420B for ; Mon, 11 Jul 2022 14:01:00 +0000 (UTC) X-FDA: 79674980280.09.3BED5B2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 58A831C009D for ; Mon, 11 Jul 2022 14:00:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657548058; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=th2buvr24d07qJGzIS/AKju5zI095zK3996wlFgRrAE=; b=ICwIxCd/SgcQ/R4PtsBJDGy1VivfLuKK1NRzTjEjlFilbDsqyemg5LE7yUNFMjkgd9eRK+ Tg9UL/sR9Ifq5ABedLjWrXr5q1BALTlwBU1Lusl4bbKltJ1PraFeWcQ1B61rWZw7jliuul 3d3u46fpI9bLP2YDdUTGfpjlRo5Snss= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-75-eP3_P6odOwyBQCm7_YINuA-1; Mon, 11 Jul 2022 10:00:57 -0400 X-MC-Unique: eP3_P6odOwyBQCm7_YINuA-1 Received: by mail-wr1-f70.google.com with SMTP id k26-20020adfb35a000000b0021d6c3b9363so666194wrd.1 for ; Mon, 11 Jul 2022 07:00:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=th2buvr24d07qJGzIS/AKju5zI095zK3996wlFgRrAE=; b=grt7zR/SeNEK3wXsZ5j1Q/b/EqorIMkgaHkJowIhlQwE6TA1rKR6larB1sqpqo8uvY u1tQn564Mc/dXTl0ygntYN+NfE1qEYbHz2Y1R2A2DGj0Vu3H/wzIPrrcRO8fVjJC3JEF li1JyNA332n3ZGIch/uJt/ap+JtSBPWQZ8ubTPqqM2muSHDhsQ+0VFGAYK56v96p48HN pvQzWLhKtMtMuDdMvGW848MxJgA+dlSkVgPD+r9MaQzCLZvci1K5I/ZP3v00NgAcGPex d3T1PMzPAwtwGBW8Ty883DdPSdqy19NEe4dLr0LcR5Zhcb4Kjg0s87jKiiJkkyH2hR3D n7ew== X-Gm-Message-State: AJIora9l+dcEuE7DK+VOnZum/52z95khaK9kSzQOd81L5lA8+OAFkPIE AtSmVuMb/LOk0+LzL+ByjBCRGyAsNduIsp43vg/BUQ3TImX+HFgzh0uRbRe5yMPhMi61FB5sjb2 oKDlZchoJ0QU= X-Received: by 2002:a5d:6dab:0:b0:21d:9fc8:3029 with SMTP id u11-20020a5d6dab000000b0021d9fc83029mr8016752wrs.172.1657548056006; Mon, 11 Jul 2022 07:00:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tHUpdQt0jOB6/Le/88y5FMlWl7A0VwJVjWJ8qwyFnogYLhO4qiJJpxW2UhqlLHOVvPkjmbsQ== X-Received: by 2002:a5d:6dab:0:b0:21d:9fc8:3029 with SMTP id u11-20020a5d6dab000000b0021d9fc83029mr8016733wrs.172.1657548055721; Mon, 11 Jul 2022 07:00:55 -0700 (PDT) Received: from ?IPV6:2003:cb:c702:1400:c3:4ae0:6d5c:1ab2? (p200300cbc702140000c34ae06d5c1ab2.dip0.t-ipconnect.de. [2003:cb:c702:1400:c3:4ae0:6d5c:1ab2]) by smtp.gmail.com with ESMTPSA id f12-20020a05600c4e8c00b003a2cf17a894sm11063409wmq.41.2022.07.11.07.00.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jul 2022 07:00:55 -0700 (PDT) Message-ID: <4b2f9a61-ca67-6a34-41c9-c191cac756b3@redhat.com> Date: Mon, 11 Jul 2022 16:00:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v8 07/15] mm/gup: migrate device coherent pages when pinning instead of failing To: Matthew Wilcox 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 References: <20220707190349.9778-1-alex.sierra@amd.com> <20220707190349.9778-8-alex.sierra@amd.com> <2c4dd559-4fa9-f874-934f-d6b674543d0f@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657548059; a=rsa-sha256; cv=none; b=5/OSuylzv4574tcCIZHFPYO6Rb1yFmWVHNIk8ecFTd2UEQlBOudpaTmzyOfvM6xnohCLjP e8vtGGorMyKbqX3DxANwLrQeiYfTfnv9W2DLMu7awzY3ySdJ+b9EvoeARfQwsDkueUXoUr gog5cz2QgigCRb1P8+Jt/FMDChn4qyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657548059; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=th2buvr24d07qJGzIS/AKju5zI095zK3996wlFgRrAE=; b=SMUZdmTVmMaS03ZqNIjx49NFvDVeB3soXlWO9zxTwPRjG4q/o17Ccf7rD9VadvV+Udw2af TlGn4k1eFdqPs5vG6Z60MV8G3Nr1wrNdThZ+NloJZ0Le4RvWluLuC52wqsFlyKxYGceFvV GCLT+tZRiBQKCLo23bvsQ06Ody7c9ow= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ICwIxCd/"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf18.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ICwIxCd/"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf18.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam03 X-Stat-Signature: a1fuhd5z9q6tykbfaabze9g4iarwiqtu X-Rspamd-Queue-Id: 58A831C009D X-Rspam-User: X-HE-Tag: 1657548059-832150 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 11.07.22 16:00, Matthew Wilcox wrote: > 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. > Good point. -- Thanks, David / dhildenb