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=-6.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B5830C433E1 for ; Thu, 30 Jul 2020 12:17:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6D39E20842 for ; Thu, 30 Jul 2020 12:17:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=shipmail.org header.i=@shipmail.org header.b="DqHS8RqM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D39E20842 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shipmail.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0CAD26B0002; Thu, 30 Jul 2020 08:17:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 07C026B0005; Thu, 30 Jul 2020 08:17:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EADFE6B0006; Thu, 30 Jul 2020 08:17:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D39AA6B0002 for ; Thu, 30 Jul 2020 08:17:55 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9271E180AD806 for ; Thu, 30 Jul 2020 12:17:55 +0000 (UTC) X-FDA: 77094643710.19.arm83_0a0871026f7b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 658031ACEAD for ; Thu, 30 Jul 2020 12:17:55 +0000 (UTC) X-HE-Tag: arm83_0a0871026f7b X-Filterd-Recvd-Size: 4104 Received: from ste-pvt-msa2.bahnhof.se (ste-pvt-msa2.bahnhof.se [213.80.101.71]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 30 Jul 2020 12:17:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 1E9933FA20; Thu, 30 Jul 2020 14:17:50 +0200 (CEST) Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=DqHS8RqM; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=shipmail.org Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nBo2n-c5eens; Thu, 30 Jul 2020 14:17:49 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id ABF163FA05; Thu, 30 Jul 2020 14:17:45 +0200 (CEST) Received: from localhost.localdomain (jfdmzpr03-ext.jf.intel.com [134.134.139.72]) by mail1.shipmail.org (Postfix) with ESMTPSA id 047E2361FE2; Thu, 30 Jul 2020 14:17:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1596111466; bh=iGyJdancEFzCgpEB/a6usgzLP2OYr7hvhwkRRKPMpic=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=DqHS8RqMbQzRNtSCinBnECl9eqheZ6A6v/8ioQurPah6QK48G9eUTS7y/tQukkPXI mlbIc9xokmoipp8Ig1QeG5KZOh1SmRt770bR+Zc/whzSRhFBd9USMBeEKnfnP8V6HU NfAc5Lj/RmEBe0Dqr7v55XqnTJyvUEHSYYA+50cY= Subject: Re: [PATCH] dma-resv: lockdep-prime address_space->i_mmap_rwsem for dma-resv To: Daniel Vetter , DRI Development Cc: Intel Graphics Development , Daniel Vetter , Sumit Semwal , =?UTF-8?Q?Christian_K=c3=b6nig?= , linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Dave Chinner , Qian Cai , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Jason Gunthorpe , linux-mm@kvack.org, linux-rdma@vger.kernel.org, Maarten Lankhorst References: <20200728135839.1035515-1-daniel.vetter@ffwll.ch> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28Intel=29?= Message-ID: <38cbc4fb-3a88-47c4-2d6c-4d90f9be42e7@shipmail.org> Date: Thu, 30 Jul 2020 14:17:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200728135839.1035515-1-daniel.vetter@ffwll.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 658031ACEAD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 7/28/20 3:58 PM, Daniel Vetter wrote: > GPU drivers need this in their shrinkers, to be able to throw out > mmap'ed buffers. Note that we also need dma_resv_lock in shrinkers, > but that loop is resolved by trylocking in shrinkers. > > So full hierarchy is now (ignore some of the other branches we already > have primed): > > mmap_read_lock -> dma_resv -> shrinkers -> i_mmap_lock_write > > I hope that's not inconsistent with anything mm or fs does, adding > relevant people. > Looks OK to me. The mapping_dirty_helpers run under the i_mmap_lock, but don't allocate any memory AFAICT. Since huge page-table-entry splitting may happen under the i_mmap_lock from unmap_mapping_range() it might be worth figuring out how new page directory pages are allocated, though. /Thomas