From patchwork Mon Dec 16 19:24:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13910241 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 F2FF0E77183 for ; Mon, 16 Dec 2024 19:24:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D03E6B00B9; Mon, 16 Dec 2024 14:24:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 77E316B00BA; Mon, 16 Dec 2024 14:24:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F5AA6B00BB; Mon, 16 Dec 2024 14:24:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3D1EB6B00B9 for ; Mon, 16 Dec 2024 14:24:41 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id F19FC4506C for ; Mon, 16 Dec 2024 19:24:40 +0000 (UTC) X-FDA: 82901798280.22.5404AFA Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf20.hostedemail.com (Postfix) with ESMTP id 309141C000E for ; Mon, 16 Dec 2024 19:24:07 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=zeq2Hkdp; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of 3dX5gZwYKCDYkmjWfTYggYdW.Ugedafmp-eecnSUc.gjY@flex--surenb.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3dX5gZwYKCDYkmjWfTYggYdW.Ugedafmp-eecnSUc.gjY@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734377051; a=rsa-sha256; cv=none; b=2tzgC1vG854qbhpNKRUjG9Ih6udCGNuWKlirjHikkDU78iKT+SqgYMxXa3T3uctXBy8Cr6 EXzsgwjaXCRzyq2BeM7IF18QZKHSOPmdKEUrfJQOE0bAxS9jloPfsivbSJWXuRcdLfKAG1 /T0Gpf4xdKNY4bc//Ru0u+Y2q1R2AL8= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=zeq2Hkdp; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of 3dX5gZwYKCDYkmjWfTYggYdW.Ugedafmp-eecnSUc.gjY@flex--surenb.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3dX5gZwYKCDYkmjWfTYggYdW.Ugedafmp-eecnSUc.gjY@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734377051; 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=V23hsekxf1oBAjhtCt33Ew0gdChPa6B6f0O6pWk1TGI=; b=SqYUMkKN10xYwcyz2fmSuxxX3mqIfoXYmMrFtdpxVMZjakry3oCk14M0sHwRqtuhHbhlKB 6w7oFEcw9FGpWk++QGhIpMCF35uNrAA67uI0Kj0Bhqsi/Bhl6Oj4Pk6LU+6uvGQpbFGBcw bJg8z0K/HBtE8963juBoHyD4cMJWdAM= Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-216717543b7so70323155ad.0 for ; Mon, 16 Dec 2024 11:24:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734377078; x=1734981878; 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=V23hsekxf1oBAjhtCt33Ew0gdChPa6B6f0O6pWk1TGI=; b=zeq2HkdpyB/h9D+mdH25kIwXvcIY7zNDDdkhfbFBH3YSJ0RMrQ57+JoAHZeALL9nqZ q2YU+es/ZYFQfZGxruah4bUCvDOjZt7YIAx5pmMuMGHNyo2R4D4XD6LHLLqdKk1Wlfo5 YS3VKtJvSREFBxfNw2ZntYtLUUW1FaHOhaCqwfGi5m4mSvUDDy4xtJ4tahyaVNvqwDUA kPt19jwnsT5xY0WfOD1j4c9/WIKRW/zIJRg+qfSdoL5unp5+2YwoU/ss9YmIZ0hmI5yA VbvBAt5uYrHwoGoHZQv14o+4ZtzwPpvoLYEO7mCsSuTvcmw8dxRE4xYXTOS8nDN/P3Rf mrVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734377078; x=1734981878; 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=V23hsekxf1oBAjhtCt33Ew0gdChPa6B6f0O6pWk1TGI=; b=pzmkVfKmEUvc9bvAWXBIS2supGbAAiWMEJLSXKiBg107YbYbi81m/O8AACOFw99fuk 7t2CrkM9taidCnV7/qsisNcmFuZ+d4k7Dk9iWLOhIHk5zufsJrvqw2z/OZsMx5VzW7Y/ JAm3gzPLk8KEGdfMk5sBjIgNTUjlL7gLY7+Bh/NHhzuJtJnOR2yEuUUYWjmax2IaviQu 2q14z7+JtU6xMQdRpfyNbC2LjtUWt/YfqQ1u+n26dS628m/blJFvhY7GZGBYUsaplilz U74kROtDkYOebN02aAXK1X0gFMULlPds4SnJYJwlbSGe1XI5OmTP4bvYREk9k1xtaFVA QJ/A== X-Forwarded-Encrypted: i=1; AJvYcCVNb3GGNpSlXzS+rLLi4pyNv70080Va0NPbi3kIc4wvvuhhFUBE+bNOY9A2GHEJ5ve0IL3PfJJ+dQ==@kvack.org X-Gm-Message-State: AOJu0YzWE1lW9woSMdW8WUwI4l4B0yx36sxSswrXHT7bKLlJEUWiuhXf c9SPaYui+l6s6XVRx9lKr4sJHlIfk+h84oeEseiE+tln4szTT4b+kEARYTLE76IYP9hA2tIUZwA KqQ== X-Google-Smtp-Source: AGHT+IGOYBhQK/OMn61IKHhYYRKFLZqMwRmmFqwVG/Z+7upwVvTEn0G50CkD9wYvokG+WIRwbcBuoK+avFE= X-Received: from pjboi5.prod.google.com ([2002:a17:90b:3a05:b0:2ee:53fe:d0fc]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:cec9:b0:215:4450:54fb with SMTP id d9443c01a7336-21892a5c02fmr173665245ad.55.1734377077933; Mon, 16 Dec 2024 11:24:37 -0800 (PST) Date: Mon, 16 Dec 2024 11:24:10 -0800 In-Reply-To: <20241216192419.2970941-1-surenb@google.com> Mime-Version: 1.0 References: <20241216192419.2970941-1-surenb@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241216192419.2970941-8-surenb@google.com> Subject: [PATCH v6 07/16] mm: move mmap_init_lock() out of the header file From: Suren Baghdasaryan 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,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nr/SLEkNSL6Bs9Y/9uJvHpMyL9WirUSpcVLDlUiR BVrUFrLt ZVm6dg/lT3ovkGempBjKj+vLbK4Lxk9TBfEJ28iAOGLBUbfKsw2GpUdYn/OfU9ny3wZoi8ouaDSLwTmIdVMJECHZ13Av5Bxnfgaj5o8UCIyrDdBwzOwKY5fTcLvFoxEdh98Y6QbLwqo8XLHpJLieBn49Ismn85l6lzSxGXFfAjuA42nscuctsSDwK4Oiys3ZUYoYa0bHyKjq343fNZYulDp+n7L+chMgQkMli59X7/ci5jDK/FDRTh5iGBOTP6UXdbrM4XT2yCmptHgpoYEgrJ0v1H06TFjNx6sWO5Dj/hVrm99zhnTn8pPie0J9ASLuzvC64ZKEV2rXAN1HcAjWtEg3KJb0saMnBlTNAJkxQALafeI/u9oreYP6xXsgWohPT/Da0zvB+V5oLfUiPPlsd9b1IbGj/pz0VV6TJXNLtxPX7F0im9G9yu8052mtd1WsFkerQqik3CVCjI6TjOmfX7/7yeqwgzgVRazX4Z/9CYMEBxeRE57sQi2DQZTcc1cae/0Ozyf90HxSgbFDKFOX6ndtvV+KU8K5qJMAEnDmNkuLHD50JGGTOGJXnLEJ3wgtI/8DgP/ADyAY/IT2+EDyJSOPt/g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.038414, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: mmap_init_lock() is used only from mm_init() in fork.c, therefore it does not have to reside in the header file. This move lets us avoid including additional headers in mmap_lock.h later, when mmap_init_lock() needs to initialize rcuwait object. Signed-off-by: Suren Baghdasaryan --- include/linux/mmap_lock.h | 6 ------ kernel/fork.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) 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 57dc5b935f79..8cb19c23e892 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1224,6 +1224,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) {