Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1187604ybl; Fri, 23 Aug 2019 14:58:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgXgNsDd7awVRSBbQUQszpiXns9fJjpxc3Qpca0MNS+e8ZqE5jKvxJkB52111ZDfPypAa1 X-Received: by 2002:a63:29c4:: with SMTP id p187mr5906524pgp.330.1566597529626; Fri, 23 Aug 2019 14:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566597529; cv=none; d=google.com; s=arc-20160816; b=YlDKTywfEcGp0KUszx2PyHB2Q725paHaJi87hlPUQY1exZm9mTOvO+safc+DdkK37j o1Nlee0BwSbGCwCCi85VyoMFwhmSZnFCmuL86XvinSihany49xySDnLCuPdStNJ3CvSz rDnzb1s4nwa5sPxc3TFjAFfl4wX2UzwfkA7hVDMSl+6q1Ur9oNxRhUT0oMtfYEzPeSBr EIeo4PHegkGNMhAc87G3FMF20w++pJB0XWl/i3AT5b3wReNkk/ItuMRabFuT0n/+1qRd Hu803+zo+vdKghURCe/hHD+vds87B/i3nb6sleN+fh2eN0MaX72oXZeSS0c6jw+G4oc+ UYPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wxFK1aA0wANvaZBFOZeC8vmeMYoAclgIu5T4D4G9HXQ=; b=r+4C1drzKhYoKjwuZU2cppJfbLQdKPcJ9stckqiqYIx7idbnDRmenaZ4QdK7PclWek 4bd80HZwpUeHi8qMHe/6W50WoZJzEzxmfFp6oh3VLnBCAOl2DnSmGm2XWcqeDEFd2rOg YkCQTy5Q/HYRb7nnYzoqT4npuIzb4wMSHHxefr7NPVqELBvOu1/yzpvC8fUJjxkZDqWl jdHxQRx+pnyo6Z9q1EH5AujK9obuJ+Qjf0fNnF8r9THwlYFkOYdrtjbs5uyLMgGE0gKL BUskFBVDEZ8dGNgi9fe4wP7P5Q9qihyYWntxJ7kdUFkB1b2ciS92N/q2/LDPO6W68k1E ZhNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=CnMhbM30; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 94si3525834plc.407.2019.08.23.14.58.33; Fri, 23 Aug 2019 14:58:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=CnMhbM30; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404959AbfHWIuC (ORCPT + 99 others); Fri, 23 Aug 2019 04:50:02 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36270 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732658AbfHWIuC (ORCPT ); Fri, 23 Aug 2019 04:50:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wxFK1aA0wANvaZBFOZeC8vmeMYoAclgIu5T4D4G9HXQ=; b=CnMhbM30GaWTsXZGmRo6LbfVn Ygk8oEXFMbQJrjHRsVys7xjJznnhhiyAm+CJuRLiyNLXi9SSH2AH2BEU4WOOO1o+HjieCWYT5IVU7 UjHMMhMUHjvb2306/QG19Tyzns9cyblu5PmRBKi1qgSIO1KjKzt/Y1u1S6XBDQTX5tzlkNPSZJM4F uu7eI8xJdEKgRIMViW6/9iQW7qamlk6L8o0zs/ucAg8Uo5EVpn4fsnn6/vThBJ77LM9oo1bgVxCMj 8b39v7+8BGwwWuGNUBnsT7jAszMZnussiZeUsag/eo3qdcJQw5/wvkfJmr4SiQCP9rKSKcScuraif W4p7C5zfw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i15Gg-0007R6-6x; Fri, 23 Aug 2019 08:49:58 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5A2D1307510; Fri, 23 Aug 2019 10:49:24 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BD24120B3358F; Fri, 23 Aug 2019 10:49:56 +0200 (CEST) Date: Fri, 23 Aug 2019 10:49:56 +0200 From: Peter Zijlstra To: Daniel Vetter Cc: Intel Graphics Development , LKML , Daniel Vetter , Ingo Molnar , Will Deacon Subject: Re: [PATCH 3/3] drm/i915: use might_lock_nested in get_pages annotation Message-ID: <20190823084956.GF2369@hirez.programming.kicks-ass.net> References: <20190820081951.25053-1-daniel.vetter@ffwll.ch> <20190820081951.25053-3-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820081951.25053-3-daniel.vetter@ffwll.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 20, 2019 at 10:19:51AM +0200, Daniel Vetter wrote: > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h > index a0b1fa8a3224..b3fd6aac93bc 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h > +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h > @@ -233,10 +233,26 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj, > int ____i915_gem_object_get_pages(struct drm_i915_gem_object *obj); > int __i915_gem_object_get_pages(struct drm_i915_gem_object *obj); > > +enum i915_mm_subclass { /* lockdep subclass for obj->mm.lock/struct_mutex */ > + I915_MM_NORMAL = 0, > + /* > + * Only used by struct_mutex, when called "recursively" from > + * direct-reclaim-esque. Safe because there is only every one > + * struct_mutex in the entire system. */ > + I915_MM_SHRINKER = 1, > + /* > + * Used for obj->mm.lock when allocating pages. Safe because the object > + * isn't yet on any LRU, and therefore the shrinker can't deadlock on > + * it. As soon as the object has pages, obj->mm.lock nests within > + * fs_reclaim. > + */ > + I915_MM_GET_PAGES = 1, Those comments are inconsistently styled; if you move them, might as well fix that too :-) > +}; > +