From patchwork Wed Apr 22 00:14:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Lespinasse X-Patchwork-Id: 11502547 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 97A7613B2 for ; Wed, 22 Apr 2020 00:14:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 64A9620706 for ; Wed, 22 Apr 2020 00:14:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sB5nY0d7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64A9620706 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 95D498E0008; Tue, 21 Apr 2020 20:14:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9119E8E0003; Tue, 21 Apr 2020 20:14:33 -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 7D60B8E0008; Tue, 21 Apr 2020 20:14:33 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id 667F38E0003 for ; Tue, 21 Apr 2020 20:14:33 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 27F00180AD820 for ; Wed, 22 Apr 2020 00:14:33 +0000 (UTC) X-FDA: 76733569626.28.blow82_44cfcfc9b594f X-Spam-Summary: 2,0,0,4be450fac3044e38,d41d8cd98f00b204,3z4yfxgykcpg1fqpjslttlqj.htrqnsz2-rrp0fhp.twl@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.215.201:@flex--walken.bounces.google.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.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: blow82_44cfcfc9b594f X-Filterd-Recvd-Size: 4287 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 22 Apr 2020 00:14:32 +0000 (UTC) Received: by mail-pg1-f201.google.com with SMTP id 189so213196pgb.10 for ; Tue, 21 Apr 2020 17:14:32 -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=UAEzdyMiRrOhtZuLD3lTnP68UOKOqMWTsjPHTtGkwuw=; b=sB5nY0d7HNEnyNFQPIPL6m6Kh611Etd/DoVT5T/Ph2JZ26H9Uai54sw+NpDER2K3+Z uAcWLNM6sC7d4ksjWP04IheEn1gl1lIuaQpUeTX67Ter97MvnpNdx2JgAyZRoVu2CI8q 5jUWe8+/IY8Y4SYzSb3WnkFZ1BAJ74RQyOP64xHD+wGPfCHpFWLPgpjKtJYNe3VaTcMU /hCPUzgUaLsq/GzyRC+AsOHNg/k9PxAGC++F6VyesAA3GKQR8C2CpJC4TtT98+6or4UB vsCVgmmXVSz85/t+1COyQkROYEKfFaXYIOIAKVOAHFeV1peDKHB7uQrfzFLVsobJGT4a Z8Cg== 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=UAEzdyMiRrOhtZuLD3lTnP68UOKOqMWTsjPHTtGkwuw=; b=pbLXZR1E4PLum2Cvs8OzsAl2QelrJUpSav/shym0AZZeXz3VJG7Hhp/GvSWdlAbgr8 QYjvurRuNJRG5Fhyr0O2b6brlIBW0loajf3hM8bLsUypJUVcQF0FCNiFlO/CXUeAhAs9 sbEG8MpA9A0Pr1nIzEn+Nmwg4A+oZvWr+tkEs5OxY2frjBaySua7H5YyW26DOVML+hpF vRDqdg2m2cyJs8FvAoZS4ZJvLcPohmNLbMqwIjg0v8Va0CJ4Zjmv9K7kYAKarVAPaSCZ f/ow5BeZVIQbI4re/3PtWgKRoAKFFW2LDKNx1phB/7ONT2zPD5TKWebFYsPjGeQP+K5t M4Ew== X-Gm-Message-State: AGi0PuaciUe3TEgAy2g3Q1cXgNxc8JUwCS5S2MmZhuFWRKZrfaut7Bpd q+EXjQyGAmjMi9jV3jaxkIdWPprU8Wc= X-Google-Smtp-Source: APiQypI1owOp4WSl5zVc2FPL1GdOwdwZSropHZlQ8q5Y97qp1WP+lcSDQax4Y0xqyAUDuqyU+hmG2EDRCMU= X-Received: by 2002:a63:8948:: with SMTP id v69mr16501197pgd.351.1587514471822; Tue, 21 Apr 2020 17:14:31 -0700 (PDT) Date: Tue, 21 Apr 2020 17:14:15 -0700 In-Reply-To: <20200422001422.232330-1-walken@google.com> Message-Id: <20200422001422.232330-4-walken@google.com> Mime-Version: 1.0 References: <20200422001422.232330-1-walken@google.com> X-Mailer: git-send-email 2.26.1.301.g55bc3eb7cb9-goog Subject: [PATCH v5 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 Reviewed-by: Vlastimil Babka Reviewed-by: Laurent Dufour --- 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);