Message ID | 20230216051750.3125598-14-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 6FDB3C636D7 for <linux-mm@archiver.kernel.org>; Thu, 16 Feb 2023 05:18:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 033766B008C; Thu, 16 Feb 2023 00:18:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EFEA46B0092; Thu, 16 Feb 2023 00:18:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA2756B0093; Thu, 16 Feb 2023 00:18:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BCCB26B008C for <linux-mm@kvack.org>; Thu, 16 Feb 2023 00:18:29 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9364B121048 for <linux-mm@kvack.org>; Thu, 16 Feb 2023 05:18:29 +0000 (UTC) X-FDA: 80471999538.01.D10D3BD Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf06.hostedemail.com (Postfix) with ESMTP id DA1F2180004 for <linux-mm@kvack.org>; Thu, 16 Feb 2023 05:18:27 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=QqHoT4KB; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 3o7ztYwYKCPgxzwjsglttlqj.htrqnsz2-rrp0fhp.twl@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3o7ztYwYKCPgxzwjsglttlqj.htrqnsz2-rrp0fhp.twl@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676524707; 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=lpf0g6jEgEDruwUAtDYeX37TOF9sV0bBdZYAp5OaPFw=; b=h4wtK60Um9rHu1QfjgK1x/1ZlKn97PbilqjBsV5MmvM3w4EuLwS6EPQTOUyjp3WcBDpc0F 7sA/oTXs1YZT4rEIHJSmoZzCj0UPmA4o0cGk5KUz00k+cjPvfzEL1NNFpqZDwYGA5h7s2W Kc96v5FA4D7UkDdFjPYm8CSIPV7MJcA= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=QqHoT4KB; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 3o7ztYwYKCPgxzwjsglttlqj.htrqnsz2-rrp0fhp.twl@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3o7ztYwYKCPgxzwjsglttlqj.htrqnsz2-rrp0fhp.twl@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676524707; a=rsa-sha256; cv=none; b=VySqIvw1mVmeQgGxIeoiSvqR8jFX/Et5VEGENwqjI0GGMyzY3qhtW2GDQKhxUgzbajAzsR PRehYKExwTfzNhKHgBU37v5a3I0QIkYfSPyKuUDF0r+zqLjk6ZIh2k+NUVmKiIq6W8CVzF S4PRzGNeg/1KpFV/GobSW5tUVcWG1o4= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-52ed582a847so8806127b3.1 for <linux-mm@kvack.org>; Wed, 15 Feb 2023 21:18:27 -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=lpf0g6jEgEDruwUAtDYeX37TOF9sV0bBdZYAp5OaPFw=; b=QqHoT4KBvKUoUdLlMqp51fx+DvEGbEeCQBAnfd6VVaWQ1iGMSVWdcYYT+IcmdoGW6k 3cvpI3DbxmqWzlsZbZtdKxchg+b34bnVwYQM28D7iM4wfdyptvE97biBiYefhiTugMIi 6QLuIfwXdU8feO6tOQjuROgghWTm3q6OIMngPhTxYx3FIBx/Q/vwNR9bBonlFJnVLRif jIgBrdCbBh8/u0HLrcAEynfXgVsHAUyrN5D1sUvBi7o9DTj4LnFYvOofA3wqcNiCIoKK +suiPaGBCd0kL8KKwbFLDtmEf/YUc3gt6F4GpOlLFqmXcdgxQWnJd0Ox4qoA9H1pNQ9Z aRAQ== 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=lpf0g6jEgEDruwUAtDYeX37TOF9sV0bBdZYAp5OaPFw=; b=Q2Xh2qLAQN/dv0mYaEettPndmc0V7T2nWxOH03Oy25fn8MLt4Uh2/+3VdtaVvdkAyd GZNKQA6ObPkpbf1lVIy0a0W7aCiuUyY9GDsyXSmatixctVTXCz+fkce9Tkw6InUC37so ZVI4CkaghLcXyBBbgFQz171ybKtuiP1TC1G9kBp0zX3XTprsmackSF7GNkM+Q5Ku/uLq BMC+xc1KKrzj+sCsWZvJFrQaniMFoFQpHRCH9i5x/68oI05ZdcpdmPQAWDLJdPFkkzSZ oV+Tc3riQoALQfoxCQJsog5xisA3tmMvGjQnr9J8XTRXDrSSTVpIIGxi3OdikkCJPURk f9vg== X-Gm-Message-State: AO0yUKW0eFIzukp2xysvOYObiB8FbmfzyGIhqoMNCoWSIAb/VmLBjJVr Jpd4lRUnqLsSfbOesjahOaO1qr+adIs= X-Google-Smtp-Source: AK7set9lI2rlt8srxq1B77BNUY6DsMc7qDNM9tTWpZOotyLmczPTVi4pDHBbcvVuKtvP6t7k4zPbNPC6UU8= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:f781:d5ed:1806:6ebb]) (user=surenb job=sendgmr) by 2002:a81:5a03:0:b0:527:83f5:3f08 with SMTP id o3-20020a815a03000000b0052783f53f08mr494142ywb.425.1676524707124; Wed, 15 Feb 2023 21:18:27 -0800 (PST) Date: Wed, 15 Feb 2023 21:17:28 -0800 In-Reply-To: <20230216051750.3125598-1-surenb@google.com> Mime-Version: 1.0 References: <20230216051750.3125598-1-surenb@google.com> X-Mailer: git-send-email 2.39.1.581.gbfd45094c4-goog Message-ID: <20230216051750.3125598-14-surenb@google.com> Subject: [PATCH v3 13/35] mm: mark VMA as being written when changing vm_flags 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, paulmck@kernel.org, mingo@redhat.com, will@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, chriscli@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, rppt@kernel.org, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, leewalsh@google.com, posk@google.com, michalechner92@googlemail.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, Suren Baghdasaryan <surenb@google.com> Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: DA1F2180004 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: he1arpo87s953wrowddes7um1xqzzasd X-HE-Tag: 1676524707-511824 X-HE-Meta: U2FsdGVkX19HoUlthxPAwXzncsM2bI4v0P6u7FzELRSL9oYfBZhjLdCfuAtTy7reuUoiuaEAxK5aHu4dNhDlikL6w0M9wIXBo7Ourc0Fx8ZN1OA+DrO43uvNFH/9C9fDAuMSWpD86r25y9705sUx5YV61LuWSQ6Vm3Oetx55+yPSWyTATyjn8EYPXTRCRPGJ2hQ1WrBwg3KonLN41Qv7uHGOYaUnekTNKYRprmrkM5tw1QW1TePdS93jZEkTcdG1YwCAPI/otHlmd6m8VEqDeNdkqIdp3XC3nxcqUGMD+iWldcQUOhxgU5Q0pzpHV0WLxPuVyeSYUnzF7Jc6SgQbPYqPdnh3nKRwJyItRbtDc3Mz2fZqkEUe/kvq2Sqa/1kwkkwkOmHYCmK8CkLpePdlW6xcihTl+PeztR78Fj3kfg0VpCEMJ/32BRyxUgF3s6texKcsd3lMx5XO+RxGSwOQENTrqA6PWEWBb5V44IuQJvBYQr++KfUEUMHsyfleh1C4jHmIdpKBiFOSi0mtK6PhGVUP2x20KPygiUAys4yjsn35MaE7uZlmaTF16eJbyY73uoV0ryx1SdlH+Oeds2OMFza0C+PdVdXmbz2/sDRCF0TDgHQlCBGYb397J/EB5o4Utntzdk+2JYGq8uolVwkF3387/CdmTi/ko/BAb8+a/Yq3UyqjxfDT5d1EkzDlzCqhBX30yoLg3AySssNu45U90fbCV5BoRrovpHnZbKum2Kyw4KYN0Xdg1Ue+NtOt8tszCkIwMNzNAccMqRmxDcQLlSSF8ftvRw4oSiEzdIbsuoTG85vHlSccRCy2ysWNecdLD7t7PfFQZ6x3v+waSCUXKM6Nc1P9YqN0uC8tVNLJdXnSughQ1gX/bt337onQpel2tueSECDUdspi1ZIZtmTLVqfCjOjE88Rc2gDvtqd9b999KJjrCSpXt88wEjGX1JS9n9Tci3yd/DHcdbqVrOy AXlFLRe0 QHeyHpDykcdOWkrUrhbO5Vv1sXIWpBscH8V0xULC/gZiTZw7WIrga0rEacF9OW+3Ov+sMxxxs/PI587IvZjVV0jNSzR4/adWk79uEUUhihKR2wEksVs5oExxq+/5cpU/NVcXsUro/2vp45FiGZgte15FmwS4VpVvl0q586/cB2lwY9SVIrvCVoJ0o7geaMR8oxkMuuQeFBcD05SnQHuwnSkvHuKN9xSdtTUk5/n+PoeHktmsX5JjKc5Tw/NUjMJOpLhiYB5090t5aof70YhnzbAI+JKLnMop2/TWHRy/DTeJ42l9uqDip6nEGn6KKzSSOFKUslTrPLi1dO+phqPU+53FeHFwPFrgrKytojvvyNxy2tsJg5nVfZFlda6fRz4PWVvUdiLX/xaVtBtB34yK1errU3bHK/pLrtz0qf2+hRLXZOd+e4U7ZliEY0j130S3pQhcbm1htI+4Y0x4JIudjrepxfaRKzB6lI2NwKUpecVbgSzP9mJSgm7V5/PCGHGJpqpBP+9xNgv1YLVJkPRw0tfIaHQ8WNxTih/2WznTRmCAQY2RVpD9mQJscCc2Z49Z/3/L/hdn2VuWm8TGu2FO1QyEY6wlfJxOCd/jiRZzVPjHkY/zIJ+xB9zCye0b79eufeUGgsQaOxVl5kdphvZPBmAt+T3PIb7xj6p7Hm+CtIalk6QM= 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/mm.h b/include/linux/mm.h index a056ee170e34..f4f702224ec5 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -726,28 +726,28 @@ static inline void vm_flags_init(struct vm_area_struct *vma, static inline void vm_flags_reset(struct vm_area_struct *vma, vm_flags_t flags) { - mmap_assert_write_locked(vma->vm_mm); + vma_start_write(vma); vm_flags_init(vma, flags); } static inline void vm_flags_reset_once(struct vm_area_struct *vma, vm_flags_t flags) { - mmap_assert_write_locked(vma->vm_mm); + vma_start_write(vma); WRITE_ONCE(ACCESS_PRIVATE(vma, __vm_flags), flags); } static inline void vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags) { - mmap_assert_write_locked(vma->vm_mm); + vma_start_write(vma); ACCESS_PRIVATE(vma, __vm_flags) |= flags; } static inline void vm_flags_clear(struct vm_area_struct *vma, vm_flags_t flags) { - mmap_assert_write_locked(vma->vm_mm); + vma_start_write(vma); ACCESS_PRIVATE(vma, __vm_flags) &= ~flags; } @@ -768,7 +768,7 @@ static inline void __vm_flags_mod(struct vm_area_struct *vma, static inline void vm_flags_mod(struct vm_area_struct *vma, vm_flags_t set, vm_flags_t clear) { - mmap_assert_write_locked(vma->vm_mm); + vma_start_write(vma); __vm_flags_mod(vma, set, clear); }
Updates to vm_flags have to be done with VMA marked as being written for preventing concurrent page faults or other modifications. Signed-off-by: Suren Baghdasaryan <surenb@google.com> --- include/linux/mm.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)