Message ID | 20230109205336.3665937-11-surenb@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DA55C5479D for <linux-mm@archiver.kernel.org>; Mon, 9 Jan 2023 20:54:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0AF28E000E; Mon, 9 Jan 2023 15:54:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AF5A58E0001; Mon, 9 Jan 2023 15:54:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 996EE8E000E; Mon, 9 Jan 2023 15:54:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 89BCB8E0001 for <linux-mm@kvack.org>; Mon, 9 Jan 2023 15:54:08 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 52E1C80F30 for <linux-mm@kvack.org>; Mon, 9 Jan 2023 20:54:08 +0000 (UTC) X-FDA: 80336462976.12.124065E Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf08.hostedemail.com (Postfix) with ESMTP id ADCEA160011 for <linux-mm@kvack.org>; Mon, 9 Jan 2023 20:54:06 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=lU92C8Jc; spf=pass (imf08.hostedemail.com: domain of 37X68YwYKCAIuwtgpdiqqing.eqonkpwz-oomxcem.qti@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=37X68YwYKCAIuwtgpdiqqing.eqonkpwz-oomxcem.qti@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673297646; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=S7Z9LsPdf1X6x51hAUi2Nm1VlEONIlFgbEepvCuHuj0=; b=fvDKcSCxWWN2CmVuqX1j1jzwQ/Qm+0tqGlty/CAEZDm64LItTY9yPBUKNI9w/UqTwryCJY IjUilRbFayb9Kkcz7V7PCLqwuwUww3uHrEJpkL2VVhvzzkSQfuSAbeCBULuxcrzZSXaXtj JXgEy7wR/l6hxn+AdB5GR3+fayYW+jo= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=lU92C8Jc; spf=pass (imf08.hostedemail.com: domain of 37X68YwYKCAIuwtgpdiqqing.eqonkpwz-oomxcem.qti@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=37X68YwYKCAIuwtgpdiqqing.eqonkpwz-oomxcem.qti@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673297646; a=rsa-sha256; cv=none; b=j9ZwJNCXqH+CtQPf2Dd7O19Ke9wBLPVadoOZQnbtVceowTSl9dVMbbt4nOPvDUWckwyXft 4PbqQVEP1lYl/ofBk2Uwlm3jr8hmR88HB6ifXUnq2YaNg3wSCmGBFpqYm/ttNyALflhG0B 8S/vz+3iCnpQeFNp8udVzYrpys73M1Q= Received: by mail-yb1-f201.google.com with SMTP id e12-20020a25500c000000b007b48c520262so10313453ybb.14 for <linux-mm@kvack.org>; Mon, 09 Jan 2023 12:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=S7Z9LsPdf1X6x51hAUi2Nm1VlEONIlFgbEepvCuHuj0=; b=lU92C8Jcfmul8qFoqZuzCOb83nRDo2DOHABHtbUeff7KpjabsQdodVMIjgjNegm4Ui gxUyuAPRcETsiRyXJ5mliOj6g1oYM6B1qnPvTAT1LA3dK82Ds4hQfkrM9RtYlbde0cbx i9uLWTSQCuYKj1fxgTqem2OIhsK37AMmmELynCklGF8pD//eviNoFDjhffy4KqRRdQJC MSzyVPeVUGI3nBlo70SJ15d8SfW3UoSbvzQXr0uydmfUdXg4Fl9jpjR3RSUiLlvME5Kv Z62tI5fReQIg+DMNczYR66QAZbTIG8pGdwhVnCRBmPZaWsdfRkDIb3vX4UMeFSba2+4A TcUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S7Z9LsPdf1X6x51hAUi2Nm1VlEONIlFgbEepvCuHuj0=; b=phhJFKXmO7qMJ5/P+TEpiZGW/BKgRn1j6IzUwZqJUpIkPiQf0puYDgAma35HpEWEl/ btgsrmtNZZdu5IPako2pf43ZzFStH5SvcI1c9Srripbi7ncTwGKgwRZ7m2/HhSNKaZSC h2kEa1rQBHZnN+VYdjUDhKZqq4eLhO1dhjKQo1HMIwka2fb9I8qHKjiDYPjNsZPu8gTN 7c0wCqVp4Lsrb7XWSF92VIH2ot1cU9A0SLNl7dZ6LUauViEQXTVVh8u8EU3ozugQQe4+ UNwsXk5cfko2l34Ab4VlJyobWq3EeODfx+YAN7/hJg93iQR8C9Rbg4VwQhqSOAsBikcI +dgg== X-Gm-Message-State: AFqh2kr791bo6/UxgduWSmNFcYpOlo2Ym7Hkf0fZDOVsPh3hdE0ZvWFr naQnPP1OEgpd6L6eJIqwB+IA/+byTC0= X-Google-Smtp-Source: AMrXdXt5VtatAvHvgu6DDkpLTQLv6tox4QHYgsFVwcGGt6mUkf2zF94ad2ULjvwhvY9gJJrtYWAmbQIwTHs= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:9393:6f7a:d410:55ca]) (user=surenb job=sendgmr) by 2002:a81:4fd0:0:b0:468:5f78:265a with SMTP id d199-20020a814fd0000000b004685f78265amr1632391ywb.87.1673297645909; Mon, 09 Jan 2023 12:54:05 -0800 (PST) Date: Mon, 9 Jan 2023 12:53:05 -0800 In-Reply-To: <20230109205336.3665937-1-surenb@google.com> Mime-Version: 1.0 References: <20230109205336.3665937-1-surenb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230109205336.3665937-11-surenb@google.com> Subject: [PATCH 10/41] mm: move mmap_lock assert function definitions From: Suren Baghdasaryan <surenb@google.com> To: akpm@linux-foundation.org Cc: michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com, paulmck@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, hughlynch@google.com, leewalsh@google.com, posk@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, surenb@google.com Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: jm5hkip9atew5zcfamfnx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id3nbuZ cC03RvD9Tlh87CioLkCb6n0ceKfn9JpJPMyOpf4J6Rjr/wsXY12arxgY9WYBvrkFgTyRn17w07e63v9nyfLtT+mIooM9cM53ttC1fyqjteW/Io5yh6fh5y07rEIH+NT+oa834JL27SmZsaJeVcAjsSMxK2MVD9Fw/L1jCOBI8dEOOV8lR2V+8QM8ndWlLnsgYRv/gTEuKE7mRO/3REtlqP960qBngeN24k6IgVa/uiI86FCUFdlTnRSm6XStb6QjcWhOmrNvX1JOVGmo0VwYbgfpis8DhbLLqWWG95OyBrfGzg/ApMksmbTlrlEpxdGD+aAIZognXUawOAgDyYfNN7D/eRD5U5lhh1EorezhbNaNdSMf5ZQ2JtBGUsaduUWwKMRu7XaJwdTruYtEFv60xEU5T+0MsVqBNuh3o 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: <linux-mm.kvack.org> |
Series |
Per-VMA locks
|
expand
|
diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h index 96e113e23d04..e49ba91bb1f0 100644 --- a/include/linux/mmap_lock.h +++ b/include/linux/mmap_lock.h @@ -60,6 +60,18 @@ static inline void __mmap_lock_trace_released(struct mm_struct *mm, bool write) #endif /* CONFIG_TRACING */ +static inline void mmap_assert_locked(struct mm_struct *mm) +{ + lockdep_assert_held(&mm->mmap_lock); + VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm); +} + +static inline void mmap_assert_write_locked(struct mm_struct *mm) +{ + lockdep_assert_held_write(&mm->mmap_lock); + VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm); +} + static inline void mmap_init_lock(struct mm_struct *mm) { init_rwsem(&mm->mmap_lock); @@ -150,18 +162,6 @@ static inline void mmap_read_unlock_non_owner(struct mm_struct *mm) up_read_non_owner(&mm->mmap_lock); } -static inline void mmap_assert_locked(struct mm_struct *mm) -{ - lockdep_assert_held(&mm->mmap_lock); - VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm); -} - -static inline void mmap_assert_write_locked(struct mm_struct *mm) -{ - lockdep_assert_held_write(&mm->mmap_lock); - VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm); -} - static inline int mmap_lock_is_contended(struct mm_struct *mm) { return rwsem_is_contended(&mm->mmap_lock);
Move mmap_lock assert function definitions up so that they can be used by other mmap_lock routines. Signed-off-by: Suren Baghdasaryan <surenb@google.com> --- include/linux/mmap_lock.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)