From patchwork Wed Apr 15 00:43:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Lespinasse X-Patchwork-Id: 11489441 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 023A414B4 for ; Wed, 15 Apr 2020 00:44:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C382C206D9 for ; Wed, 15 Apr 2020 00:44:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="h6MEDxzu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C382C206D9 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 2A6F28E0008; Tue, 14 Apr 2020 20:44:05 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2565F8E0001; Tue, 14 Apr 2020 20:44:05 -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 11EB48E0008; Tue, 14 Apr 2020 20:44:05 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id EFFB48E0001 for ; Tue, 14 Apr 2020 20:44:04 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B7F9A5DD7 for ; Wed, 15 Apr 2020 00:44:04 +0000 (UTC) X-FDA: 76708242408.21.use97_40ac919bbd114 X-Spam-Summary: 2,0,0,acfcd72cdb724084,d41d8cd98f00b204,301iwxgykcngq4fe8haiiaf8.6igfchor-ggep46e.ila@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:30064,0,RBL:209.85.210.202:@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:24,LUA_SUMMARY:none X-HE-Tag: use97_40ac919bbd114 X-Filterd-Recvd-Size: 4282 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Apr 2020 00:44:04 +0000 (UTC) Received: by mail-pf1-f202.google.com with SMTP id 65so1402878pfx.16 for ; Tue, 14 Apr 2020 17:44:04 -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=PFykNGvDt3Bxt0QgQrjfg5BlhCJRU6MbqMOEnjuLcXU=; b=h6MEDxzulGPn8cUv0luU8RVJe/qfhKlzGqRAQXJbs0Af3EIO+a8KI9Z0bZUIBiyoWC T1/f4ACXdlJ49iQHdhLlGbErN/dif21WNj2Azxnd2qdIjbAo/BFdIc8Su7g50sEjWn8e tli6Zqof+vrBGHCO+l2gLzPrZhPOHOuYBWTrYEdSVcQC+Utd0xoupvOQaQ1Dwk85/buS aol7oU58RmTZy+Nqktgd2WZuGy42av2XvOqGGPgKYDoTnzF4VxxU8ake9J/tbjefur9I SMGuflZz+iB5zk5uZgdDrgOgyC9cvRqCW9E597ljNQgoKQ9ndAJ+YP5y9xqJ/sYFFe+l L6tQ== 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=PFykNGvDt3Bxt0QgQrjfg5BlhCJRU6MbqMOEnjuLcXU=; b=blB7ehWtUdrx+nbXaJdwvLobUsRLC/SPd+fvPqGoAOdxKSLRhy1F9H/obTa8cibSq5 T1P/EEzfCGOQ2SPSeWPuTG2db1/dMNEtM626pAop3+9h/tsPPFvaKAa6yrMgXTetsABq mVeisWYq2k1u7/24eJXOV01nfYVpJVkoWAZ4BQDNSz6vGxS0FskhhQmGOrleE4Rq8ddz /7yjp0sjFnL6PTFvJG8ZhG/rZLUpncbql0S0SOsE8gU9AZ8OIPBTqygHdAGYVYlffcQj H06sIfp7Q+KJCJ3xtEjDsB8v+8okhTSrGQWMf0v/LQyWfgFousaW9R0/dShTSJVruv6J ligg== X-Gm-Message-State: AGi0PuYXmDJGYBG4ZnduoLf9tnUPF4O/9CQEmPYDNBSniMH4uMTX4ih4 eKTLuExGM7G0mbJyEvDB0Q+smGMh+lk= X-Google-Smtp-Source: APiQypJUPOjXj47njM/tZMnKODRO80SSygsOwTD52IPYAElI2mroURYKiHWeE4U+jjih6llcE6QYZ2x7niU= X-Received: by 2002:a63:40f:: with SMTP id 15mr16254934pge.57.1586911443279; Tue, 14 Apr 2020 17:44:03 -0700 (PDT) Date: Tue, 14 Apr 2020 17:43:46 -0700 In-Reply-To: <20200415004353.130248-1-walken@google.com> Message-Id: <20200415004353.130248-4-walken@google.com> Mime-Version: 1.0 References: <20200415004353.130248-1-walken@google.com> X-Mailer: git-send-email 2.26.0.110.g2183baf09c-goog Subject: [PATCH v4 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 , Daniel Jordan , 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 Reviewed-by: Daniel Jordan --- 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);