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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 CE74BC433C1 for ; Tue, 23 Mar 2021 15:13:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 77F0E619C6 for ; Tue, 23 Mar 2021 15:13:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77F0E619C6 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DBEDB6B020E; Tue, 23 Mar 2021 11:13:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D6F476B0213; Tue, 23 Mar 2021 11:13:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5EF56B0246; Tue, 23 Mar 2021 11:13:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id AAB796B020E for ; Tue, 23 Mar 2021 11:13:22 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6E7068249980 for ; Tue, 23 Mar 2021 15:13:22 +0000 (UTC) X-FDA: 77951482644.09.6643217 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf13.hostedemail.com (Postfix) with ESMTP id 49D10E00021B for ; Tue, 23 Mar 2021 15:13:19 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1616512398; h=from:from:reply-to: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=bzkya0dHCxiB5h1H9zH+lPfJ4WKvuf8IG2LAwE/cVeI=; b=shZ/fjMC266O/92AWCMJ+Gn6FWU17pZY+cqZVDU1jENzh+S33tC0xvpy9jV8NvzGQeDG2V wFykMuansupGsfyuF0vCtUuKzr34+ybgWQGqmWEUt/2DUUDc+wJVuNBSTXwlRr87MV4CTN /LAlN7wbXD6FSzqPxccOrV3F/9wJBw8= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D8125ACBF; Tue, 23 Mar 2021 15:13:17 +0000 (UTC) Date: Tue, 23 Mar 2021 16:13:12 +0100 From: Michal Hocko To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Matthew Wilcox , dri-devel , Linux MM , amd-gfx list , Dave Chinner , Leo Liu Subject: Re: [PATCH] drm/ttm: stop warning on TT shrinker failure Message-ID: References: <75ff80c5-a054-d13d-85c1-0040addb45d2@gmail.com> <20808d08-b66c-13c3-f672-ebce216b2fa2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-Stat-Signature: jppgwbajg4safrathpuz71g5r7njaf89 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 49D10E00021B Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf13; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616512399-800009 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 Tue 23-03-21 14:56:54, Christian K=F6nig wrote: > Am 23.03.21 um 14:41 schrieb Michal Hocko: [...] > > Anyway, I am wondering whether the overall approach is sound. Why don= 't > > you simply use shmem as your backing storage from the beginning and p= in > > those pages if they are used by the device? >=20 > Yeah, that is exactly what the Intel guys are doing for their integrate= d > GPUs :) >=20 > Problem is for TTM I need to be able to handle dGPUs and those have all > kinds of funny allocation restrictions. In other words I need to guaran= tee > that the allocated memory is coherent accessible to the GPU without usi= ng > SWIOTLB. >=20 > The simple case is that the device can only do DMA32, but you also got > device which can only do 40bits or 48bits. >=20 > On top of that you also got AGP, CMA and stuff like CPU cache behavior > changes (write back vs. write through, vs. uncached). OK, so the underlying problem seems to be that gfp mask (thus mapping_gfp_mask) cannot really reflect your requirements, right? Would it help if shmem would allow to provide an allocation callback to override alloc_page_vma which is used currently? I am pretty sure there will be more to handle but going through shmem for the whole life time is just so much easier to reason about than some tricks to abuse shmem just for the swapout path. --=20 Michal Hocko SUSE Labs