Message ID | 20230731171233.1098105-3-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 B776EC001DC for <linux-mm@archiver.kernel.org>; Mon, 31 Jul 2023 17:12:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0684D280084; Mon, 31 Jul 2023 13:12:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 017F528007A; Mon, 31 Jul 2023 13:12:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5DD6280084; Mon, 31 Jul 2023 13:12:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C575128007A for <linux-mm@kvack.org>; Mon, 31 Jul 2023 13:12:44 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8B76F16040A for <linux-mm@kvack.org>; Mon, 31 Jul 2023 17:12:44 +0000 (UTC) X-FDA: 81072551448.27.88F72A8 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf02.hostedemail.com (Postfix) with ESMTP id C0D6A80005 for <linux-mm@kvack.org>; Mon, 31 Jul 2023 17:12:42 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=GXelEXrb; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of 3ievHZAYKCKwegdQZNSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3ievHZAYKCKwegdQZNSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690823562; 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=9nr+kbatQ6YMh4Ju6KIXOvG29nOfDMrirC5hgMlL3cU=; b=O1Ao7W23ihKCwx+/OBg1xQMpvWB9/szTevdFTsO3c177fLhwSSKaukd8jJGpdo0DcnvieX Ob1B0YcioXZVRZSYQ7EKg9Etr7JlMsp9+IGn9AJud8bYUU8pHT+eY0kbUjWITRnJjo3Z0r gfcaod0UrQBRm6SQIBGLLkuZs8x4j+0= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=GXelEXrb; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of 3ievHZAYKCKwegdQZNSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3ievHZAYKCKwegdQZNSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690823562; a=rsa-sha256; cv=none; b=HGKuElVnbQ1OjPbCYIDPWt6ICUFyP0wXeQ029HSx3NIECao0DKvBh/T2ZROTCw3m6HP/bn wqEWb2cxwE1iR0Wd3jCBSa8xjyzr14h6xJYdG1zcsLpqDVPyo/YIX81LlKL9GengH2AFd2 EIR10j/3waC2QWdGoEV40C6rKVyhRiQ= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-57320c10635so57013837b3.3 for <linux-mm@kvack.org>; Mon, 31 Jul 2023 10:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690823562; x=1691428362; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9nr+kbatQ6YMh4Ju6KIXOvG29nOfDMrirC5hgMlL3cU=; b=GXelEXrbYIY2IAX+kiYu0x1tkCdi2SyGtSF/9w53Zm3gPRECLbctG/dBvEhZfym31B ZpNGuvTs3RdmkliU7juePlylZr5pnrjsO4FCwqrfsr6YZw+CfZKmgNsroN9WWEkA9+ck VJdhxNNh/Cu46QjjSL9nAJzM84Yb17nR6+dWlfcQS/FVxSuAY184c48pG3oyTsWv//zV pwBrsYEyhVF3UcXFqaT0GQRjqCuBIJhqhqjimJS9XP+GadbKmGH7LM8IjHhW/7STICdG EJDRSQ3ltPFB9ycjQw7aPjUMjYM8r7OK4dOG6LXF0kGtaXGnCriJR99uz1fZ6+M5MjcR M39g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690823562; x=1691428362; 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=9nr+kbatQ6YMh4Ju6KIXOvG29nOfDMrirC5hgMlL3cU=; b=AJxomvfuPoeG76BmnjlVfBY7faJqDdcA5AU5NKND7YRq/lYSQrucYvPVg/fMDyEdmy DpKBrf4wSxLG+TpXaNeVJNgagN8nLZKzKjLGqLZ79plcDrqM269ardN4TwsudAoV8jw3 jKyKhYbWGpeFnms/DGUDk02rmGkFi8znfaq2q//LYO7HyqRmAt77JhVQ7A2lQz1itxC2 iaIg3lKbCiRpUVHncGdf6mcoj/MWjkbpn/mn5oVEBRFE1JG1iSbwFAFP3nMil5sSDtE3 zHWibh/1h1Z3WyEdcBAb0CqamSVA4AmnRZzuiBKF7eUBEFLl/QLLzkZWS3RxwMHXD4mn 69Ag== X-Gm-Message-State: ABy/qLapsnx6zxzYX1UNdJwyldRMpq2JEyQzJmsmIgMJWUxScFbTFClT +OrSvcFcWBqpCdcR//3WB8kMKm8DvI4= X-Google-Smtp-Source: APBJJlHglqY7H7DXFApYFeh47wS6CJVxYTVOVhaQK3HM9XVkVTrRgX4b1iDjG9+19cN8CdS+pNJRAvwhhLw= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:d4d3:7e41:cb80:21ea]) (user=surenb job=sendgmr) by 2002:a25:d808:0:b0:d04:faa6:e62b with SMTP id p8-20020a25d808000000b00d04faa6e62bmr57379ybg.6.1690823561762; Mon, 31 Jul 2023 10:12:41 -0700 (PDT) Date: Mon, 31 Jul 2023 10:12:28 -0700 In-Reply-To: <20230731171233.1098105-1-surenb@google.com> Mime-Version: 1.0 References: <20230731171233.1098105-1-surenb@google.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog Message-ID: <20230731171233.1098105-3-surenb@google.com> Subject: [PATCH 2/6] mm: for !CONFIG_PER_VMA_LOCK equate write lock assertion for vma and mmap From: Suren Baghdasaryan <surenb@google.com> To: akpm@linux-foundation.org Cc: torvalds@linux-foundation.org, jannh@google.com, willy@infradead.org, liam.howlett@oracle.com, david@redhat.com, peterx@redhat.com, ldufour@linux.ibm.com, vbabka@suse.cz, michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, hannes@cmpxchg.org, dave@stgolabs.net, hughd@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, Suren Baghdasaryan <surenb@google.com> Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C0D6A80005 X-Stat-Signature: 6gx5gnrrbm8we9a1x1u4mmsc6tnkk1j4 X-HE-Tag: 1690823562-368881 X-HE-Meta: U2FsdGVkX1+j/VxQMs9CquWMx//WbqPoTJQZmYuq2m7RhT8QUqjrUpCMQSUPW4FWUrrHfJ+zMwnfD2pcwIg1zCGmNQ0GmJiD3Xm8STsjARv5awGIjvVT+nrKfi7Lhkbf6id+e/A65aiS7MpsFSGPlwGV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ubCpO0UScjZlXUSLxDIfLzXKzYQNEk0GRaJlDDBvBa8tkCuxBe0X9+EcWabdgMzbaIxWdIM2+D7dSWPNBZjhKawDWe9uDWfyL8+QYBhnVl3VQ6TiQoE53Tj7DaoyeYEIMBILs4zqtnJvuuf0YjB/Ell+FhEmEvHXClLuHV/tyV38r1E6bVeL/ut7gQSJfJxfsV8ZZGuoA+C9GdAhOO2jijKkJn6gnPSIAIHehdbrr4RajDE9Siyqsjac+CFwUl6yy54gq6sthKJnKLPZ5ughHUlLPwF9T4kfp2xVp/OOsEk2bZXUBYkhjpRBpAUcKaHe74jUpU0OC06W01HBQm9Mgj0YmkbTHmwNgBGVfPg18xFoUDBBAIv9z+3A9wRwglDiRgIC9epAzdRHWEv1L6nJPSiqsr12s0x1HO80pqNBSTEMuVl0oq3bNDncUUtuHFycgp4KUXhQOq4UAvv7gQhJxKmQsi1l5PKhEiNQNs9qgcs6uCzQ5tJq X-Bogosity: Ham, tests=bogofilter, spamicity=0.023001, 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 |
make vma locking more obvious
|
expand
|
diff --git a/include/linux/mm.h b/include/linux/mm.h index 406ab9ea818f..262b5f44101d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -750,7 +750,8 @@ static inline void vma_end_read(struct vm_area_struct *vma) {} static inline void vma_start_write(struct vm_area_struct *vma) {} static inline bool vma_try_start_write(struct vm_area_struct *vma) { return true; } -static inline void vma_assert_write_locked(struct vm_area_struct *vma) {} +static inline void vma_assert_write_locked(struct vm_area_struct *vma) + { mmap_assert_write_locked(vma->vm_mm); } static inline void vma_mark_detached(struct vm_area_struct *vma, bool detached) {}
When CONFIG_PER_VMA_LOCK=n, vma_assert_write_locked() should be equivalent to mmap_assert_write_locked(). Suggested-by: Jann Horn <jannh@google.com> Signed-off-by: Suren Baghdasaryan <surenb@google.com> --- include/linux/mm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)