Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp244122rwo; Tue, 1 Aug 2023 16:26:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlH5jQlXbjMgxHJMqZbg48KQeQhhnbaSPIOG86sQPYdE8RMP+uziL4sEsZV4Uu/4IHItu1VS X-Received: by 2002:a17:906:749a:b0:99b:f52a:c00 with SMTP id e26-20020a170906749a00b0099bf52a0c00mr3269070ejl.63.1690932362039; Tue, 01 Aug 2023 16:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690932362; cv=none; d=google.com; s=arc-20160816; b=IuCK8dsar8Yt5MBzvns8IFwjj3KyN0C+89nzQ8JHep/DikmQjCXRK+WK2KAHERm92H 6sZeMWS31fneZxbOn6TdnBWQUQIo2Ie7TCMXAMhivhzGvERF9vlQk1M8gL8vQS4Nao5O o59fIxd/GcIICYVAqw98QG91wx6hVRdEDP4f94K1R/8ui5d6AWg1vLxPm58QrS7nRM7H sxOg1/KhjrAgsUJuoHjBGgxW0ca5VwQyX7KRN1bNNQGIICkaKseAn99V1MFWXWUP5iDZ 1lLEvZLAEJagG3AphO4QthSIrEB94V2Y/m0y/YJcWa3X0y5VSilzw5RKwRAv6IObsbFL PC7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=i6HEpkZDiMCJl1HNBxUq/pPnwhYuhlhYWrvFQybpJWY=; fh=GuUSihYN9cg5LmZCV2sCu3xVOah+EC5CWq+l9Dksn6w=; b=ITZNNhcpMx3VnXzy8FhXwzDn9FP3+5kDatGGbZFSIshNm7szeMCD6CkWWq3zhJDUpJ of9UOAa5Q0EFlPd6XhliIw6v/g+FrL3JxyxhuoXQM+n03rINKUQ+XANOrT/NtgKkoBEV 0Uc1QpSjSjjCgsvERIDJSwFqBgu8f2WARx5JAaKKC8McJX5ApILur5vtjWbOq5PXbu/H lJL4aoAZcR2dF03g2vKN4neGG97ICY2IbPAnVgQ+ZKMFUvMbrbcVU61tzxl+ruTUqbo7 e6ar80gQNGq1xh+2Z/uHWJwpWkT8ZGgk/hkvcFecKGUPbzXSQiEd+0ZwH1NkcDZlAJGC 12VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=V9cpwSEL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a170906524d00b0098761ff7860si1185984ejm.635.2023.08.01.16.25.38; Tue, 01 Aug 2023 16:26:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=V9cpwSEL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231703AbjHAWHt (ORCPT + 99 others); Tue, 1 Aug 2023 18:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231396AbjHAWHm (ORCPT ); Tue, 1 Aug 2023 18:07:42 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5F481BCF for ; Tue, 1 Aug 2023 15:07:41 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-585f04ffa3eso55637997b3.0 for ; Tue, 01 Aug 2023 15:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690927661; x=1691532461; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=i6HEpkZDiMCJl1HNBxUq/pPnwhYuhlhYWrvFQybpJWY=; b=V9cpwSELJrkQrszXU5HyumPij806LjFOgAKqGQckrRIsTl9WyJGm7y2tP2Z2qpZNBZ 8OnG+G2+pRoWY7Gyh/uRKHckpG/wW2klLNffgsUon5TtBq05uulzu7VlS14UeHcVePc5 6rcXGltEDaVNS9+SeI1i+AP3HDVebAv3PFT1lfSUDf6ep/jTCQ/IUFd9ttrSEA9t9DPO iGN48DWEsdFNb4WBgDh2gwPyzp4LH+hHwffYSWHoJfq3HFOTa5CTWqxb2Bx96ZnBccWK 7hzPD483pGlx4dh0dSN4wMfxSLMa6kthAGUj3r6PC/2LNnNJKhb7gl7lRbdc8DmYXSji 2fsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690927661; x=1691532461; 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=i6HEpkZDiMCJl1HNBxUq/pPnwhYuhlhYWrvFQybpJWY=; b=XXSWSvP5ziJfaSlz90qFce5wgBdqINvM9xD5K3oHHKJYkJQX93hJbaeDbTAF+LMffv p/UdlFwZe06D80EZtAK8/A7HRPF67M+IdGzmEaVOH6/orMm6SGXCVbcbSKBTQVAgzeIy zONhjn7ZRqUWRhGF2dUh3VMOUi9SLGUSym959KO/BDP9xXNVDi7uWWpNCoyr50Gk4val tnP1/VAPgyTpzhV7abSlWbblzPaJN8gbUE4Ex8m1rjheygDpEIhlFNcEFfFznG8/lqbc 8R1giQkVR5K+XnhHQaO75Rx2u9I7WwVRKCS6DWIxpZqyagQ/A0ZAmLY5lKhzp9MSthhf wDiw== X-Gm-Message-State: ABy/qLa4eGuTdqZhV49AgX+MVB6vvJ0gyXDHHEj6Yy+aAr662ZiNWxW+ notOCRIG3+KUQlYVgYIaYXpWLjBjiDA= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:211c:a2ff:f17b:c5e9]) (user=surenb job=sendgmr) by 2002:a81:b703:0:b0:584:41a6:6cd8 with SMTP id v3-20020a81b703000000b0058441a66cd8mr114995ywh.8.1690927661105; Tue, 01 Aug 2023 15:07:41 -0700 (PDT) Date: Tue, 1 Aug 2023 15:07:28 -0700 In-Reply-To: <20230801220733.1987762-1-surenb@google.com> Mime-Version: 1.0 References: <20230801220733.1987762-1-surenb@google.com> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230801220733.1987762-3-surenb@google.com> Subject: [PATCH v2 2/6] mm: for !CONFIG_PER_VMA_LOCK equate write lock assertion for vma and mmap From: Suren Baghdasaryan 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_PER_VMA_LOCK=n, vma_assert_write_locked() should be equivalent to mmap_assert_write_locked(). Suggested-by: Jann Horn Signed-off-by: Suren Baghdasaryan --- include/linux/mm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {} -- 2.41.0.585.gd2178a4bd4-goog