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 EA6D4C433C1 for ; Tue, 23 Mar 2021 13:41:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5F268619B3 for ; Tue, 23 Mar 2021 13:41:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F268619B3 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 D16B66B00E8; Tue, 23 Mar 2021 09:41:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC5E96B00E9; Tue, 23 Mar 2021 09:41:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B40326B00EA; Tue, 23 Mar 2021 09:41:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id 93BC56B00E8 for ; Tue, 23 Mar 2021 09:41:28 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4FA1A82499A8 for ; Tue, 23 Mar 2021 13:41:28 +0000 (UTC) X-FDA: 77951251056.28.D43C925 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf03.hostedemail.com (Postfix) with ESMTP id 1A7F1C0007D9 for ; Tue, 23 Mar 2021 13:41:26 +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=1616506886; 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=jLqUV/x83VgJArwy57QD4v3/kYs9jmrwN2mTyLJZqGU=; b=nK8OvYnkNJTxj+8Qed1aBjuRTw7oxkGF/a9W4tklR3nBzO+9uQ7ACIGumAnZ1OV6mbeUdN OH+Y5KuO67XlyW7yff4mHHgn2xLlOyNC8gQWP2mR4zsnV6Rgf7LlQ++7mXDG0YQg2RHvs3 qEI/Zktl7AaYtlds9quiO+DSDpreJp8= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 764F9ACBF; Tue, 23 Mar 2021 13:41:26 +0000 (UTC) Date: Tue, 23 Mar 2021 14:41:25 +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: <20808d08-b66c-13c3-f672-ebce216b2fa2@gmail.com> X-Stat-Signature: ibojzo1zgf9qh6dbtibczj8ioy1669xz X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1A7F1C0007D9 Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616506886-352021 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:06:25, Christian K=F6nig wrote: > Am 23.03.21 um 13:37 schrieb Michal Hocko: > > On Tue 23-03-21 13:21:32, Christian K=F6nig wrote: [...] > > > Ideally I would like to be able to trigger swapping out the shmem p= age I > > > allocated immediately after doing the copy. > > So let me try to rephrase to make sure I understand. You would like t= o > > swap out the existing content from the shrinker and you use shmem as = a > > way to achieve that. The swapout should happen at the time of copying > > (shrinker context) or shortly afterwards? > >=20 > > So effectively to call pageout() on the shmem page after the copy? >=20 > Yes, exactly that. OK, good. I see what you are trying to achieve now. I do not think we would want to allow pageout from the shrinker's context but what you can do is to instantiate the shmem page into the tail of the inactive list so the next reclaim attempt will swap it out (assuming swap is available of course). This is not really something that our existing infrastructure gives you though, I am afraid. There is no way to tell a newly allocated shmem page should be in fact cold and the first one to swap out. But there are people more familiar with shmem and its pecularities so I might be wrong here. 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 pin those pages if they are used by the device? --=20 Michal Hocko SUSE Labs