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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 96177C63777 for ; Fri, 20 Nov 2020 10:06:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E722C22244 for ; Fri, 20 Nov 2020 10:06:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="HqdItk8e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E722C22244 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 529E56B0036; Fri, 20 Nov 2020 05:06:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D9A86B005C; Fri, 20 Nov 2020 05:06:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EFB56B0068; Fri, 20 Nov 2020 05:06:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id 069F36B0036 for ; Fri, 20 Nov 2020 05:06:03 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 905A6180AD83A for ; Fri, 20 Nov 2020 10:06:03 +0000 (UTC) X-FDA: 77504365806.29.toys69_3705dc22734a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 6C94D18085B5C for ; Fri, 20 Nov 2020 10:06:03 +0000 (UTC) X-HE-Tag: toys69_3705dc22734a X-Filterd-Recvd-Size: 6050 Received: from mail-oo1-f65.google.com (mail-oo1-f65.google.com [209.85.161.65]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Nov 2020 10:06:02 +0000 (UTC) Received: by mail-oo1-f65.google.com with SMTP id i13so2085000oou.11 for ; Fri, 20 Nov 2020 02:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FwZrZS2M8g80LqzTW2fm5Yrg4YpqArqxdpfJQU9jQQI=; b=HqdItk8eAfJ9g+K3HI5aMiUQzrvGRJOPlE6kLNI2lMu9ILhZMbvZZ6f8p9gmeEJne4 zXq2974oLAywa/J335ISMg7Ntoqxln9e1JXz8qEiWYzK2Vyqj7OtjpeTBqm+Cdcs1QDt yKC7n5pCkW0BHszGjfK6qu4I1SzoqAQq/6Hcs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FwZrZS2M8g80LqzTW2fm5Yrg4YpqArqxdpfJQU9jQQI=; b=NVpJdzSFRtRXS+GI/00DZmn0673iOay6mYX3E1QgI9ghSK0Erau91IXluF6whpA1H3 UOce0+xzpFSseHXCufhSsWUqVrrqe4yjQJicXYI6EtjjoXcfvhh7mDpsUjdtM8YDjzME d1kb3Rn0VoFYa9sL3NT1nTDkiJZsQijt+h3sGoDOIljOrtulabR8PK5h91ld3i3a8h+H +FS6/Bu1I75N8SivPOr6ACZYhjdk7jfKY0H9/+1IPAaFOsuW+KwZtnEBz4vZU2f1oxii Biq3E0ZHEpMMmTePQJhYeyH68szQcw9ag2/BGCQOuE3p2dbA8A20P+cb/JOYPyhU53bf AXNw== X-Gm-Message-State: AOAM5323GI4Z6U8g8ptmlQDFOvgF7W8Gq3vBAw/Zs6zCr+EMba1EH5jB PBWRhUX4Tr4TXK8zN3GmaQuUGqV9e7OrKvvRQTPEWQ== X-Google-Smtp-Source: ABdhPJyiON5L6xidYOyeZLAbz9U5Xis7bE3rvrWx7XK/ftrOp96yOttrxffYvb2YlOPVDvtJGHev197hecR9SxdWVzc= X-Received: by 2002:a4a:8582:: with SMTP id t2mr13256498ooh.89.1605866761624; Fri, 20 Nov 2020 02:06:01 -0800 (PST) MIME-Version: 1.0 References: <20201120095445.1195585-1-daniel.vetter@ffwll.ch> <20201120095445.1195585-5-daniel.vetter@ffwll.ch> <26a62dfb-02e4-1707-c833-a3c8d5cbe828@amd.com> In-Reply-To: <26a62dfb-02e4-1707-c833-a3c8d5cbe828@amd.com> From: Daniel Vetter Date: Fri, 20 Nov 2020 11:05:50 +0100 Message-ID: Subject: Re: [PATCH] drm/ttm: don't set page->mapping To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: DRI Development , Intel Graphics Development , Linux MM , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, LKML , Thomas Hellstrom , Brian Paul , Daniel Vetter , Huang Rui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Fri, Nov 20, 2020 at 11:04 AM Christian K=C3=B6nig wrote: > > Am 20.11.20 um 10:54 schrieb Daniel Vetter: > > Random observation while trying to review Christian's patch series to > > stop looking at struct page for dma-buf imports. > > > > This was originally added in > > > > commit 58aa6622d32af7d2c08d45085f44c54554a16ed7 > > Author: Thomas Hellstrom > > Date: Fri Jan 3 11:47:23 2014 +0100 > > > > drm/ttm: Correctly set page mapping and -index members > > > > Needed for some vm operations; most notably unmap_mapping_range() = with > > even_cows =3D 0. > > > > Signed-off-by: Thomas Hellstrom > > Reviewed-by: Brian Paul > > > > but we do not have a single caller of unmap_mapping_range with > > even_cows =3D=3D 0. And all the gem drivers don't do this, so another > > small thing we could standardize between drm and ttm drivers. > > > > Plus I don't really see a need for unamp_mapping_range where we don't > > want to indiscriminately shoot down all ptes. > > > > Cc: Thomas Hellstrom > > Cc: Brian Paul > > Signed-off-by: Daniel Vetter > > Cc: Christian Koenig > > Cc: Huang Rui > > This is still a NAK as long as we can't come up with a better way to > track TTMs page allocations. > > Additional to that page_mapping() is used quite extensively in the mm > code and I'm not sure if that isn't needed for other stuff as well. Apologies, I'm honestly not quite sure how this lone patch here ended up in this submission. I didn't want to send it out. -Daniel > > Regards, > Christian. > > > --- > > drivers/gpu/drm/ttm/ttm_tt.c | 12 ------------ > > 1 file changed, 12 deletions(-) > > > > diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.= c > > index da9eeffe0c6d..5b2eb6d58bb7 100644 > > --- a/drivers/gpu/drm/ttm/ttm_tt.c > > +++ b/drivers/gpu/drm/ttm/ttm_tt.c > > @@ -284,17 +284,6 @@ int ttm_tt_swapout(struct ttm_bo_device *bdev, str= uct ttm_tt *ttm) > > return ret; > > } > > > > -static void ttm_tt_add_mapping(struct ttm_bo_device *bdev, struct ttm_= tt *ttm) > > -{ > > - pgoff_t i; > > - > > - if (ttm->page_flags & TTM_PAGE_FLAG_SG) > > - return; > > - > > - for (i =3D 0; i < ttm->num_pages; ++i) > > - ttm->pages[i]->mapping =3D bdev->dev_mapping; > > -} > > - > > int ttm_tt_populate(struct ttm_bo_device *bdev, > > struct ttm_tt *ttm, struct ttm_operation_ctx *ctx) > > { > > @@ -313,7 +302,6 @@ int ttm_tt_populate(struct ttm_bo_device *bdev, > > if (ret) > > return ret; > > > > - ttm_tt_add_mapping(bdev, ttm); > > ttm->page_flags |=3D TTM_PAGE_FLAG_PRIV_POPULATED; > > if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) { > > ret =3D ttm_tt_swapin(ttm); > --=20 Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch