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=-11.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,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 9C6D1C4338F for ; Sun, 22 Aug 2021 21:31:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55F346125F for ; Sun, 22 Aug 2021 21:31:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 55F346125F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADA4189CE1; Sun, 22 Aug 2021 21:31:27 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2FC189CE1 for ; Sun, 22 Aug 2021 21:31:26 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D9566125F; Sun, 22 Aug 2021 21:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1629667886; bh=BIO4EtQqF82NHJ/PedKbMdeHnv3gGrG0FGYXYdwBHns=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sA3rmeQxIvOA8q5ZaXh6MBbgrvVQCgS75Y/AP0RD5h+Mpr1T+76Q8oleZgoBMUA2r +As9VB8kwwd702mjLZOgpN7v2zctp6lM8CSjgGagHaCgo0GaghzvwP+b8mcxJYV9Z9 //WxXZpR6hVnpylepy5sKHWiFVLasTgGH3k7sbjk= Date: Sun, 22 Aug 2021 14:31:25 -0700 From: Andrew Morton To: =?ISO-8859-1?Q?"Christian_K=F6nig"?= Cc: dri-devel@lists.freedesktop.org, daniel@ffwll.ch Subject: Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function v2 Message-Id: <20210822143125.dbd2e80dc812b0d5c81d0d49@linux-foundation.org> In-Reply-To: <20210820120528.81114-2-christian.koenig@amd.com> References: <20210820120528.81114-1-christian.koenig@amd.com> <20210820120528.81114-2-christian.koenig@amd.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 20 Aug 2021 14:05:27 +0200 "Christian K=F6nig" wrote: > While unplugging a device the TTM shrinker implementation > needs a barrier to make sure that all concurrent shrink > operations are done and no other CPU is referring to a > device specific pool any more. >=20 > Taking and releasing the shrinker semaphore on the write > side after unmapping and freeing all pages from the device > pool should make sure that no shrinker is running in > paralell. >=20 > This allows us to avoid the contented mutex in the TTM pool > implementation for every alloc/free operation. >=20 > v2: rework the commit message to make clear why we need this Acked-by: Andrew Morton