From patchwork Sat Jan 11 04:25:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13935772 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 B9B67E7719C for ; Sat, 11 Jan 2025 04:26:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DA116B0098; Fri, 10 Jan 2025 23:26:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 73D726B0099; Fri, 10 Jan 2025 23:26:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A3706B009A; Fri, 10 Jan 2025 23:26:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 225DC6B0098 for ; Fri, 10 Jan 2025 23:26:24 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id DA88FC1081 for ; Sat, 11 Jan 2025 04:26:23 +0000 (UTC) X-FDA: 82993884246.01.3E24E55 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf01.hostedemail.com (Postfix) with ESMTP id 1C69340003 for ; Sat, 11 Jan 2025 04:26:21 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=AUADu51b; spf=pass (imf01.hostedemail.com: domain of 37PKBZwYKCB0LNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=37PKBZwYKCB0LNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@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=1736569582; 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=SbJVE0M9LKkUTNkVCHm6/BBn09toAIcalEa/legv1OKB2RZgVUqAELwKDVOmXsuCd7cWmW 2+VGBsI+BkUDYkRVH+v8pkq8guLW54xZ2aumpUKkajRwqhZjoBlUzTYmw6skfcI3aKpPHZ Cd14wvcr02LbJ/xFv8YXVsR+mKQoQX8= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=AUADu51b; spf=pass (imf01.hostedemail.com: domain of 37PKBZwYKCB0LNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=37PKBZwYKCB0LNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736569582; a=rsa-sha256; cv=none; b=jGPJS9RTcpA7p5a7pnX/tmxT9RcnAYuXK7D0IXbsrv20vwcdeyz1tB58qIzjZdKi4pZBN5 GRuInkNKtUXnJ536XOicDcnd6Fp+CsugsYg8Ixpx4VGwHHFo2Gz5Jzk8R1mambO6kZ2QrQ cpefkat1XyvBDgkGPt6D6ViQOPlsZSM= Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-21640607349so58338555ad.0 for ; Fri, 10 Jan 2025 20:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736569581; x=1737174381; 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=AUADu51bBSscLpFhx9CAHCt8dfRsqG2/hHXpoDDmBFw+rF0u/LJam4L1hbAuf4VRp7 zy34moM6nWr9IpzU96xTgo9bLsM517oPAqOtpMIjH5vPCkK5m3fcogEYPIr6G5rSUsxX DOecFwAPVyY+wrwFrqXXyHVMooalCN6dQicyqNs7mrh8uCqLT6pne+WVrfaEeJ4tJwBo Ms7aI9HYO6+xx2YM8mIZUH22baMIbQ07njywc+Xc2U+AeD79qD8s+jpoPhLH9tv9Zox4 X3lxbg3O96wRp1joiiqn5zLumh8A2DtqcluD9ajSi/CC9S2IYGZiZt79k8NYrhqPsMdi AnuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736569581; x=1737174381; 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=wXatyv6WGzlSyjSJHBVMEZ5blR5EQw46LoN8y5Ky28dTbljXPKEqCX89HNnPek3ECM 7RHhN8fV5Jw0UgNUbceNrzocvk2aN/OVt1yk9iaN5hsfFZ5cEXTO41ZRd/AYEnO+yhss iHw1Ol2XrcP9Gebi7KWvlzW6zQkOHBjIFsFpvGxtMbS31XfR8q4r+VJhIJkIuoB0varm xMjrE0JEW8Ws5nO7Nux2tI/oyB95EJ2ZGtnw49EFvodK3wkMQgQNSEG37pfLGcXvLzvq uK4dWK+JKmWoN2ZnVNgBHaN+azxE+fLaEUO1tutsKEo8ZjpSdG0lOFyYBou7g0QZFAmi LZdw== X-Forwarded-Encrypted: i=1; AJvYcCViELemHUu0v9jTMFCsTqW6BcBIv7onlEtS9AQ6dGyY07BQ9dwYdb9asi2kmwWXCqUbosLbGeA7hA==@kvack.org X-Gm-Message-State: AOJu0YzydWtPQZnbzSWNPKROsIJwBL8cHpZ8rFbTJcYCLSLYC4lZNytH KCbcZGPZ8ZSLYVOrMQALtBMtnUJet8T84XcbNBfR7AA0IfgEDe9TDeIq6yZfPP2qk4dsWAOlQFr QTg== X-Google-Smtp-Source: AGHT+IE6ZciFE4COCcZoptuRqP9Xdk4NScDBFayFFXNBfZ/aDS6ipS+1cA/rJiTwDEgWxrdwV/9h4u1KDQw= X-Received: from pfbko22.prod.google.com ([2002:a05:6a00:4616:b0:72a:a111:742a]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:d043:b0:1e0:d4f4:5b39 with SMTP id adf61e73a8af0-1e88d1d5dfcmr24841946637.24.1736569580885; Fri, 10 Jan 2025 20:26:20 -0800 (PST) Date: Fri, 10 Jan 2025 20:25:53 -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-7-surenb@google.com> Subject: [PATCH v9 06/17] 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, 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, "Liam R. Howlett" X-Rspamd-Server: rspam05 X-Stat-Signature: joh9a1xdubgtbjytng974s6a9q316wqp X-Rspamd-Queue-Id: 1C69340003 X-Rspam-User: X-HE-Tag: 1736569581-40569 X-HE-Meta: U2FsdGVkX195qusgYRkFe0XG25LY01jKHEqHarAMOO3qnrWyB0AGmZHgJeyFCGP7DhAPkmuOvHRz+WGJ832mSLiR3aMAAv14cZE2VoMrAhDCecf3wN5wUONCXTUEmHOAdEGGUUKpO9XDUq2m88oEBVM6xFDY14XN9OWugcj2hYaFVx9O6XLoOR5M3q78JFH2x/HwTTrkIEJMMCyQo64i343OywvazExi4Lp2eNpAQ32ZzaFdYZCpmC7zMdjaAk08VcoDRYhEYQT6L7sy12E1pTDz/izcKvxPDFzo7Hgv+NE5EETozlSvpsM5Yt2JCv0mpvnN+zJm7JtiLxw6ubIIpO0pyb7WPBl2JD7TETbFLEs9TFdb8hVaw4joK9MnJfP+xRfuyMjvQo/HyJmMN8GuNAYqzvF4jgSG9OsVwlpnj2dP2uFQkTB6OrJVTYO/Kq1cxmmvwsJpvXKFZXDOZU0m651jpfry9xKiCuPFJBweZ9HU8dlJA+Ukermy9QCRmSIuNVpd7doESMcPjBvdw6vFAjrKdoLTKY5XovHQNfNpyTQRgF5MRNylhlb0wK6QTU+qxdvxqIpjADeduEt1bw92E1Y+aEfFCeuwk0OguuAQLGjYvC9cqoZI8+hzqa83GxJ7zLNrMDyJntfkHRaVslnk7GdjyQXY54nfW2XCcTxiLZWYpF0lGN7TQqAj3CNWOKEaDNr2jswTBt430Dz6gM2gjkcIaubJd2UkZdp+NcQl8SWzqSqZboUCVYEZU/j36mT69cjdng3/gfo5duCWsUh1vawAiyiDwN2GTeaFuDMKH6z6fKtjiYlQMnJnXiteQYosrklsjtft/cb6ZjoKEp14rGctKkwMdWRXEl1VdhGOyzOl7h71XAtLkNyapLXsPe1yK1I5uaKeyphIJYyWfm7fjaZEwiynW4uuQmoMrBBsZ+hMvrqIGmntwTvj0eABZmxDedNgIrws1elQbFw3pEH x5zkVGNL OJdQs3gaW8u9r30SxsRVkzO3cvFbegbj32p4nZOqqFq+WEvNpx/aGPTphpfsdzw5HiydNP5KWfAB+FxDgtQMMNX8Vrpm+V9y771XKcKhyGKq02yR8HrgrEkdwAQjtxcnwbrF1L53eKBaDbuLXbT0BK9xA/67mivHAfZ/wVLz6Zw7lPpXf5ekMXpf/31BsqERaH9GH4MdxUL4QrYXhkO5o0Fdo83BDMzTIaMjGHoeb1XuOF29A2tHDdKaxsDmMZQvt6O1REE2nTm3xOx6auaQSTb6CEUBI3NH3Ad4HrTO/wWO6pElAlioisZrP1oQhIgKKJ/D+HMce6b0WWM/4U49+ATIcAYBOqdqy49BA5u+rm5rTqKYCxspiIAXLv+6cx5O9gPHQ8zjRGurTbNksb9qhPBz9wAmQ3o6febN8MQf9IIyFPorkzs5BPzeVIVVSkc/5SXNKMZ/ppMIbehLRmJZCCHV93fQPmZiawa4vK4TEM13RXNNAKOsdG9Qh3ZVYZPvfYYAxMahnn+JC39SPoRWX5357L+aZ/IXztqucQcOvoRCu1RCOwVhGhZQC8eI6Y1czzytgYp8v/6qFeXr3NkOzsMNGZqYNqDgchSn9ok6UMluqskwOH/2gMzv5RwYdj7vB5cLBWC31sJ7TdyZkRZFQWQgcGbck5kHl6Iu7fE5qry8C3yR0H7m5N4jxIAp2T5DoU6kpQbJ4TlLQtrgd7GnW3+v90JT+kUS/KuzHGxuwlFItfJwdMjnKRMnLAHBPLwTw5Ffv 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 */