From patchwork Wed Apr 22 00:14:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Lespinasse X-Patchwork-Id: 11502545 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 CE52C13B2 for ; Wed, 22 Apr 2020 00:14:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 91A7920575 for ; Wed, 22 Apr 2020 00:14:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="fOCgPjpj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91A7920575 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 4A4358E0007; Tue, 21 Apr 2020 20:14:31 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 42C3B8E0003; Tue, 21 Apr 2020 20:14:31 -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 3425A8E0007; Tue, 21 Apr 2020 20:14:31 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 1C9778E0003 for ; Tue, 21 Apr 2020 20:14:31 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E14F6180AD820 for ; Wed, 22 Apr 2020 00:14:30 +0000 (UTC) X-FDA: 76733569500.03.eggs81_447d6b672a15e X-Spam-Summary: 2,0,0,7318ddda948cf3be,d41d8cd98f00b204,3zyyfxgykcpyuyjiclemmejc.amkjglsv-kkityai.mpe@flex--walken.bounces.google.com,,RULES_HIT:41:152:355:379:541:800:960:973:982: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:9010:9969:10004:10400:11026:11658:11914:12043:12296:12297:12438:12555:12895:13069:13311:13357:14096:14097:14181:14394:14659:14721:21080:21433:21444:21451:21627:21990:30054:30064,0,RBL:209.85.210.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: eggs81_447d6b672a15e X-Filterd-Recvd-Size: 4309 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Wed, 22 Apr 2020 00:14:30 +0000 (UTC) Received: by mail-pf1-f201.google.com with SMTP id 84so522209pfx.20 for ; Tue, 21 Apr 2020 17:14:30 -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=/xPYX04nKsJiukhQBuhEJ9u68izHM8ZA0ttUVx7HKYQ=; b=fOCgPjpjPqfxN/zvti9Uz9F22MJpVgNh2v3q4OjtyOZDSp4ZHvIbKO+bJyTLsueskU 6Rmqq5V27Lx/yqlIkm6H0R1h1NmhLkwtJUghxHRvkrj+vQGMskDR6WrzkQnOIXkHFWsk rxQwkUz6OXvo4ppJrc6ESa+nQR/cEGDvw5IrPT2xJBM3FI8Y+MItUjG92F9hCpPofyCl IC3wFW0btBDWYfDD+Ispzve/ACmrzfDLNkrHePsFoESSKCrhRNinJTHcFUihIjzGWSMV cMgo5U5WpTSaRtbOJLR3n/ArQ7X6KVyC+Hf3Cv56RiiU92ieeplRQ0m8kGxOrywVuFrD +dXA== 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=/xPYX04nKsJiukhQBuhEJ9u68izHM8ZA0ttUVx7HKYQ=; b=uO2LcOoJ8ncK3qIS1y5aiiy0k0jci4N/jC5BRB4WNe6NNyCyVLe/mdbSugcnM5bmQ0 h1g9iOBDF5L1rT22qe8XcdQ3laRCkkkmyb6OChf5TiHUsy5ofmlGy2JZhvLSm4yMRsi8 LVOLRbzZfA3CpzE9hAEEfTzZGPY0awYKQj0IxZNnBWddm6WrAWQwa+sL1PrsuSZAzH5G yXXsenj6hsjnlRpV0XqctAUvPJFQLSz3MvNjsKYb/QSj6EGuFUWRFHnBoihYW0zAod7j d9QYuTcabe6VC+gHrAvyW2Ug8aDlH3c62XpcyrMKIX5nh9SIMDbWbez231TzIyHHbnwA O99g== X-Gm-Message-State: AGi0PuYqz3zOPqOivJzU6t2FDqAY1XVgtslauqmV2erd1QficKHRnNzE +mecTg8tAbkXxSZHzXGERdlp61rBSg0= X-Google-Smtp-Source: APiQypKUjV/xhe4MdNGIXvANHcuoYitjt1clgRyFFabzndb7K24umh2BGOmFP/jqzPtEDLeknFN7MffKs9s= X-Received: by 2002:a17:90a:d808:: with SMTP id a8mr8408471pjv.6.1587514469596; Tue, 21 Apr 2020 17:14:29 -0700 (PDT) Date: Tue, 21 Apr 2020 17:14:14 -0700 In-Reply-To: <20200422001422.232330-1-walken@google.com> Message-Id: <20200422001422.232330-3-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 02/10] MMU notifier: 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 , Davidlohr Bueso 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: Davidlohr Bueso Reviewed-by: Vlastimil Babka Reviewed-by: Laurent Dufour --- include/linux/mmu_notifier.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 736f6918335e..2f462710a1a4 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -277,9 +278,9 @@ mmu_notifier_get(const struct mmu_notifier_ops *ops, struct mm_struct *mm) { struct mmu_notifier *ret; - down_write(&mm->mmap_sem); + mmap_write_lock(mm); ret = mmu_notifier_get_locked(ops, mm); - up_write(&mm->mmap_sem); + mmap_write_unlock(mm); return ret; } void mmu_notifier_put(struct mmu_notifier *subscription);