From patchwork Mon Dec 16 19:24:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13910239 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 08EF5E77180 for ; Mon, 16 Dec 2024 19:24:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B6906B00B3; Mon, 16 Dec 2024 14:24:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 88CAD6B00B4; Mon, 16 Dec 2024 14:24:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BB226B00B7; Mon, 16 Dec 2024 14:24:37 -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 3DB1F6B00B3 for ; Mon, 16 Dec 2024 14:24:37 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DB469B036F for ; Mon, 16 Dec 2024 19:24:36 +0000 (UTC) X-FDA: 82901798364.11.343AF1E Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf22.hostedemail.com (Postfix) with ESMTP id CEFB2C0004 for ; Mon, 16 Dec 2024 19:24:03 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="rpLvz/Nh"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf22.hostedemail.com: domain of 3cX5gZwYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3cX5gZwYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734377061; 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=0ykFNL3Q77su3l1hmkCa41V3LHYM0KyunH48W8conCI=; b=OpgfhREQ5tLs4ao1sgkjcbR8joN+XelbmL67jphVYfbgRl0oFTp/a45mNzapp/xBaDEbbS 2t7B97O/dGwNVhlas4zthC3iMvMAUdTAF1f0uiySV6Yyg04+Sfmf15bGkQDV9IpgsjnniT p7eW5wALxeYH5yu1ZwjE39WoZp5d/vg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734377061; a=rsa-sha256; cv=none; b=bn5tB2Zv2LKxf9akIg8P03judD/QCrxfCgpkFccXehSPe4PR/zmoQGyuQNH4+KMrJgYL75 SOMbVdGg/rsAVDGVnr1+4LC9ZiMqMbzdJygIkX3Je1pknVQv7e2AVMgLRCIQCORLFac3iS lom1/ElgpGkc0K5eZJmhIXycLUST7ZQ= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="rpLvz/Nh"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf22.hostedemail.com: domain of 3cX5gZwYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3cX5gZwYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-21661949f23so62981465ad.3 for ; Mon, 16 Dec 2024 11:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734377074; x=1734981874; 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=0ykFNL3Q77su3l1hmkCa41V3LHYM0KyunH48W8conCI=; b=rpLvz/NhUhULxn3Jn7RjtiD/DOXmfKwrZvwBDNw0GOKdJlxqVfiINoiAwp00tHvO61 /lbCiacG1m4KEWHcENVF+pn82LZWG1m9OJNTRDvKma5DbPrfdIKFs318Tt0xO1OtWBey vJbuuvGMv/gAv3BmYLsbY9HYEInfgZqBbNSClBMjq+skQ75xsNyus6/+oQzUNHrlsyV3 18gHIZG93znqFnFrweMBSUYWvMqjxSY0oeoGU0+mRHj6EgDCf/Fgmp2CaWUJgZFzMmVk K6Yq+XeIlYk4Air18VMxLq3RR+9dhlwRG/k9ejhmHbjJXtS+7DZwClZEjPI+9hQwyj8w CxRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734377074; x=1734981874; 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=0ykFNL3Q77su3l1hmkCa41V3LHYM0KyunH48W8conCI=; b=awCWqDXXpd8jGKK9yN+d92VqGbWFSQADF5NJVONNWou3NqvCElsPHkrXlNif+ie/cs q31ofqJ/5rZc3TfW/x55ZJQvmH/bNALO8Of3H7jgj//Ch7rMry0jLzGpRQXOZiq2+HzH Jt5ydm0LuYCcAllDI/C6sN6RdjWVejKtYKsiw/aS5DONOuAsSyP/PDprxU4brcdolmBL dhnR3TTYs+4xa7bcWhThYy23HV1FSDS52cpgW4xSjEtlNhrR+nGH8vhAe9g0mwLJ54pG caTa1mCG3/UUpuyeeHfF1Yb35+vAWHn+fI0OFNEwNDvYMxLYuQaKtKOfiImNv9BTdq6h 3RaQ== X-Forwarded-Encrypted: i=1; AJvYcCUzPvfawSszDGX/zrygpzYo4axc+zPzKrwksL1Yq7Jm0HMlex2uD+DIHVDl7eOBBhbg/qTg/8HJ6w==@kvack.org X-Gm-Message-State: AOJu0YzbvAo2WF8T5w/NupUNh0ruxsJ2H+uXVkbYJuSLDlwP+sLfoqBq E7dwL2HNPWorGRcOirlLU3k6jF3n8u1Zo7vvNJUF4488UwEA80PHmrCFLTIPkwjzHYILrGgiYsR s+Q== X-Google-Smtp-Source: AGHT+IEVw0uJl7cLZP7L5C6hpMFvqcbjARbisNWJ3VdxfhR00byT5nuQon+Itb1c7QrUoZSJH5F454tTzFQ= X-Received: from pgbel4.prod.google.com ([2002:a05:6a02:4644:b0:7fd:40dd:86a5]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:e80d:b0:215:b5d6:5fa8 with SMTP id d9443c01a7336-21892a441admr219433885ad.22.1734377073676; Mon, 16 Dec 2024 11:24:33 -0800 (PST) Date: Mon, 16 Dec 2024 11:24:08 -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-6-surenb@google.com> Subject: [PATCH v6 05/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, corbet@lwn.net, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com, surenb@google.com X-Stat-Signature: iczfc4i3yoy8zbz8xx7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2j12fJ/2 aLohbh/P JGcmFTcmNa46DcC882VM0d7l3aCQwJzIiwtoRoku9dj37Ndr93Lod41LThkNDrCJKRb8abQRkgbu4bHT84fzvxsz1KoPjuxygcd+cIb+oBWTWahBeIqOvcM5es8qlA1vVZRHVeXgc0AtCO0Ols0Zn3Qd6cF2Fga3Ckpj0544tHCm1FHqnonH0DcQPfb7KvvQt17IqcJA23//tAW/eBHZgmyBjD63Yl7T0W1GOou6sRt0HMoNoL+VtpQCikdwjZJbrKqHPS0mJpyIfFdbVxMFENVQnYlTUwlGO1eEQ2moO/1qR4N5149j8rGutmEQTISAv92BRFHFPiucj/8O0a/1xE9gSzgJtz5Vr6gKgd29JU4ZZAEmbkLgcsol1Y3SySxp16DYH+ym1OAfkNv+PXoJI3GX5At7+tHFnXZu0z52HuBuvn+hRgh+O09lDZ2X0yNuPGNxh4v/0AuUU/Rg9+tr6Kk0YMBlInzBQUMqyXlqmocXuVSZYrtRgk+uu39bXjuIFHNW/BV8utgg+1IowdaP6wgYmhLIiMdVTZ9HXE4FwA7Z61a0tO2ekdk7/FYQYiBbrJATKi3TpJF9w+c5YT+0L99t0imoYCvs7HtSL X-Bogosity: Ham, tests=bogofilter, spamicity=0.066840, 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 --- 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 */