From patchwork Wed Mar 1 19:04:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13156346 Return-Path: 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 67D27C6FA9D for ; Wed, 1 Mar 2023 19:05:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EE066B0071; Wed, 1 Mar 2023 14:05:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8761A6B0072; Wed, 1 Mar 2023 14:05:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 716E86B0073; Wed, 1 Mar 2023 14:05:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5E86A6B0071 for ; Wed, 1 Mar 2023 14:05:04 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BB5721406BB for ; Wed, 1 Mar 2023 19:05:03 +0000 (UTC) X-FDA: 80521256886.01.AE08129 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf19.hostedemail.com (Postfix) with ESMTP id 0FAE11A000C for ; Wed, 1 Mar 2023 19:05:01 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Fyrl4aN8; spf=pass (imf19.hostedemail.com: domain of 33KH_YwYKCEUz1yluinvvnsl.jvtspu14-ttr2hjr.vyn@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=33KH_YwYKCEUz1yluinvvnsl.jvtspu14-ttr2hjr.vyn@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=1677697502; 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: references:dkim-signature; bh=eZZzZE8GpdNY+MwogNnFVaUs2b/RvHe7OTvEU8aJPfc=; b=kzzg+BYvbnzTDGCf/Ur78E5Np9zQGC9446Xzd2lGz4WFwlH3ldY3cQI0o6zFnu3iOMTnFb G1VzxmZeMYE6Gf02PZciw8s5Pq0clo+9jlzZ+1wCSAWSH/TZZiruo6867MTuGoo1ax8f7R 0FyAIbrfC1dDGSlzIJysE3Mefgp24h0= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Fyrl4aN8; spf=pass (imf19.hostedemail.com: domain of 33KH_YwYKCEUz1yluinvvnsl.jvtspu14-ttr2hjr.vyn@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=33KH_YwYKCEUz1yluinvvnsl.jvtspu14-ttr2hjr.vyn@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677697502; a=rsa-sha256; cv=none; b=2VV26yRyDmKZudKBsFfgifTjv+duuMzou1YjqJMz+IXl29pW9k2+pMk5dP9ztulz4y+ibm b15+9hjWRGPq6k/PfRg3k/FXBiDxlHAAqNrndzjudBRIAnklPApw4URGuqCXRfBRgXF7D0 kaJx/0C4NgiJ0r9mv/VPCJgDDj+XPVA= Received: by mail-yb1-f202.google.com with SMTP id r13-20020a25760d000000b0096c886848c9so1314150ybc.3 for ; Wed, 01 Mar 2023 11:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1677697501; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=eZZzZE8GpdNY+MwogNnFVaUs2b/RvHe7OTvEU8aJPfc=; b=Fyrl4aN8thLa08lvSwfnz3pS77dLDE/JPDoL0n+GfSBVkEYmU/na7n6N3awmHGcBsx fg4YM6nkuIRNWndpa/Vvh28BBbpGpJRQu2vsHAWiO6a5ZOUjmcMA7LOEEPP8t186icRE TTzl2f0lYKQ2gEv3faqd7R7sHmLmFHvz7aRO6WVgfOeUssnPkNyUgEAinVLSyUArDjIp kbm/6C3MBv1I4BXWlD3jhzvuaIkNNoC3TdQPTPCNNYNwWctyfsetJwP6v0E+I8n/tQPA F1L2rtHP4dGjfzEUvNlYgeld/2PRYT7D9g8oV1r1Tb8v8B8+31LZevINjOdzhGWMe5yh P0iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677697501; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eZZzZE8GpdNY+MwogNnFVaUs2b/RvHe7OTvEU8aJPfc=; b=aiJ8L9Zayjj51fh8U+Lr8ayF9CxFDSUeMypsmOUhMVpFz14oxssC14MSYokVCr2t9L FDhaXefu3++c/A8aljWsaZt1EI18PdlzBju/n5hePjGms33Pp93UaGk4f61IMMjFJNqt awzacfgt1ZcYoWK1ZLH2k84toph60xiXPzXg5kokaPEqYAWpXy5JtKXshCt8GqrDIgxJ dk4mhrAVJCwwPxdGkUFbpX00NuKxI5TDOxcHeMzAW9xzyoWLgnfskYYXKqkBcINBb9LX mGEjaikxjVLvgqeeYE1W9B1p4w3WAo+vQJbM/kdY5TIOyELyVZT0xKvMIhfB065KgtkY xH3g== X-Gm-Message-State: AO0yUKVOhuF5IeFCze0GhQFaUXNyimPXsX+sgBS/yOpTg/N+NsOAmNSN AhgiJSaCHnXIgf5IQAHRBrj3zY/XMA8= X-Google-Smtp-Source: AK7set/9C/tFDvwQ8AH2AjoEK29ndZJWeqFhKnrMFIlBfk3w7trnnd608E+7P+Ccqu1RqtfeQNT22abiIwk= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:3c40:eeb3:7c3a:807e]) (user=surenb job=sendgmr) by 2002:a0d:c506:0:b0:533:b8f6:828e with SMTP id h6-20020a0dc506000000b00533b8f6828emr19ywd.411.1677697500632; Wed, 01 Mar 2023 11:05:00 -0800 (PST) Date: Wed, 1 Mar 2023 11:04:57 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.rc0.216.gc4246ad0f0-goog Message-ID: <20230301190457.1498985-1-surenb@google.com> Subject: [PATCH 1/1] mm/nommu: remove unnecessary VMA locking From: Suren Baghdasaryan 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 , Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0FAE11A000C X-Stat-Signature: pcxbo9sgo8tgz1prcgb1snweuqo1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kFjP7y6+LYw42SsLdfwkkQrJqen+5dAwWPB8mkvQckZ3oVuGJGFZSfgq13mebEZYPtXVltY/dLt5ztqws6d8gUgiyDgtf0WC3kFiWsAZRKNeYv4KTqazWH+o1JXYnqVZSJA78uLSjbZ5jXNfesQY8XiNC1CDPZVUSbSPcnFOVwb4Fb0t+SeFycZvnZnvynldlJhQHd6tPzNU5UGOuWaXmqhM6YVW746u+wCxXA02P6A46y+/M+ypW6az2/UtWCBXIK4DyRadpJKTFcXw2mPRpbWHDgUOjBdEwHPCxE4mIATPAVwwUe85I2z/+TT+bPCo7rrmoiok0lLemCNOXuDWbRK/4xf5lNzidxKGww0unNtX1xYVB6dxcFibwj7ORjFgpaD6M7S8KjI/yPaodzd1QApsFkSKPMIHW6NcOX4t6RgqcegtlTnas2OFcBduUehT0gbW+ht6p8slgc5iO7RUZSB2rc44/oEE1yidHJOAgv4iL0Ina1iWuB+OhDHjqlyM5q1rT4lv0j/PX8Du+8EggHN0SsQz6QQ36zEoqolfkEjgOuYpSNwUZKwnTCy40/jjWUymn8C7eF/nT9C/3OEr6+hhVIkRhMO232YdyKfmZka8NlD8LThCeTNy5ZqRBEnUTd+UQ== 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: Since CONFIG_PER_VMA_LOCK depends on CONFIG_MMU, the changes in nommu are not needed. Remove them. Fixes: bad94decd6a4 ("mm: write-lock VMAs before removing them from VMA tree") Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Link: https://lore.kernel.org/all/Y%2F8CJQGNuMUTdLwP@localhost/ Signed-off-by: Suren Baghdasaryan Reviewed-by: David Hildenbrand --- Fix cleanly applies over mm-unstable, SHA in "Fixes" is from that tree. mm/nommu.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index 2ab162d773e2..57ba243c6a37 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -588,7 +588,6 @@ static int delete_vma_from_mm(struct vm_area_struct *vma) current->pid); return -ENOMEM; } - vma_start_write(vma); cleanup_vma_from_mm(vma); /* remove from the MM's tree and list */ @@ -1520,10 +1519,6 @@ void exit_mmap(struct mm_struct *mm) */ mmap_write_lock(mm); for_each_vma(vmi, vma) { - /* - * No need to lock VMA because this is the only mm user and no - * page fault handled can race with it. - */ cleanup_vma_from_mm(vma); delete_vma(mm, vma); cond_resched();