Message ID | 20250111042604.3230628-9-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 132ADE7719C for <linux-mm@archiver.kernel.org>; Sat, 11 Jan 2025 04:26:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4A796B009C; Fri, 10 Jan 2025 23:26:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D3346B009D; Fri, 10 Jan 2025 23:26:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 825D26B009E; Fri, 10 Jan 2025 23:26:28 -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 5C9206B009C for <linux-mm@kvack.org>; Fri, 10 Jan 2025 23:26:28 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 220EDC08EB for <linux-mm@kvack.org>; Sat, 11 Jan 2025 04:26:28 +0000 (UTC) X-FDA: 82993884456.01.2611992 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf05.hostedemail.com (Postfix) with ESMTP id 50177100010 for <linux-mm@kvack.org>; Sat, 11 Jan 2025 04:26:26 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=aQ68T5Fe; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of 38fKBZwYKCCIQSPCL9EMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--surenb.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=38fKBZwYKCCIQSPCL9EMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736569586; a=rsa-sha256; cv=none; b=h1eLSUPeWstt4HOVLRBjaRAAHaBBmyB0hDaQYL/XDxiS+dPtznYc0T7DKGigi7hqy5bQNt nq0LeFhxYSny4+M+2MO4iZDyuEMpLfbQiHTp6cIlaogs7z97smcAJrzElUAXLiUh7OvF43 0gtdk8q0xFm3Tjw2kyFsGqdlvX+4Gl8= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=aQ68T5Fe; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of 38fKBZwYKCCIQSPCL9EMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--surenb.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=38fKBZwYKCCIQSPCL9EMMEJC.AMKJGLSV-KKIT8AI.MPE@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736569586; 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=mjOxH5E6F+PRJReyBLOWVSfVgJNT1AsQeggvw/y9xao=; b=07B+wW/vOeIOK8S4wjslrxETGSAC4vxpcRJe85Y3Uo2A4tIGmm/6KyVXeyvMk8F+GVbNfi 60UMWtQhlV7M0yB/IsUrJh2L6m6Qe5teDFZXl9Gs3Cai9zDExOYma+PauLf9tXcbBk4vrV xY1Cd+4+Dfo81PTsEIiQzVPHw7VyJLc= Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-216717543b7so68521335ad.0 for <linux-mm@kvack.org>; Fri, 10 Jan 2025 20:26:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736569585; x=1737174385; 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=mjOxH5E6F+PRJReyBLOWVSfVgJNT1AsQeggvw/y9xao=; b=aQ68T5Fe1+DDOf3YEMmWSISPJwD/G9GhJuwZNsPTHuSraSbJuhOPLt1+L1humGwNlL RfntR1Z62KIH7+2jQmVCpDCgkFsYY6S4oAyjwXs4AodbLjsToaUpcKViXzClb20iM3VX 2wvQWRqnnbfApClyEiY3M1yDjVOkZC80bD9JEA0RO0uhLA9eHXj3H9Hm5MnZHEI1+lHN iO1+zBzXYJl3wmNKMMrX6+eOJhGFmLx2Ih7F6UIGXdoR1anO6mRg2stZGEtDVGW6q6Lu SLTemDmFdfZv1/9IG07Julj+4y4zWisEA1j1v6jykoh3I5XlK0U+Hc/NNdOAEKLOo4vj lkIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736569585; x=1737174385; 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=mjOxH5E6F+PRJReyBLOWVSfVgJNT1AsQeggvw/y9xao=; b=tbaA6vAIPJQ+kuOj+s0V3UJLgtt49uWrYd1BWSfslxNxChcwsz5gA/sJ/EAr3Frucg x/ot2jRa55O1+YqLIXKCNEzxAZY38uZlJAPweavkkIRsQ8W5DFIU/PXIG7kErD1bA/LF YBrFLVzdDs1ywlSNjSw/wutpocKsyQD9ov8Tw53QrbJBZaUify9I8LVdxZKhPYEplg0h WoKbcXoE39QLMIXBn2gnpKXo1Q6BjsmaK889bT+4YWMHMEGeQGyNf21/xF5VI3SQpux4 pIu/MJBA3sfhMkklwTEOMrKgM2nj5XzJZVILOmajyNWShWcnAna/lmW2l3KlrWHgvB6q BWgg== X-Forwarded-Encrypted: i=1; AJvYcCVTGoGGpz09i6BYqiIuuGLjgrpnRUHM5wMMoCg+o8El6yTodnt8gM3HmdvcUSzU4AZlmkD9ig/NtQ==@kvack.org X-Gm-Message-State: AOJu0Yy3GWKMygTGUBnQCPsRwRdDAWiJWy3jjOsDU0EmUiRfUDWdf9rL XSgBd1qpKP1x4XuPfyyOG0H0EnIQllJ8JBCDxorhTfRqgvBlTAxTfP9GmkbYTOpWwHMYcs3DlZJ huQ== X-Google-Smtp-Source: AGHT+IE0/9yJJ25TvfX89iO9TEsxGGT3C6giF06ZQXBi5U4FgLqynwZmNkiGXRge1CwIKkM+8jgi9u5PJaA= X-Received: from pfus6.prod.google.com ([2002:a05:6a00:8c6:b0:728:e1a0:2e73]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:7e02:b0:1e8:a374:cee6 with SMTP id adf61e73a8af0-1e8a374d574mr11673994637.6.1736569585095; Fri, 10 Jan 2025 20:26:25 -0800 (PST) Date: Fri, 10 Jan 2025 20:25:55 -0800 In-Reply-To: <20250111042604.3230628-1-surenb@google.com> Mime-Version: 1.0 References: <20250111042604.3230628-1-surenb@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20250111042604.3230628-9-surenb@google.com> Subject: [PATCH v9 08/17] mm: move mmap_init_lock() out of the header file 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, david.laight.linux@gmail.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, richard.weiyang@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: j3dguu9mjiqr6t6o3946qzpdmj4etgru X-Rspam-User: X-Rspamd-Queue-Id: 50177100010 X-Rspamd-Server: rspam08 X-HE-Tag: 1736569586-858784 X-HE-Meta: U2FsdGVkX195eFR7cl0O9l+wMjeuT1P9LDjudrhUi5MHixsn9BShVAzQL2X8I7GmS5UTWRUemvICzT/b2HsmXY98bWPN+RMJ7SbVZlLD9IYncX/xjiMmHCBWtHpdhhp0CkkFNIvy0t2mnyVd2diHwJYf+xgmdPrAkcGCmEoGWxf8wF+46t+17qnVTXYN5RJwlW6Juv0UjE3NJRWG4gMlQqp6sHRec0RynVxVm11h/qMn4QjvCJc1NlCO/e2t0Dcgi1Obe361Om4RiYpbddAIype3qO8jz4BMANT6XPPvPQNhZD7kIv8sKwDBZp4pfakuFne5fixz4iFKqgW0EePjL5/vMyap9DV1z7FSagEGVcEmyZRxy6vY5U8VGc+M13F7cDvRlUtY05CpCdFvi05KIEQNZBu8wnMcxUJjlIGvBuV8ImiGZlrMf4Lpd1qRHTXlww2EUgWXVW3n71DXDKLcWb5Bo5pdrefqLmtHieymqSI9k/0fkg6m5/fUjhuIcArMSqXG6xKFni8MNrHwG6/4Xf7GZlYt9Vyyiiycp5XAodAOa/8VEcsXhedxlpdL5W7NNyyTrd9SNahkExW3k4zr3LMVhMZv9ZVVI2C6+GdlWFv0x/pQEDNth9a6jZax87S/vxsFyVEbRZ5xh4BSOEcRKkjVGSCxckRIzyk/VinqrdXXvC9BgB7XZ1pTF76ha139AmiLkeScZFFrNrQ7LLZ1Waug+o3+0bqpRX1fgMU/ZrTzxYlJ+BBpqEP/CYiqBE0MaI0Us6s+y03pqeWooL6kt596ZsZUzfSXzfflpbIx9xTHQpD7CJ5SRSoY8nOjNrnGUA7iwaQNq/zeR4GXQ+fjqQCh9hHDuiycMesHS32wCHBrE0/Vm3GVHsXuDHUGSjzARnQD6lDk6q0Xwme/hjbprneMVDuhpypZ4LBe9V8/DRcLnoRv2D83vPcQlCi1O3LVmrSLB3VxFloNW0iZ0wa 3bW51BPW Uz6MzTD3Q8FykKtzAYxJuzan9EGMXxTi7LwGz9oMeGEcCwkfxhDQPmt1v3EVDE91yziSsfFa86dyUbTyC1+eLOPfPGMEs7SKtlpCCQHMvpwYaCLWps0Zw9+Oy8fc7Iw+0vxhYGszFvBB49a9lzIDTGPCdlimJSgAYJ70g+OwA0UVM0xLdLQhFLAPBQmNPZLjfEnBqh1FpUehKkxOX9QsBQuTRZzqUbwypx5HLng+WyPDyCSNMJxASTENdYP6PDG3Y0VnYhrMZ6v+ilMmnmS7qc46uVwu/lDNe5wxnRY8MQdXNJ5OfkiTOz5rkorS/2NgpDHWCtJFGv24U39Ugg6c4zkd6A9UhKpvL6GJ4uIjovta8RrDWbDB3jAlIxxUp8DjXkCJ/FC5YRxLvYzd6Z6fVQ7VMuGlVgOUYtIRYEG8dZjfPdorqYAXv45uLbR+VkLeQLibNBGtD5v1rbYP2/934a0T3pO1C6pKWbSZ0hLvy/0+9cRA2ZiAR8BO0ufUZoEVizdfUPcuM5v10PwvVd58mOFgU48OrUjkva9MVpiPwxumgqdUnFnvGjpXub8d4NA9IzuUoNRkHKK4/RzkSjTli8yOaf45oEPEtbmn0OPSymVt9zCvekjAxz5eMF+bJTCPj206r1UZy8fuuXuLQ2juPaP7E/cVC93BTW56jQL8xLGIzhI12DH+hfZ+apF6CWRwOYS/mWduwIn2itqLD8Qn+Hbpzf0KSiecnOjIMx1MapWHj35c= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, 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 |
reimplement per-vma lock as a refcount
|
expand
|
diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h index 45a21faa3ff6..4706c6769902 100644 --- a/include/linux/mmap_lock.h +++ b/include/linux/mmap_lock.h @@ -122,12 +122,6 @@ static inline bool mmap_lock_speculate_retry(struct mm_struct *mm, unsigned int #endif /* CONFIG_PER_VMA_LOCK */ -static inline void mmap_init_lock(struct mm_struct *mm) -{ - init_rwsem(&mm->mmap_lock); - mm_lock_seqcount_init(mm); -} - static inline void mmap_write_lock(struct mm_struct *mm) { __mmap_lock_trace_start_locking(mm, true); diff --git a/kernel/fork.c b/kernel/fork.c index f2f9e7b427ad..d4c75428ccaf 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1219,6 +1219,12 @@ static void mm_init_uprobes_state(struct mm_struct *mm) #endif } +static inline void mmap_init_lock(struct mm_struct *mm) +{ + init_rwsem(&mm->mmap_lock); + mm_lock_seqcount_init(mm); +} + static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, struct user_namespace *user_ns) {