From patchwork Thu Jan 9 02:30:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13931813 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 23B23E77188 for ; Thu, 9 Jan 2025 02:30:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3C666B009A; Wed, 8 Jan 2025 21:30:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D4C3F6B009C; Wed, 8 Jan 2025 21:30:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B28E06B009D; Wed, 8 Jan 2025 21:30:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8CEEF6B009A for ; Wed, 8 Jan 2025 21:30:45 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2F68B121721 for ; Thu, 9 Jan 2025 02:30:45 +0000 (UTC) X-FDA: 82986335250.30.F8C9567 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf24.hostedemail.com (Postfix) with ESMTP id 3A8D1180012 for ; Thu, 9 Jan 2025 02:30:43 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=ksrSxrG2; spf=pass (imf24.hostedemail.com: domain of 30TR_ZwYKCHoqspclZemmejc.amkjglsv-kkitYai.mpe@flex--surenb.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=30TR_ZwYKCHoqspclZemmejc.amkjglsv-kkitYai.mpe@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=1736389843; 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=cA6SN2b+VepEpqi6xeamEUXAYwuTlZjCipcGUs+0HQY=; b=s+8yJHMRlzvGWM5iuv7JoDfbX61PGu5nd9xFiTtpbnypT6lExayRsA6F60YkdGjX/lrY/k cxe8iVfR4u0QFk6Rm3FNsMALksfnM0Bj4HMDuAM6AUAalfR57RUNRA9dbAkaaVba/mKpsg 7vnXKDixS4fDFUKnZydYsel27onG83A= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=ksrSxrG2; spf=pass (imf24.hostedemail.com: domain of 30TR_ZwYKCHoqspclZemmejc.amkjglsv-kkitYai.mpe@flex--surenb.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=30TR_ZwYKCHoqspclZemmejc.amkjglsv-kkitYai.mpe@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736389843; a=rsa-sha256; cv=none; b=wVGtxLbp4yFlIHORI1DTdIKaq6OrNes+oLTBqVtxCVuPbkvtuuVT5toH/6diLTKryGmnkO CQ5T3aSrG3nDS/RfHuzdpIf/vpHsSev+wWkYAbzwdH4WetwyXpwqThcXkkXnPpiCe4cJZ7 EuWkI+Se60AyObNfQ3wjNZh/uKY4ggU= Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2166e907b5eso6859225ad.3 for ; Wed, 08 Jan 2025 18:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736389842; x=1736994642; 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=cA6SN2b+VepEpqi6xeamEUXAYwuTlZjCipcGUs+0HQY=; b=ksrSxrG2fQNKgmTOM8Krp5kl8pWNmm0HMfQNwc2JA6VMtphUe2Rd2dX1pgh6EG4XvZ 9MTo3MDyfvXblWZkD5+haivPv6yVa9HjTz//7+pEtyFNf4TNCr5sDdWu4gZ0v2XLFQDo l2VuVzDaRf7gDSXlaYeR8bdf87Hcg13OGVC14eQpl/uW7ha8e385VaocWgN0YPv97/Ld HPsnJoOXta0A5vcQ7cO8PR4lYxE1RrUYGlZ+6ms7/Dy85c93zUCw/Dh28+B9jWFwzCFz pYIcUFFy8yZcC+JoeTgKd5GEnR7TGTLVGmKxs6SfMLSjbpeN+m49R3C5VYyIfcanQ2yy 1YAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736389842; x=1736994642; 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=cA6SN2b+VepEpqi6xeamEUXAYwuTlZjCipcGUs+0HQY=; b=Ky95jjwB0RtjPhfxiiMSHOw8xwQdiqCfyTxCz7hfjNV9epUuxy73DZJ9hGzsF1FiCS xONxWKrvq/orwSxtBxNpFVrpUUZZKQ9fzO2uXWsnUWXxbCSu8tkk7qZFSAn2nqsN2Wwp bm/h1PTvxHyrPTdSGngmaiDVVhcsH25MtRa0pQMgubnECcoPlo3pP1fpm4Ptj+P0gnOM 5ZqPEMa/WFY5ulQe8pqwH0/1m4pQI5gYiMrgP8KpqelyMspgTQ0LXT3I67UlQY3z3yCR scqyB9EQiq53kRGP9p931oUVSy6VmMZSXuE9XDiw91a0j4s0CD76yilcOJlXbd+A48yb 6stA== X-Forwarded-Encrypted: i=1; AJvYcCWLXWUZQ/1HQpl825TZbyJWUFTnQYDcFRyHEfACBnZqbkhW08padJzVlEJE+3EwziPSP9Imakn7Dw==@kvack.org X-Gm-Message-State: AOJu0YzjDgUKpuYJwKNw8wU4Zie00XjNAjm7Zo87Hwvcajx28hRpcWuO GswOY4pIAT+nrjO7RYDX9GCtlNk31Ma1cByqlPiubKZJT86ZlpjDCWQ1x88Jn1GJtxmz80gq8a5 VUA== X-Google-Smtp-Source: AGHT+IEzXiHq8FNMI7G+fgWP1KpPrFXIPUQsCePye9PY3Gn0PCmDCaiyOC9LF6jJI5g/L9SJ03+t7trrpGQ= X-Received: from pgcz11.prod.google.com ([2002:a63:7e0b:0:b0:7fd:56a7:26a8]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ec85:b0:215:6fcd:6cd1 with SMTP id d9443c01a7336-21a83f43ae6mr56359725ad.7.1736389841928; Wed, 08 Jan 2025 18:30:41 -0800 (PST) Date: Wed, 8 Jan 2025 18:30:15 -0800 In-Reply-To: <20250109023025.2242447-1-surenb@google.com> Mime-Version: 1.0 References: <20250109023025.2242447-1-surenb@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20250109023025.2242447-7-surenb@google.com> Subject: [PATCH v8 06/16] types: move struct rcuwait into types.h 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, 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, "Liam R. Howlett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9eijwNfMGWE+fD9c wRzJHwrH Kq9ukObEBuRW+eA3kduzsTI/pYysmg7bn61VhpEYBDQcBIL9FkbEmUO5sJiH/ZlAD3dpjAO489OkPXyts6o87zIjAdgPo/p1IsdiLos3N0YSmS2/HzmbMY/qfprsR2UIH+YI6pvasAXt2feMVK0NzTjW7OhsDZXnXPoceV+dzRDvHbulnYX+ewl8K/oruld6Iv+SaC5aL6Yz7h/gZYBI1EFNQO0Huj3Nn+heIyFgKS/NIJVKoh8sUeBpqTgHZRpBxlkTBus/S7AtFxwEx6J32wfqhUsDW49fwaycDjUr09bPSzYhwU8amwroKSxNo0JBOF3gavIb8e4Fcv6dKHZHH0hbOAXJq7odb7RIzH3Wkj6zFr2cbh98A5stws5weh7uRKu4qFEF7BLMnPMuQ3k5rELiRf2Xw9IeekAn28GyqfKo7rgoXFUFnDprgTXJ7YCduNJwqTqe0leWvyMNsyLO2WqW6dED6PnfoKXnDv5Dw8VibmcA7LoP9CabU9NIl4QPMDvhT+SLL4J4wl2wd5wDpRmYmA+qL7Sd7KkuqsGET56yqF2PsCbeopepQRYEw3HB/+IEA7f4GoG08UtPrQUoNxYuCawe/kF1o91+iIIu3fOjVgb6CERMgnPF20J9a5gRPMMMOM/6ybG5PQgU1ub9r5aqv8OY7/ItdETtEx61dPkzNKdYapvYAf3nWdDVGmPCPANmiuawjFczdkfXV/u6MAeU4U2zFX8OMIKlwA9XQOhVTalL3mdO4rtNIaY0lMCR9I4eY 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: List-Subscribe: List-Unsubscribe: Move rcuwait struct definition into types.h so that rcuwait can be used without including rcuwait.h which includes other headers. Without this change mm_types.h can't use rcuwait due to a the following circular dependency: mm_types.h -> rcuwait.h -> signal.h -> mm_types.h Suggested-by: Matthew Wilcox Signed-off-by: Suren Baghdasaryan Acked-by: Davidlohr Bueso Acked-by: Liam R. Howlett --- include/linux/rcuwait.h | 13 +------------ include/linux/types.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h index 27343424225c..9ad134a04b41 100644 --- a/include/linux/rcuwait.h +++ b/include/linux/rcuwait.h @@ -4,18 +4,7 @@ #include #include - -/* - * rcuwait provides a way of blocking and waking up a single - * task in an rcu-safe manner. - * - * The only time @task is non-nil is when a user is blocked (or - * checking if it needs to) on a condition, and reset as soon as we - * know that the condition has succeeded and are awoken. - */ -struct rcuwait { - struct task_struct __rcu *task; -}; +#include #define __RCUWAIT_INITIALIZER(name) \ { .task = NULL, } diff --git a/include/linux/types.h b/include/linux/types.h index 2d7b9ae8714c..f1356a9a5730 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -248,5 +248,17 @@ typedef void (*swap_func_t)(void *a, void *b, int size); typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv); typedef int (*cmp_func_t)(const void *a, const void *b); +/* + * rcuwait provides a way of blocking and waking up a single + * task in an rcu-safe manner. + * + * The only time @task is non-nil is when a user is blocked (or + * checking if it needs to) on a condition, and reset as soon as we + * know that the condition has succeeded and are awoken. + */ +struct rcuwait { + struct task_struct __rcu *task; +}; + #endif /* __ASSEMBLY__ */ #endif /* _LINUX_TYPES_H */