From patchwork Sat Dec 16 03:26:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 13495382 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 F31B0C4332F for ; Sat, 16 Dec 2023 03:27:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D77CE6B0506; Fri, 15 Dec 2023 22:27:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CFBE76B0508; Fri, 15 Dec 2023 22:27:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B53FC8D0143; Fri, 15 Dec 2023 22:27:18 -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 9EF616B0506 for ; Fri, 15 Dec 2023 22:27:18 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 706EA1A0619 for ; Sat, 16 Dec 2023 03:27:18 +0000 (UTC) X-FDA: 81571245756.02.F768447 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) by imf21.hostedemail.com (Postfix) with ESMTP id 927071C0012 for ; Sat, 16 Dec 2023 03:27:16 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=sCzIMwM2; spf=pass (imf21.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.184 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702697236; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LYpe5VKbI0uY+woOivYCAFG3kwewGieeeX3lG0j4fOU=; b=V7bsnwmd9bH5eeZd3/5um2kKe8ZgN/Qrm1kIe9u1TvuzLaNeCVm4sqDyIIDGw9UrFC/Ew6 pA29fa9TYQ8l/3rAr49IW8Dsrj4nu9QOhRGvconm5NhKmKHyzKhH1TW+MZp8b6fCu4y76j UdC77HuX+DnWzeBiz/bzdkOwTScP60E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702697236; a=rsa-sha256; cv=none; b=uEUZD0Vls7Mbx1tT6X+tAJDwY86toCv03+xXtfDyzeUgkiZPwB5pDn7NASpOVpiAo3vYj6 cnm+tOvKuFSnLWDRuA6pbSQfgHKqaFk0nsef+S7bMrXlFTsSGFWG9pDzdT7iVa4XgVtYE7 wcP8y8ZM7SFi2w627Snf/EvUHEw919k= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=sCzIMwM2; spf=pass (imf21.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.184 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702697235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LYpe5VKbI0uY+woOivYCAFG3kwewGieeeX3lG0j4fOU=; b=sCzIMwM2LXm7dg4joaoWyKEZ+f7mK4v8IWa0/1tqUO/odZhVKSP3iFUBWcXkcCzggkUcBA MgclZ5q0jgBG54q6SkQPGNkYuON4IZiYlXXHtFVEI8uH8v4wBfBNj7/uLqETu4JfhGOAl3 InhjvBSHWLsOm8Ju67WXZv0nZ3OLl5E= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: Kent Overstreet , tglx@linutronix.de, x86@kernel.org, tj@kernel.org, peterz@infradead.org, mathieu.desnoyers@efficios.com, paulmck@kernel.org, keescook@chromium.org, dave.hansen@linux.intel.com, mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, brauner@kernel.org Subject: [PATCH 18/50] hrtimers: Split out hrtimer_types.h Date: Fri, 15 Dec 2023 22:26:17 -0500 Message-ID: <20231216032651.3553101-8-kent.overstreet@linux.dev> In-Reply-To: <20231216032651.3553101-1-kent.overstreet@linux.dev> References: <20231216024834.3510073-1-kent.overstreet@linux.dev> <20231216032651.3553101-1-kent.overstreet@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 927071C0012 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: ebjmzqqqkhr6qynoz8y7dj77n71zhfo7 X-HE-Tag: 1702697236-166137 X-HE-Meta: U2FsdGVkX19oHoOdeUU5Yl1yo7u9gIna/1i9083XDRypqg9Q+LFwtf+iYWU2EH1rV3iL/FH/ouFQO0/o3Q7ZmUFVlfMpSBOZGruXmkVrQjB34wpOqqAZR8KXBLXVDw04riJgZiyM7bW/wm4+PqDYWxNB/tFXm1//8OZcNl2/udrBTQcrzGe7RnfHGS9hyf6K/7Y4BR1Es84DA/ze/BozSgFCkd2ZGviSDBK1GqAPzCVQGxEWCF9QLnBRSDHK0C3YTmaAPGSW0LM46aVSExpQkWI8iuq5A6jLhoBLDHyVoG2Hb31SbPDCq9D4ln6yGbPHEG/SVo0JNfYkp8h11+4DMd60YTN4aJKInsr26UU11BZ0r9BAmCiqR+zU0KwkZ9ZeLr+04/SvdawjyU+sFn/dVj7GMdmWPOnS6k7h6lYT9iafZO7WK1LmhGVop8g0HzZqnq206+cN0k55hjWbTeH5nRcSFX/deWPPXw6OK44A1KjOSZAksZZJYvtTFo/jrgulOVnjV067y/ZLtdqpG4Sza18Ae5tWbT+e7EwcQ7RMFHGcben0RxrKt17Nie+jTIsvNqk/+IBCXMLfPO7Me2x+G+RKAO/Z0NBHHxRSpou8rrEI70wq1FVD5K1H7OZhdwZbj5mBWv0nJOMAZ1BZC4c8qJGds9c1iQ2ga7w/0h60K/JH71JBUeu3CUjY3J/tIcI4LksE0zBPSuM3/cGp+qJzZvoWZ22aTuLf3ObFBqK6DPVBtkmL+gYQLPs1HyaUxBVyNrXlBFHvchYmDYuCJuf25nqUJpeKYXkLcUkohNh3Ah2vRy112K/rqIe8RAQy8uU7JQrSDbm0ZJcmEZrd+pxHe/QOG+iik3EPBb6PSaidQjGX/IwE1L0Qwz2s1HNVhmnNP5n0kDfMye8HBk4nXOu+JywhZqRt0jY4iqbIwP3AGEBj4m9Vywc+B/z+IRmHMuLufe8IkrlMiCeB1JxH/9D fnjaYs1g F2aKgggBv0wxuDzelMLhJo2PZs/kVYRgjieMHrpSfQzIhPoqUiNyQYaGXIoIMH4DdDeeZlbg9P70mGVrYR87nEPpN1srlL2XqT+QXEa2axJpV/yOMch746t+iSMCyhNJxgCLBGOewFMSuepHfUemWIac3/Nr8zjsjNw0RaCSIGRUG75E7aQAzVSzMlhc0eJy+S7Sq 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: We need to reduce the scope of what's included in sched.h: task_struct includes a hrtimer, so split out the core types into their own header. Signed-off-by: Kent Overstreet Cc: Thomas Gleixner --- include/linux/hrtimer.h | 44 ++---------------------------- include/linux/hrtimer_types.h | 50 +++++++++++++++++++++++++++++++++++ include/linux/sched.h | 2 +- 3 files changed, 53 insertions(+), 43 deletions(-) create mode 100644 include/linux/hrtimer_types.h diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 02d264ca9dce..87e3bedf8eb0 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -13,13 +13,13 @@ #define _LINUX_HRTIMER_H #include -#include +#include #include #include #include +#include #include #include -#include struct hrtimer_clock_base; struct hrtimer_cpu_base; @@ -59,14 +59,6 @@ enum hrtimer_mode { HRTIMER_MODE_REL_PINNED_HARD = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_HARD, }; -/* - * Return values for the callback function - */ -enum hrtimer_restart { - HRTIMER_NORESTART, /* Timer is not restarted */ - HRTIMER_RESTART, /* Timer must be restarted */ -}; - /* * Values to track state of the timer * @@ -94,38 +86,6 @@ enum hrtimer_restart { #define HRTIMER_STATE_INACTIVE 0x00 #define HRTIMER_STATE_ENQUEUED 0x01 -/** - * struct hrtimer - the basic hrtimer structure - * @node: timerqueue node, which also manages node.expires, - * the absolute expiry time in the hrtimers internal - * representation. The time is related to the clock on - * which the timer is based. Is setup by adding - * slack to the _softexpires value. For non range timers - * identical to _softexpires. - * @_softexpires: the absolute earliest expiry time of the hrtimer. - * The time which was given as expiry time when the timer - * was armed. - * @function: timer expiry callback function - * @base: pointer to the timer base (per cpu and per clock) - * @state: state information (See bit values above) - * @is_rel: Set if the timer was armed relative - * @is_soft: Set if hrtimer will be expired in soft interrupt context. - * @is_hard: Set if hrtimer will be expired in hard interrupt context - * even on RT. - * - * The hrtimer structure must be initialized by hrtimer_init() - */ -struct hrtimer { - struct timerqueue_node node; - ktime_t _softexpires; - enum hrtimer_restart (*function)(struct hrtimer *); - struct hrtimer_clock_base *base; - u8 state; - u8 is_rel; - u8 is_soft; - u8 is_hard; -}; - /** * struct hrtimer_sleeper - simple sleeper structure * @timer: embedded timer structure diff --git a/include/linux/hrtimer_types.h b/include/linux/hrtimer_types.h new file mode 100644 index 000000000000..f4ef391b96a7 --- /dev/null +++ b/include/linux/hrtimer_types.h @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_HRTIMER_TYPES_H +#define _LINUX_HRTIMER_TYPES_H + +#include +#include + +struct hrtimer_clock_base; + +/* + * Return values for the callback function + */ +enum hrtimer_restart { + HRTIMER_NORESTART, /* Timer is not restarted */ + HRTIMER_RESTART, /* Timer must be restarted */ +}; + +/** + * struct hrtimer - the basic hrtimer structure + * @node: timerqueue node, which also manages node.expires, + * the absolute expiry time in the hrtimers internal + * representation. The time is related to the clock on + * which the timer is based. Is setup by adding + * slack to the _softexpires value. For non range timers + * identical to _softexpires. + * @_softexpires: the absolute earliest expiry time of the hrtimer. + * The time which was given as expiry time when the timer + * was armed. + * @function: timer expiry callback function + * @base: pointer to the timer base (per cpu and per clock) + * @state: state information (See bit values above) + * @is_rel: Set if the timer was armed relative + * @is_soft: Set if hrtimer will be expired in soft interrupt context. + * @is_hard: Set if hrtimer will be expired in hard interrupt context + * even on RT. + * + * The hrtimer structure must be initialized by hrtimer_init() + */ +struct hrtimer { + struct timerqueue_node node; + ktime_t _softexpires; + enum hrtimer_restart (*function)(struct hrtimer *); + struct hrtimer_clock_base *base; + u8 state; + u8 is_rel; + u8 is_soft; + u8 is_hard; +}; + +#endif /* _LINUX_HRTIMER_TYPES_H */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 7501a3451a20..3762809652da 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include