Message ID | 20241226170710.1159679-6-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 E2B72E7718E for <linux-mm@archiver.kernel.org>; Thu, 26 Dec 2024 17:07:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BDE626B0092; Thu, 26 Dec 2024 12:07:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B67266B0095; Thu, 26 Dec 2024 12:07:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A06426B0096; Thu, 26 Dec 2024 12:07:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 79C476B0092 for <linux-mm@kvack.org>; Thu, 26 Dec 2024 12:07:27 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 119FDADBFC for <linux-mm@kvack.org>; Thu, 26 Dec 2024 17:07:27 +0000 (UTC) X-FDA: 82937739612.27.CCF2BCB Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf03.hostedemail.com (Postfix) with ESMTP id 3C66C20008 for <linux-mm@kvack.org>; Thu, 26 Dec 2024 17:07:06 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=S1J0PoKc; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of 3S41tZwYKCF4OQNAJ7CKKCHA.8KIHEJQT-IIGR68G.KNC@flex--surenb.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3S41tZwYKCF4OQNAJ7CKKCHA.8KIHEJQT-IIGR68G.KNC@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735232806; a=rsa-sha256; cv=none; b=kzTVQgFI3farfrSZ6dl9+3xuhaKf2SiGN72LalmWpaPR9a5IU3GUcjDqNqVnYGidyj2TEe 7vJMtV804SjI30wFSN+7sgefdu8LzvOsGiF1bk3sHktWUnwS5lWITvDTDqmKHfcLVH6po+ rr/nl4QKrzTqYhFJtIf7WIQSad66NB0= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=S1J0PoKc; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of 3S41tZwYKCF4OQNAJ7CKKCHA.8KIHEJQT-IIGR68G.KNC@flex--surenb.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3S41tZwYKCF4OQNAJ7CKKCHA.8KIHEJQT-IIGR68G.KNC@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735232806; 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=zZzt97suQHoGz3iLHkiBfewFYx04NIJnrpXSSuwtyuU=; b=bUR7htNZWUJNvcJTdu+0Ok6N3Y2kHk9tWw/ZhcNzF9lFYwIt5PNphVka+bFjfRPyZJKEVM BLtoyvAJXdyBGIpQggp51oXmBnzL9BmaCVNTnDx8CTT2qyBxDuXgSfjLCaH7Pndiq5+96I +5V13/XwFas/ApetoJROgOFaXWYJA/w= Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2167141e00eso81174075ad.2 for <linux-mm@kvack.org>; Thu, 26 Dec 2024 09:07:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1735232844; x=1735837644; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=zZzt97suQHoGz3iLHkiBfewFYx04NIJnrpXSSuwtyuU=; b=S1J0PoKc9peP5Xkw2CbUbMeWLjt0zZTge774cNnnSmrc2e42+Br3tFhz8bvudY6T06 jT/6qiPmvULdw6lEMc4rUC5bSktKv21erqjYbwDZ8Q1PIjWoOidHMwTOCmeLqAjgtFgq y7XCfuz7iSNGjZ8ACe5PaRsaH+VtcMgXoRevrvJpNDVnwqNqhWFSaOkwE+nQ+2UjHy2Y eErQcyk3c+GWYn6XVXshFxFQyTu1lMn3zj16Rd/PpJWY+4c0fkzGkh3TC0H9O2GpoNNy +fIDjqI7Ju7vduekKDryX7DSgwVsfE1t0T8f27bRiEPHHDMJay5mjGa1uRSJHrZkKkAD OVSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735232844; x=1735837644; 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=zZzt97suQHoGz3iLHkiBfewFYx04NIJnrpXSSuwtyuU=; b=TbW4/SYqLv3BWVrlvYO+4++giOJGOnQaCQB3R5pT9WyaxSZP4FZP/Wf2xoawkz7H+w Y4eWjrwQT+xh0BlCUdaREvq04l/LG7UYhr3K3tja8LlhZ3sbJjdZ3nqn4GeHDT1fJ4f3 4Ql4N62pjao+JYwHlfQXkLOO1y7gd7kPqXbgLfRAc+LzWdj2VPEQEU8kNYIhARQCtUv+ iXyURurQjLGsYE9S3x6R/+XFAE0gKNKmq68MCuSfvCYc+XaIdpGfWcqLzFwkmd55rE03 EQkFrVlKCE1CajFTPCFdsBMk8JnfXUUOYJG1CjhH7I8E9J9JTAD6Q1YBUZt+z+nLF+R+ Crug== X-Forwarded-Encrypted: i=1; AJvYcCVbPcutGm3SYAWcSGMBk0E/V2qdKlR23VJrvxHT5GWz8DI7rRueguAVzWB1o1/AduS1DAQi3fWeQA==@kvack.org X-Gm-Message-State: AOJu0YxEzFpy7c7/76ny2ozSBkxWFpoiXaOuM+x1Q1CyK1dysecVlbEJ CwIgncC+JZWsFSsemaN5aC4o1IIXRJj+7HfQJQ0kcpq710yAMHBrfn1NS5UdBfZFTwRelDGGD9g /KQ== X-Google-Smtp-Source: AGHT+IEAlsKyIxUvD+OjguaAw8zgyVzbZEnVmDfknkzudP9YDfj4nmndYPZJH96mZmFPgzBT4t688/RysUg= X-Received: from plbkn3.prod.google.com ([2002:a17:903:783:b0:216:5441:d855]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f54e:b0:215:e98c:c5b5 with SMTP id d9443c01a7336-219e6e8c5c5mr356653565ad.1.1735232843904; Thu, 26 Dec 2024 09:07:23 -0800 (PST) Date: Thu, 26 Dec 2024 09:06:57 -0800 In-Reply-To: <20241226170710.1159679-1-surenb@google.com> Mime-Version: 1.0 References: <20241226170710.1159679-1-surenb@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241226170710.1159679-6-surenb@google.com> Subject: [PATCH v7 05/17] mm: mark vmas detached upon exit From: Suren Baghdasaryan <surenb@google.com> To: akpm@linux-foundation.org Cc: peterz@infradead.org, willy@infradead.org, liam.howlett@oracle.com, lorenzo.stoakes@oracle.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mjguzik@gmail.com, oliver.sang@intel.com, mgorman@techsingularity.net, david@redhat.com, peterx@redhat.com, oleg@redhat.com, dave@stgolabs.net, paulmck@kernel.org, brauner@kernel.org, dhowells@redhat.com, hdanton@sina.com, hughd@google.com, lokeshgidra@google.com, minchan@google.com, jannh@google.com, shakeel.butt@linux.dev, souravpanda@google.com, pasha.tatashin@soleen.com, klarasmodin@gmail.com, corbet@lwn.net, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com, surenb@google.com Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: 74r1df9tgrexbjnnbbwegowr1sjsbnfc X-Rspam-User: X-Rspamd-Queue-Id: 3C66C20008 X-Rspamd-Server: rspam08 X-HE-Tag: 1735232826-226914 X-HE-Meta: U2FsdGVkX1/p4jH/tX1OJ9v4Kho4R27+2DxMBOD97VGjOH0FDLuyaE1cERnlLWj1qh+pqpEqQaN0xoAmPQzivJwpxnzl4lKAUVgi4RuvKN/opL99ZRDyHliGVPRKWxVMXqIOR/BCTYRORO7OZIE+AcdtnXAnX7+JBlQ10nFv/EXkwYJNgI2nAbPpnmVwF6hdQHHBwDo1gB+2luc23u3FfZT8PuLZXd+h/q0i+SbNMFRuP6OWTHKJhj9+sPCLpSipBaIK7yz447sXublsi2S6x5/PRxPyRoX5Ww2UPbKjk1t4+Z2eKOVwCK1NPU335dn0kx5I6/HpebnzHLudcJWY5z2Tzc+e6WdOTKCva4TFYUMZ/h1MEhswC4tAHMqQm2ipfWNVS9oh7SNyjAcwD3Ph633XV4q2tvqpDFzmKXGG3eBqO8pUy3FIjKDuqgXYTfydUWYT/1QrEGq7TLlPnRcZua/T/9bS84/4cYvvaV0y/Sjf8T3GTSwKAyFM/Ny9qhUCeyQ6H2O3sKW76GQYYK5WLOf+OQgsQlKnMi4wwpl0Eg5xmweyeraVuJClys4NG8JyQY28O0P9Wsl3gIXG++bTA2ZotzC6DiSOlh4U1R7hoXXIYXIJPidRNYkl9XZKFpNHDRj6Mk1QQyoTMUawZSuCABDDic2hqG9BxU/pU0xXHbLfsnaVAhv3Zxh29+aSK11WfUMEs5DhrGthJp3/M1HmSMCjKfEJitGxzqwn/nOZFEWb05ItWD5fTHQwyv7y68YikAgZoEzWS6rD76SZHULwHoCnZKqNwRpGbuUMcJSxsbqoU2qFiP0jb2Hpd7bNIj+BuGGI+EM41kB4y7C85B0r7+b+v3r8IQ5Z/5N3gZ9pblOQcOOnf6VQnlhlPMRaYWybhq0xsgfOhL/d6kaxxDYVI/Fwug9GiQ3Bl3jY/Q1gmLlRSaM0RQP2nGHPZPm6uGDaxyPLjBsH1Rb93LurRFi 37QrCx/v fTXRiJvSn5VSV9N6rrFvb5dbTgxoyduJQSNN4XUOIae5SM6JvC02qfdJfNXf8mHpt5rwyiWaULXyqOp3tfZeDEQlyxJUSHpQ+pvMWzGtCKXUcVVkvIG/Hx4kmbMFGL9dQJqCgMWgPZ78yovhQnBRQMSOBanQY+mIm2KEY4/8Q3lXz5AO2cxo4/hvRoSfGSank8Jw4Z76c9YHiaTYCq5b42zWv6WmZPtsAjcip353jqaEtAoe0vEMYz+o1RJwEjo7WgLi4xkIX3KdlPHQ3hM1a45b9QjeOhQHOaj57RsokieBNoTj5BqiTalBuSJqLjNQ0V5HF2hlsReC/LxQn4fMoRI4nGGarHP1GC35njthjv5IZbH5uT5mNC/ReDaqT8cHAMqeAAExjNxAoaZQoIp207qhvO42zEa6Tp/S4Q7f2rVRuO/jqSIKO74EdggYN6s4qTmRJi8vs4gK/1ZSdWyRP/E1mfLTFp9RHd8J3XEnGQXXQ9RT4zClDahQ9kTc7j9eJWsmKm/oAOky7p94Y1fE5Ewyk1l4eQ5/RiwQb9gQvDoFapZ8= 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> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
move per-vma lock into vm_area_struct
|
expand
|
diff --git a/mm/vma.c b/mm/vma.c index ce113dd8c471..4a3deb6f9662 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -413,9 +413,10 @@ void remove_vma(struct vm_area_struct *vma, bool unreachable) if (vma->vm_file) fput(vma->vm_file); mpol_put(vma_policy(vma)); - if (unreachable) + if (unreachable) { + vma_mark_detached(vma); __vm_area_free(vma); - else + } else vm_area_free(vma); }
When exit_mmap() removes vmas belonging to an exiting task, it does not mark them as detached since they can't be reached by other tasks and they will be freed shortly. Once we introduce vma reuse, all vmas will have to be in detached state before they are freed to ensure vma when reused is in a consistent state. Add missing vma_mark_detached() before freeing the vma. Signed-off-by: Suren Baghdasaryan <surenb@google.com> --- mm/vma.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)