Message ID | 20230216051750.3125598-23-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 8E3B0C61DA4 for <linux-mm@archiver.kernel.org>; Thu, 16 Feb 2023 05:18:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 230166B009D; Thu, 16 Feb 2023 00:18:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B8D86B009E; Thu, 16 Feb 2023 00:18:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 032CF6B009F; Thu, 16 Feb 2023 00:18:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E52DA6B009D for <linux-mm@kvack.org>; Thu, 16 Feb 2023 00:18:50 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BFAC7C087E for <linux-mm@kvack.org>; Thu, 16 Feb 2023 05:18:50 +0000 (UTC) X-FDA: 80472000420.09.69F9DB2 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf27.hostedemail.com (Postfix) with ESMTP id D141640006 for <linux-mm@kvack.org>; Thu, 16 Feb 2023 05:18:48 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ee09VaaN; spf=pass (imf27.hostedemail.com: domain of 3t7ztYwYKCA4685s1pu22uzs.q20zw18B-00y9oqy.25u@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3t7ztYwYKCA4685s1pu22uzs.q20zw18B-00y9oqy.25u@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=1676524728; 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=Cy3b4YdYe1JheypyM1qEqlntx+LNPOiVtlvqoTpRTGk=; b=oAQQe7CvMHz4JlfWsZcFStSU4hOSRIIc9tQ3gME2OQyIY/jmfSfsndfd+PzDuudoXuhDtC gmYmZuEPQcZTW5OyBHKtycmgZQtNdXu8OjobZCGchIMtZi9+OvzlE4oiZzn6kG0+i2MDq6 ZGImHE7iAUI8R3EgSuX2OEd3nIhEqBk= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ee09VaaN; spf=pass (imf27.hostedemail.com: domain of 3t7ztYwYKCA4685s1pu22uzs.q20zw18B-00y9oqy.25u@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3t7ztYwYKCA4685s1pu22uzs.q20zw18B-00y9oqy.25u@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676524728; a=rsa-sha256; cv=none; b=ys9lsTlvpn3u6n9jBFaJ63KPOwlmFIhPCxtp6oObvFfH4vmdw14AhrqUnduYc0jVEmPWue eAzwUrzboeDsfuk9RdR9bdxb7VULh/rY/aK9+VrSN0gSQF0T+acMDZjuWxiObj0IWg7Egt dsTEHzskorwH2CHFRiBrx3Gu6ZoKZQY= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-52ee93d7863so8369147b3.18 for <linux-mm@kvack.org>; Wed, 15 Feb 2023 21:18:48 -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=Cy3b4YdYe1JheypyM1qEqlntx+LNPOiVtlvqoTpRTGk=; b=ee09VaaNfMCXdTYs7ho4FL1rz+7Jau0hVrpqtPJwR0LOjVJOOKMHcMbwd/rGxak63H BRVuTQ9tdXJzSR+6NhiK4KAEy3orTDG5A6ugcB1Mu/JZ3TtJ8rFlU/MHE4DwjmulfLqA 4lbez5vLr44VvmK0HXNKetjG61FmR5dtu/ffCFjZaMQfVdd6yPZ6Vqs7cSoCFmCWN2ej U7UJuLArjVJJvFA58VBbTFzUGAlbxAZVBV5EE2zVq6EhbmHffJxz6yeGBWtLnffH9zfX I0SKmeE3zn9vqZPVYyRXu1tk/VZ/LisV9OyoAUd6iOjxLewnK1RWOS7bKO/6E67varMh DYqg== 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=Cy3b4YdYe1JheypyM1qEqlntx+LNPOiVtlvqoTpRTGk=; b=cIGFsuhHQ7gM/LVzYydHgGKcmTavy/VFKswKor5+BnRGS4tIoRPtvi51qWRtRThsLE 6wZk6HpUdxeu3miGNkJhWf4M/FN2CcEcshQT9M5Ab4Q49ydoftu93dpBkR0Tt1PPpfSf CjhZLxnQpE0jzNJlZhjSbbv2jV1tgfgmuoSAsBRQ3h9nwPBYt1uhzyOC/iCKcRKx3vv2 NVBxL9Y4TqKVKNqc0DYzzKEmlGFJKZLOHyAVhfxNupZxgIFBtKO/P3R/Dk8kS8FKBQ3I RC8oJKO1yyLUcnnddyG6N1GZ3vqz06RTVHFjsoumqwikOzuqKkSjuaseAUeihUvFX0jI 6yOA== X-Gm-Message-State: AO0yUKVRTh+XBokNjEe5ct9DCYTtPrQ6tMO8TLmRuxGWrguT9xeq+5ub s3fRI83uBb6rSHXzj8nA+JkHlmSafs0= X-Google-Smtp-Source: AK7set98gd/BBmD2MrHMvmTSXIUmiTX+HY9u8tg6jgvhUw+D34Dv05igzcuyCWu8/RYb3F6ryIOQeEDmrWY= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:f781:d5ed:1806:6ebb]) (user=surenb job=sendgmr) by 2002:a0d:c347:0:b0:52f:1923:4f9d with SMTP id f68-20020a0dc347000000b0052f19234f9dmr562132ywd.366.1676524727987; Wed, 15 Feb 2023 21:18:47 -0800 (PST) Date: Wed, 15 Feb 2023 21:17:37 -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-23-surenb@google.com> Subject: [PATCH v3 22/35] kernel/fork: assert no VMA readers during its destruction 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-Server: rspam07 X-Rspamd-Queue-Id: D141640006 X-Rspam-User: X-Stat-Signature: 4rof18fp7n1u7awrhem583b59kam6gz1 X-HE-Tag: 1676524728-291776 X-HE-Meta: U2FsdGVkX1/3V9tsI8RWasobGE4u7RcUjx1IYzZubyHf4a+orUS1d86pMOeffha6bosam9mwiiI8SBlYNzsuEJJODY7/IXG+khnp3L8Dc920Chi/GSKZXkADIL/q7gKwDJbZxW2rxrbZGj2SFVWi4Hx2+2w9gV0PhY2uiEFQdC5btMnnDo7tu9xghTVzh0yQspC90IcbC8H+T3MRTcv6gvl9IT+n0tVbqTo5AtFGTXJncc+A5F3mtv866RfPyA7bKcVd1IRY8S6O8nfALUkVskLYmcyH1fFB9few9FxwkkbO9GLBVfvwep74c1xmutkqpTQ2MaSbe9z9vE6Srmh3R8Tt/RQlDpMBDkeDdcPROcB39WgAHhkQCcMbQ5a2pSI7idNP74EihWFGxbGX/eHhvf0mBME0CLYhg2Hy1EQ/O/P12wC6SbyXj+iKMjsPz1p+8OHQ3spz/hEb3C0zS7Ky0+5CKMo05fonfyKlsH1/akYN3he2I/Bl85f2GFNAKonFFDmydej58ZNvGYF6KMHU6JG48JhbfotdvB3bbEgH/zcWkYAwlJcYBLSlnTJpt/QqSEWS0zPglAsPnq+uA/n9btZulgDf9HtaU9wGy0jLFjTTZFv8NdgBWxdAMxOzFLodjfMqqKyh6djyOtEXJsGoZRJizTIPvxxFhJRmv9tLY+733XKACr0IoFGvJ/bsd7niuypQrDWEYuTal+5zlJsNDW5YT+Rc9covFCznZr+Q0+1aNZ2WdgQ265b0kWbSOrM2tQGgoDqTVG6fUcIxohSRVAuWdG6IUS2brIXQFRE01d4sctZqN/3Rlh5M7WS8WQ3ze/RBWxBXQuBMErxJL6d2QVYEBRCintvDHj2zBjKED6cwhNjVS3bmrclf0iRSAlIZMW0pTIbmxCCpYn+pR/aRZNtqGL6PuPT6KcP33aERmLRtYmFQBeMHlJQcmOwudJYs66BnN8cTotwSNUhQJiy khQeDP3u gJC442cl7WvcVsoWcC1432fUe8bTvMuSAC3g/m24/xmPirfDScfzmIyT7CiadNh5NFVmzHKvmfyoO5yCF1dBF/nmuQ69yrclBuZFlRZr5V+OOMJJecReahUV3AEr99Zwc+TlZPO2nJVQoJcTRLaRAVzCig2O6xbsLLWHLtxiZHaxBoil4DdB/QCHIJX26BQseMzFxgO/DXaztbWsMQS8JJENUJYVUrjlnLb1W4hs+5A/DzTKlbMWXOtR2Z6C7dbppCKczp2Kug1+Erxqd5+dd1n3vaGqz7uONk0JmU6NA/EUToB7jvCH9nAgcCGkGhrOscCXQQ0Hoe8QnEFEbUhbNcrYSAUQ7h7bdlhBp+ikX5bkruAD53DeXw725a9K8G5wN+ilHoK92cjskyHp/Ma2KYoazZ4sQDgeNha77y9ol03xpV2IPd8wJwsjRxBSNXPbJtV2jW4Ox7fwhJ8omsiChDDWluWrhFVLSwmd55ReLLMwKsp3ftu3teNae5H4NMKUIbx4BpLu5v651EICeuZ1aAJXG+dhdRz+cpDiBRzFD0GFmUU0rZxkLl8UIkR+BlinDfeviNjG/Bc1nAsggabfYbw+MjbaKKqJDiKnvdfz4NY5jXY3evNr8uDIGKQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, 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/kernel/fork.c b/kernel/fork.c index 9141427a98b2..a08cc0e2bfde 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -491,6 +491,9 @@ static void vm_area_free_rcu_cb(struct rcu_head *head) { struct vm_area_struct *vma = container_of(head, struct vm_area_struct, vm_rcu); + + /* The vma should not be locked while being destroyed. */ + VM_BUG_ON_VMA(rwsem_is_locked(&vma->lock), vma); __vm_area_free(vma); } #endif
Assert there are no holders of VMA lock for reading when it is about to be destroyed. Signed-off-by: Suren Baghdasaryan <surenb@google.com> --- kernel/fork.c | 3 +++ 1 file changed, 3 insertions(+)