From patchwork Fri Mar 27 22:50:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Lespinasse X-Patchwork-Id: 11463249 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C2B414B4 for ; Fri, 27 Mar 2020 22:51:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0F6EE2071B for ; Fri, 27 Mar 2020 22:51:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pr9E2+c9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F6EE2071B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D26266B0037; Fri, 27 Mar 2020 18:51:13 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CD6126B006C; Fri, 27 Mar 2020 18:51:13 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C166D6B006E; Fri, 27 Mar 2020 18:51:13 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0119.hostedemail.com [216.40.44.119]) by kanga.kvack.org (Postfix) with ESMTP id A6F3D6B0037 for ; Fri, 27 Mar 2020 18:51:13 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 63A6137F1 for ; Fri, 27 Mar 2020 22:51:13 +0000 (UTC) X-FDA: 76642639626.11.lamp47_44d88f4142839 X-Spam-Summary: 2,0,0,f7240dd1bd2d6952,d41d8cd98f00b204,3x4n-xgykcfoo2dc6f8gg8d6.4gedafmp-eecn24c.gj8@flex--walken.bounces.google.com,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1313:1314:1345:1359:1437:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3152:3352:3865:3866:3870:3871:3872:4321:5007:6261:6653:6742:9969:10004:10400:10450:10455:11026:11658:11914:12043:12297:12438:12555:12895:13069:13311:13357:14096:14097:14181:14394:14659:14721:19904:19999:21080:21433:21444:21451:21627:21987:30054,0,RBL:209.85.215.201:@flex--walken.bounces.google.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: lamp47_44d88f4142839 X-Filterd-Recvd-Size: 4231 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 22:51:12 +0000 (UTC) Received: by mail-pg1-f201.google.com with SMTP id m25so9135883pgl.8 for ; Fri, 27 Mar 2020 15:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=lSXLGIOt8CRablzbfhFF+Q5uTpG35OzukruA70fch2E=; b=pr9E2+c94H3cyVpUhv6RL9t5kHwQquMJZk6iN1ny94wPJj0B4pWgILpyBC7hsMbiB3 F0leBO0n6ZLok2b2apMVgxlGtxUzMlKDjdo9YP04ZeM3huYyUtpl3S/k69p8+mXU/5DU xgAxQGPDUu0roolsXlPjQg+fsdBF84v2cH1RY4RR1KugvkjcWiZdP2I6TEiYEelPTJqB WIgTil+KOFbvvqg/543RqVqDAAW+1dQo2cyL2eFOHQ/hggAyhFbJaP+hpX/VJ/hLJhhL 8S0GW8RJt04wKndXyNfoOh2W6RkZ+iACRYxpvS1QMD920yFO91jUXp5wC2kZKhzNJ4uo S5pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=lSXLGIOt8CRablzbfhFF+Q5uTpG35OzukruA70fch2E=; b=oW+i9mD34EHi1YPDoO6wmxSwZeagVWulWelfB/N4lo2RgANo+mmk3X+bAIYaLVIp/D Q0i7afT/EZaSRpQ3qMBBqmo6IBH/pJ17A56t4TwZiz1QN1W2hz/HAN9Yutsn3lkmLv2Y EGl7libVY/T83dJHNU6UzBlH/mKf+qNUspECHhustxAJqj3FCNFeSBL6/sYhR+2Ncb7D o9Lhwth1A2l6nvVOu6Upakv3n71+MEqBbZBgqM7iuU0SQmgI4AT1EIBe9OXytEBbM6/F vwS/00PvbRLHbdyzEWv3aTEscrl7TO06UdWSQcXd8lDqfrDVueNVhQH+IL+uy7ja7pEM VXhA== X-Gm-Message-State: ANhLgQ2cDjg4HCwU36P/BVHFSgXYsUVwYu6Lc2/h281JMUS0quZnvy5S l07OQr59gypm6GY4E2eJJ9JCyeroQGo= X-Google-Smtp-Source: ADFU+vtDE/LK5H5j6boGSuTVP/f/NQ7fzp4Go6KUomHA2EDSqo6OJIDYUOBj8rfcrmJBNJBWlVLgAyrjWd4= X-Received: by 2002:a17:90a:e003:: with SMTP id u3mr1773277pjy.157.1585349471947; Fri, 27 Mar 2020 15:51:11 -0700 (PDT) Date: Fri, 27 Mar 2020 15:50:55 -0700 In-Reply-To: <20200327225102.25061-1-walken@google.com> Message-Id: <20200327225102.25061-4-walken@google.com> Mime-Version: 1.0 References: <20200327225102.25061-1-walken@google.com> X-Mailer: git-send-email 2.26.0.rc2.310.g2932bb562d-goog Subject: [PATCH v3 03/10] DMA reservations: use the new mmap locking API From: Michel Lespinasse To: Andrew Morton , linux-mm Cc: LKML , Peter Zijlstra , Laurent Dufour , Vlastimil Babka , Matthew Wilcox , Liam Howlett , Jerome Glisse , Davidlohr Bueso , David Rientjes , Hugh Dickins , Ying Han , Jason Gunthorpe , Markus Elfring , Michel Lespinasse 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: This use is converted manually ahead of the next patch in the series, as it requires including a new header which the automated conversion would miss. Signed-off-by: Michel Lespinasse --- drivers/dma-buf/dma-resv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c index 4264e64788c4..b45f8514dc82 100644 --- a/drivers/dma-buf/dma-resv.c +++ b/drivers/dma-buf/dma-resv.c @@ -34,6 +34,7 @@ #include #include +#include #include /** @@ -109,7 +110,7 @@ static int __init dma_resv_lockdep(void) dma_resv_init(&obj); - down_read(&mm->mmap_sem); + mmap_read_lock(mm); ww_acquire_init(&ctx, &reservation_ww_class); ret = dma_resv_lock(&obj, &ctx); if (ret == -EDEADLK) @@ -118,7 +119,7 @@ static int __init dma_resv_lockdep(void) fs_reclaim_release(GFP_KERNEL); ww_mutex_unlock(&obj.lock); ww_acquire_fini(&ctx); - up_read(&mm->mmap_sem); + mmap_read_unlock(mm); mmput(mm);