From patchwork Fri Mar 27 02:10:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Lespinasse X-Patchwork-Id: 11461551 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 D7B0414B4 for ; Fri, 27 Mar 2020 02:11:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A13952074D for ; Fri, 27 Mar 2020 02:11:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jkJyZtiT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A13952074D 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 61C6B6B0037; Thu, 26 Mar 2020 22:11:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5A3086B006C; Thu, 26 Mar 2020 22:11:10 -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 46BE86B006E; Thu, 26 Mar 2020 22:11:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 24F476B0037 for ; Thu, 26 Mar 2020 22:11:10 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 073A3180AD817 for ; Fri, 27 Mar 2020 02:11:10 +0000 (UTC) X-FDA: 76639514700.09.straw11_a2892c1ae641 X-Spam-Summary: 2,0,0,f7240dd1bd2d6952,d41d8cd98f00b204,3vgb9xgykcg0hlwvpyrzzrwp.nzxwtyfi-xxvglnv.zcr@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.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: straw11_a2892c1ae641 X-Filterd-Recvd-Size: 4233 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 02:11:09 +0000 (UTC) Received: by mail-pg1-f202.google.com with SMTP id 185so6586810pgc.22 for ; Thu, 26 Mar 2020 19:11:09 -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=jkJyZtiTrah0k12mJlrKqb7rSd5WlOpLupMyryDRi33YSxPy+21eUQex0fK+X6UB+0 zT9vjBnp+JwXEhFJRtxY2RsQTudvG97D1Lhp3WSb6TWLEk4+0gziK988qhQUXl4RUfnA JJC0smgj5BCrsqaMZZx/nrKasdKT8AJ3vDRG51QIjnQs+dXXdQb8IFLBNIluFonhWM24 lBGwXY+6lOwUxGW551lnx+9w9Xh6gM3qrAD4/jWe5h3HN25ESGEJDg9fXRfMZFw8Ciia h4zvE9h5T43BpT3s4TZGvD3/NrHuQjjWBNEmx/PkneV8d+2w+CXEFk7tKbW2PI/RYW6J uOHA== 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=GlpNaHjhnl2BIFiyimFUhLaZULy/MMyhsCx9KqJjyfTvHf7aeIubN3spQg8+J02ZA9 +usxhbNa+HUzW4Y5/ljyJofXTjXW9Hloys6tEepvG8yvHShX7V3At9f+mow2sZ/d9MO3 OmwflGC3Ycgp8OvKxWyg3TWMO0Ci5I8/IGVsh6YG9jmLagjZBO3bZZHehuvy4suOLaJV uTO956N5ID55RVOJqkgDwfYdznuosY339tYJhJ0NBVos++8Si6Ebe39VqX4ucXyKcEVQ 2a06ATbPL8eAZJRPfzDJq1w/L9NO4uIUXfMToJ2BUXp0oHzgon4Ou7K3Nh+eyh0aFelX J+fw== X-Gm-Message-State: ANhLgQ31K32/IGv3dr63tAAQxXHBFmPr5Y1Ng8kRHTBxZ391cMAFa2lD dNthz23p+v5vBGdumafQsQ/8YlJhTXY= X-Google-Smtp-Source: ADFU+vvRRsE1kbtwpKYeV5gGrgzJavkeIriSS9e6ve7iTLNvp2pxYAdq+JZbiyapnuNAIMUA+wO7dwV9jjg= X-Received: by 2002:a17:90a:d585:: with SMTP id v5mr3322521pju.4.1585275068691; Thu, 26 Mar 2020 19:11:08 -0700 (PDT) Date: Thu, 26 Mar 2020 19:10:51 -0700 In-Reply-To: <20200327021058.221911-1-walken@google.com> Message-Id: <20200327021058.221911-4-walken@google.com> Mime-Version: 1.0 References: <20200327021058.221911-1-walken@google.com> X-Mailer: git-send-email 2.26.0.rc2.310.g2932bb562d-goog Subject: [PATCH v2 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);