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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 31BD1C433E0 for ; Wed, 24 Jun 2020 12:11:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E4FB22088E for ; Wed, 24 Jun 2020 12:11:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="kvpD+36K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4FB22088E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 775BE6B0002; Wed, 24 Jun 2020 08:11:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7277F6B0005; Wed, 24 Jun 2020 08:11:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 615D56B0007; Wed, 24 Jun 2020 08:11:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id 4B2BF6B0002 for ; Wed, 24 Jun 2020 08:11:02 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0DA5A180AD82F for ; Wed, 24 Jun 2020 12:11:02 +0000 (UTC) X-FDA: 76963989564.13.beam59_6012bbf26e44 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id AAB2818140650 for ; Wed, 24 Jun 2020 12:10:55 +0000 (UTC) X-HE-Tag: beam59_6012bbf26e44 X-Filterd-Recvd-Size: 4052 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 12:10:55 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id z63so1517677qkb.8 for ; Wed, 24 Jun 2020 05:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+zBDNe4l4Mn0/s3337RshcrDhwkSiI85QcYGWTtZwww=; b=kvpD+36KKdiLTKX0VQeyHJqK+7nGhs8ANV4vmV5MRLj/L847j9DuvoS80RODfk0E5r rzRwbpi+MpaB3mCmriGk+xdbtID5SW3zx/xTU8oc2SOXx6jB+IGBankk2EzhZ4yqLqa2 5xnHyohfSctnxWr/fcNFTuKJaqkmA1CFYaPsf2whJZeHtw45+9aHKmeEewb/TBKbdgF4 WvG+nuVViJ72pYnDDwDOQ/hBuC+egzEAj/M6DVMRwvfLvenXWi/8/XBh1lrOmsnChZ3I izAGFP8u0DdXgUdagVbvlZTKbLkzhVF6JvJg7XS34wvLhYG0/yA5YOX7KGrs0pCshAn0 CRAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+zBDNe4l4Mn0/s3337RshcrDhwkSiI85QcYGWTtZwww=; b=E9b0RPQKKdmu28TjGlph8I4ES9ic1yetVGU9Snel2QLpMzhe89kdn7wGPbCVZJwhBZ dPsKKKdCuIrWvUefZIhVpglrT7D0Lf8daBJ2JMNLicsfsD8xIEJmSOZ3pkbRrReVkyIn uQqWLtvlv3Ka4BiAoz+ftFK6Z6Vr2H522QypY34v6tPeF4Dv9fRAyud7ilUbiRYsRhJ3 MQG/4fRsXFX3mfPybSwn77aDoRrNROgu/P8ZS7JzxMAe9ydnh1DVVZUKNnq62hQkZQfe Oh2+JHXDVvzZOW+F88CjMs9Wv0+MWWS2SKRAr3OReo3Kq411bj5vFjVrnnXBHCbZNorL 7Xpg== X-Gm-Message-State: AOAM531/R6fxybOEn+x2UlqINd+B/xaBxfTrVkyXREiwicdJoV6/n7dA sZ/CZBYUHHV2aumnfU+8WxbwxA== X-Google-Smtp-Source: ABdhPJxuOSy3QUUVt+Un/KQUMhyCatEd67j4mOAN3EM5TI2PD4C9VbXwF1+uP8L9yAl3sCzf+WTYvQ== X-Received: by 2002:a37:9046:: with SMTP id s67mr10123252qkd.275.1593000654583; Wed, 24 Jun 2020 05:10:54 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id w18sm849280qtn.3.2020.06.24.05.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 05:10:54 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.93) (envelope-from ) id 1jo4Ev-00DK8g-K0; Wed, 24 Jun 2020 09:10:53 -0300 Date: Wed, 24 Jun 2020 09:10:53 -0300 From: Jason Gunthorpe To: Chris Wilson Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, Andrew Morton Subject: Re: [PATCH 1/2] mm/mmu_notifier: Mark up direct reclaim paths with MAYFAIL Message-ID: <20200624121053.GD6578@ziepe.ca> References: <20200624080248.3701-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624080248.3701-1-chris@chris-wilson.co.uk> X-Rspamd-Queue-Id: AAB2818140650 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Wed, Jun 24, 2020 at 09:02:47AM +0100, Chris Wilson wrote: > When direct reclaim enters the shrinker and tries to reclaim pages, it > has to opportunitically unmap them [try_to_unmap_one]. For direct > reclaim, the calling context is unknown and may include attempts to > unmap one page of a dma object while attempting to allocate more pages > for that object. Pass the information along that we are inside an > opportunistic unmap that can allow that page to remain referenced and > mapped, and let the callback opt in to avoiding a recursive wait. i915 should already not be holding locks shared with the notifiers across allocations that can trigger reclaim. This is already required to use notifiers correctly anyhow - why do we need something in the notifiers? I really don't like this patch, the purpose of notifiers is only to *track changes* not to influence policy of the callers. Jason