From nobody Mon Feb 9 13:01:34 2026 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 759161D7E4A for ; Thu, 26 Dec 2024 17:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735232853; cv=none; b=P0Qdqwb0G7CwJPVQVH32bTIAHvpQTdbxLXmX5XpxFl3XsaNUymnoqpS74Z29bBFWdyH6aOXT1gPvfdcBtrY5zZYNZiPhirQEQ8pRcoUd7xNceNHp7cYvpP1R2+CNkMr30Ow3F7nHTiFzu2kAKaXbBJYtNQN7ARxtwwA6t3l8EPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735232853; c=relaxed/simple; bh=eVQ3VVggh8kVNxQAQ6vf7aEf20tCEfNHXPz3nGbyC34=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ne7eEs1t7E35/L9+jRl+OeQCZKLJxa0ssuiECffDQpTdQsnSSVjbAywmYtaM4Wi8w8fC3rMuNF2DcRJWHUenYpbqjcpJxa3VvEMUF9xNJxZMsbyr36BRycBdyvqkf001Zi/4LYlYmTllP29YQFrQ0kUlJotwi3ERmn0IwWN0m+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=isj/PPJZ; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="isj/PPJZ" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2166d99341eso84110115ad.0 for ; Thu, 26 Dec 2024 09:07:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1735232852; x=1735837652; darn=vger.kernel.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=3UFX636acVjy8McvbWwNjOMeHy5jkJa1vw72jY/LAWg=; b=isj/PPJZ2b1nSCRYbvKE/9CiqUanOR8d4bs21E+B2n7F/aYEM31Q+xbtHaigPkaNps FRn9QUVz20Op5fcuLgKcXUgUY821+JwQxpJsTaB0RdeThUeZrDWGondHB5xyeOWGFxF2 d4LCSxEYAZkRiY23pm3l55Dqcx+YShycEZkjdv1NJSBL9knRWHrf9RI+pyqvkqU0yUW6 rKN5NwWhHQ63TXUae+zu7B5+MU5Nu10nt2DI6+YHwCOuA5CerE6Y8LLhCmeRn7rDYw4j ExApa8YxUpeYwx4gjkUP62+waHZEDx/dZK2VmUCT5/har3hM4dVRWLAwsZ/qXd27RFAy qNQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735232852; x=1735837652; 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=3UFX636acVjy8McvbWwNjOMeHy5jkJa1vw72jY/LAWg=; b=ajHouzXrDnI7rDm1oMPzBzX8zrYibmM+PpaaqUndAE1UkndmTvLb8Q24VAb8xJUXcj /IBJSbXVbmuEDuAjRh2NM+QJeUUZq/za9SueJAMMHJLj1C+DjbDDCuQXFrctDFNbmDb+ GkxVXYrLrOBXDjHqVktMZDO9WBHxj+gTEerEuj2J92gMMRRL89Fjt+TB2uvNnGA66Gpt xXCu81Hk1XMTzdWDkeyopHNHFvpSWN6JGVHkgRgrA7I+p8Q0frOTgxSzFxWEx6mcF18P sw0cnADzX3P0XlbMpcFaxN451+iIpHxHSCIGPVHkJJyzJN2WYMHzlFVOMd53GaTBAlXK 44Og== X-Forwarded-Encrypted: i=1; AJvYcCUnqSwUvkWhaJoFY04Wx6mPYi1SAJxMPaBl1+8dBgNS5Co+/iG+cbYn1tttUiPG1PJ6bdU6eFB+Bw5Ua1c=@vger.kernel.org X-Gm-Message-State: AOJu0YxOfl66EbFbW0WQhY8gzDPRfuJpSh6Zr6NkO8UiJG8la7dkKvfq VX+2azn8VdXP4NxiALu99QWAD+KNK9/ZtAoHJvRocyIAIQlLDb2p39b538dHgim6BsvMSv35E1+ olA== X-Google-Smtp-Source: AGHT+IE+Il4aaMscBOZzUniftz3cly+CPDHxMUs/tHLaE2nxYIYJF6s9V97DoMW87H97O8rFF+TQEZN/e8w= X-Received: from plsp1.prod.google.com ([2002:a17:902:bd01:b0:212:5134:8485]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2cc:b0:216:5867:976a with SMTP id d9443c01a7336-219e6f1176fmr305791325ad.45.1735232851873; Thu, 26 Dec 2024 09:07:31 -0800 (PST) Date: Thu, 26 Dec 2024 09:07:01 -0800 In-Reply-To: <20241226170710.1159679-1-surenb@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-10-surenb@google.com> Subject: [PATCH v7 09/17] 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, surenb@google.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Vlastimil Babka --- 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 =20 #endif /* CONFIG_PER_VMA_LOCK */ =20 -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 } =20 +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) { --=20 2.47.1.613.gc27f4b7a9f-goog