From nobody Thu Aug 13 09:24:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1785733664; cv=none; d=zohomail.com; s=zohoarc; b=X2shlCuWdAkv086Ztnve3rz4iwttOnGflmfAEjqzAe47raPfYzyAzjyfIqH4vlT3R0d2HsT3FHfZb+XQli1DKIjjuBivPYHPg/2gyrP34pLqOta341Ixum4bHzektBKZNYbpxJf8j5Ax63MU7gf/rX4DRD/9HTioJAaXI1ohcRU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785733664; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CvaIgsy1tiLeOz4+v4UxZSpgWz1oDHV9WwaN0mMyibY=; b=cDg59x44JbdypV/HjmjmOWFTU7LGjoi3JE/s27S3jIxtx0wMqCAUljh8xIwaV+5JGml7woAkPy/fs6VlQYpeoNhjl3PlmLsrsJsu8iUP5nNGImWBwQPnnjnJ0PcFVwpiv8VRHI0BofALlnwI0w0a9PiH14y6U9I0FTsAQI3nWwI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1785733664719241.99000914245698; Sun, 2 Aug 2026 22:07:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1381101.1624663 (Exim 4.92) (envelope-from ) id 1wqktP-0002Wc-4c; Mon, 03 Aug 2026 05:07:15 +0000 Received: by outflank-mailman (output) from mailman id 1381101.1624663; Mon, 03 Aug 2026 05:07:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktP-0002WV-1X; Mon, 03 Aug 2026 05:07:15 +0000 Received: by outflank-mailman (input) for mailman id 1381101; Mon, 03 Aug 2026 05:07:13 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktN-0002WF-9G for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 05:07:13 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wqktM-006W6b-MN for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 07:07:12 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a7021f8-e002-0a2a0a5209dd-0a2a450bce68-26 for ; Mon, 03 Aug 2026 07:07:12 +0200 Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a702200-b7e8-0a2a450b0019-d1558030e5e9-3 for ; Mon, 03 Aug 2026 07:07:12 +0200 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4957eefd361so10928575e9.1 for ; Sun, 02 Aug 2026 22:07:12 -0700 (PDT) Received: from notebook.. ([78.173.117.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b917efsm310345185e9.11.2026.08.02.22.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 22:07:10 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785733632; x=1786338432; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CvaIgsy1tiLeOz4+v4UxZSpgWz1oDHV9WwaN0mMyibY=; b=cc22UMfISvV5CaIzWCq7K3UvrVbWjWfqhCwBmSL2Vg+vj74LKVQiWgm4WJpaulmkPG 7Z80AZuFhud6WEyVe7rEBIGSD50YavcpACKE4XHzr7tEcNGjcit8stY9Y2tLJ+CUXNuY PUGYUBGsUvCblQNxIz4Midvrig5vc0Uq9CpRACVbQhFgdnKhdp2abdMAKc6zo9y/apH4 MYn2QP2WHzk4+wJEoyvRXQxmIJY85GPpUabJ5o/Tv8iw/Syc//+GiSQk8mxFSlYKRdKg BZNbzqWpYscQjoLKFjikO62uRHGSY2H1uJ0a/VmN1AqY3voZG+hO+2WLYTWz3xAGaWqi fjWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785733632; x=1786338432; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CvaIgsy1tiLeOz4+v4UxZSpgWz1oDHV9WwaN0mMyibY=; b=IDOmF5USp6N6m1dqs3//GUxOv7HIDxyNEm8/+QDuBwciyop6eexd85Rs4/aCUUsAEB fIMZG3QVImAtVYVB+05j/PV4TAWyog6i4R3Iy/l97gxDqvjWZxLTUN1NGqvcdyJw2eAE ZgGtQ74wQpbK/uroyFeAwGrVPhmvc/bwTLgM/QPsC/6UnD0j9hjXY11dbe2aGlRVb3Ox /pR3xITQYOZCUAGIhT61WJzdWNwRKNj+KDoj9afjom1w6Sdz49TLA+kZ8X8W4WuuL2CD dn9VIECZeWPB5GWrATXB6QLK1NmLaAdgOWK+H6WNM2NLiAG5J0ejK3n2X6CkCU/SIE14 t6EA== X-Gm-Message-State: AOJu0Yyk44rjQLsRn4poS2hlDRy7R+Csaoso/WVjCg3fSF5gFcW3Sl9C MLDOjmz39knM23YcxVe9ab4BVVKcLG0kvWJEuobQVZqAm2J86S2/CPqBueJysj5I X-Gm-Gg: AR+sD126IXl6KTmLV6TU60bo2mUI9gSxXLRM366vlfbSOITgvpCx3X3//wdBiSh7jq7 E3i1i88vBtuI9gFHmoYfAmT9A3r5fPmSuzsx7EEU2Rv8MNnFBt6ffca2lwhoh443Fi50L9C9o2W ucIBfbHIc/6vlbzvD3AG+5581A6C9k290ve3f9/vRVP3rNJEq6L1hcr6d28QVZRZ1nWnFFJjAFj JzDEDZ9kzCp6Pd52rkNKmZP8tZd7p4DNWMzr2mw2Lusk0xhwVutnQDfX9dso3umHXmqIhgmLiHJ 3pJ/CaW++gvf+wHpmRbt4GDXkoW6cYzqVD5KxeQHetNs1z7vCq+dZHwerf9e9X3JdpZyCg3kA/t IrEDoKXsOzdEL5mXR0A5Xc74AUdCcQjg8JL0f/FWy7xdo7HsEYcwnPTfrFMW7wNPozQ/UX0jNxU 44Y/BAnlZU3Io3ib+9jVNQHaoJsK0BKZiRUOLwPtv7CpxGRSHz/t93NhbeW9Fs4g== X-Received: by 2002:a05:600c:8489:b0:495:495b:9248 with SMTP id 5b1f17b1804b1-4980c64b73emr200743855e9.4.1785733631883; Sun, 02 Aug 2026 22:07:11 -0700 (PDT) From: Furkan Caliskan To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, jbeulich@suse.com, jgross@suse.com, gwd@xenproject.org, dfaggioli@suse.com, stewart.hildebrand@amd.com, nathan.studer@dornerworks.com, roger@xenproject.org, anthony.perard@vates.tech, julien@xen.org, sstabellini@kernel.org, michal.orzel@amd.com, bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, teddy.astie@vates.tech, tpearson@raptorengineering.com, alistair.francis@wdc.com, connojdavis@gmail.com, oleksii.kurochko@gmail.com, Furkan Caliskan Subject: [PATCH 1/7] xen/sched: introduce struct sched_ops as a shared scheduler vtable Date: Mon, 3 Aug 2026 08:06:08 +0300 Message-Id: <20260803050614.5222-2-frn1furkan10@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260803050614.5222-1-frn1furkan10@gmail.com> References: <20260803050614.5222-1-frn1furkan10@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1785733632-1A2C49EA-B54E27DF/0/0 X-purgate-type: clean X-purgate-size: 14848 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1785733667227158500 Content-Type: text/plain; charset="utf-8" struct scheduler currently serves two purposes: it is the static vtable a scheduler backend defines (name, opt_name, sched_id, and all its function pointers), and it is also the per-cpupool runtime object scheduler_alloc() allocates. Being the same type forces scheduler_alloc() to memcpy() the whole vtable into a fresh allocation per cpupool, duplicating identical function pointers across every cpupool using the same scheduler. Introduce struct sched_ops to hold just the compile-time-constant identity and dispatch table, with no per-cpupool state, plus REGISTER_SCHED_OPS() and a sched_ops_array[] alongside the existing schedulers[]. scheduler_alloc(), sched_get_by_name(), and scheduler_init() are extended to also search sched_ops_array[], using a new sched_ops_to_scheduler() helper to build an identical flat struct scheduler regardless of which array a match came from. struct scheduler itself is left untouched for now and still duplicates every field sched_ops holds - this commit only lays the groundwork. Once every backend registers through sched_ops, struct scheduler will be shrunk to its genuinely per-cpupool fields (a pointer to a shared sched_ops instance, plus instance data), and the flattening copy, schedulers[], and REGISTER_SCHEDULER() will be removed. That is what actually removes the duplication; this commit does not yet change any behavior, since sched_ops_array[] is still empty. Signed-off-by: Furkan Caliskan --- xen/arch/arm/xen.lds.S | 1 + xen/arch/ppc/xen.lds.S | 1 + xen/arch/riscv/xen.lds.S | 1 + xen/arch/x86/xen.lds.S | 1 + xen/common/sched/core.c | 118 +++++++++++++++++++++++++++++++++++-- xen/common/sched/private.h | 73 +++++++++++++++++++++++ xen/include/xen/xen.lds.h | 6 ++ 7 files changed, 196 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 2d5f1c516d..9a63fa36a0 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -94,6 +94,7 @@ SECTIONS *(.data.page_aligned) =20 SCHEDULER_ARRAY + SCHED_OPS_ARRAY HYPFS_PARAM =20 *(.data .data.*) diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S index d0f2ed43f1..da8f73d85b 100644 --- a/xen/arch/ppc/xen.lds.S +++ b/xen/arch/ppc/xen.lds.S @@ -85,6 +85,7 @@ SECTIONS *(.data.page_aligned) =20 SCHEDULER_ARRAY + SCHED_OPS_ARRAY HYPFS_PARAM =20 *(.data .data.*) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 65f136dce9..01f202e504 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -90,6 +90,7 @@ SECTIONS *(.data.page_aligned) =20 SCHEDULER_ARRAY + SCHED_OPS_ARRAY HYPFS_PARAM =20 *(.data .data.*) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index b9e888e596..d128a30440 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -307,6 +307,7 @@ SECTIONS *(.data.read_mostly) =20 SCHEDULER_ARRAY + SCHED_OPS_ARRAY HYPFS_PARAM } PHDR(text) =20 diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 3609721426..fb2d1d5314 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -91,6 +91,10 @@ extern const struct scheduler *__start_schedulers_array[= ], *__end_schedulers_arr #define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array) #define schedulers __start_schedulers_array =20 +extern const struct sched_ops *__start_sched_ops_array[], *__end_sched_ops= _array[]; +#define NUM_SCHED_OPS (__end_sched_ops_array - __start_sched_ops_array) +#define sched_ops_array __start_sched_ops_array + static struct scheduler __read_mostly operations; =20 static bool scheduler_active; @@ -98,6 +102,43 @@ static bool scheduler_active; static void sched_set_affinity( struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft); =20 + +static void sched_ops_to_scheduler( + struct scheduler *sched, const struct sched_ops *ops) +{ + sched->name =3D ops->name; + sched->opt_name =3D ops->opt_name; + sched->sched_id =3D ops->sched_id; + sched->global_init =3D ops->global_init; + sched->init =3D ops->init; + sched->deinit =3D ops->deinit; + sched->free_udata =3D ops->free_udata; + sched->alloc_udata =3D ops->alloc_udata; + sched->free_pdata =3D ops->free_pdata; + sched->alloc_pdata =3D ops->alloc_pdata; + sched->deinit_pdata =3D ops->deinit_pdata; + sched->alloc_domdata =3D ops->alloc_domdata; + sched->free_domdata =3D ops->free_domdata; + sched->switch_sched =3D ops->switch_sched; + sched->insert_unit =3D ops->insert_unit; + sched->remove_unit =3D ops->remove_unit; + sched->sleep =3D ops->sleep; + sched->wake =3D ops->wake; + sched->yield =3D ops->yield; + sched->context_saved =3D ops->context_saved; + sched->do_schedule =3D ops->do_schedule; + sched->pick_resource =3D ops->pick_resource; + sched->migrate =3D ops->migrate; + sched->adjust =3D ops->adjust; + sched->adjust_affinity =3D ops->adjust_affinity; +#ifdef CONFIG_SYSCTL + sched->adjust_global =3D ops->adjust_global; +#endif + sched->dump_settings =3D ops->dump_settings; + sched->dump_cpu_state =3D ops->dump_cpu_state; + sched->move_timers =3D ops->move_timers; +} + static struct sched_resource *cf_check sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *= unit) { @@ -3004,11 +3045,27 @@ const struct scheduler *__init sched_get_by_name(co= nst char *sched_name) return NULL; } =20 +static inline +const struct sched_ops *__init sched_ops_get_by_name(const char* sched_nam= e) +{ + unsigned int i; + for ( i =3D 0; i < NUM_SCHED_OPS; i++) + if ( sched_ops_array[i] && !strcmp(sched_ops_array[i]->opt_name, s= ched_name) ) + return sched_ops_array[i]; + + return NULL; +} + int __init sched_get_id_by_name(const char *sched_name) { const struct scheduler *scheduler =3D sched_get_by_name(sched_name); + const struct sched_ops *ops; + + if ( scheduler ) + return scheduler->sched_id; =20 - return scheduler ? scheduler->sched_id : -1; + ops =3D sched_ops_get_by_name(sched_name); + return ops ? ops->sched_id : -1; } =20 /* Initialise the data structures. */ @@ -3016,6 +3073,7 @@ void __init scheduler_init(void) { struct domain *idle_domain; const struct scheduler *scheduler; + const struct sched_ops *ops; int i; =20 scheduler_enable(); @@ -3048,15 +3106,52 @@ void __init scheduler_init(void) } } =20 + for ( i =3D 0; i < NUM_SCHED_OPS; i++) + { +#define sched_test_func(f) \ + if ( !sched_ops_array[i]->f ) \ + { \ + printk("scheduler %s misses .%s, dropped\n", \ + sched_ops_array[i]->opt_name, #f); \ + sched_ops_array[i] =3D NULL; \ + } + + sched_test_func(init); + sched_test_func(deinit); + sched_test_func(pick_resource); + sched_test_func(alloc_udata); + sched_test_func(free_udata); + sched_test_func(switch_sched); + sched_test_func(do_schedule); + +#undef sched_test_func + + if ( sched_ops_array[i]->global_init && sched_ops_array[i]->global= _init() < 0) + { + printk("scheduler %s failed initialization, dropped\n", + sched_ops_array[i]->opt_name); + sched_ops_array[i] =3D NULL; + } + } + scheduler =3D sched_get_by_name(opt_sched); - if ( !scheduler ) + ops =3D scheduler ? NULL : sched_ops_get_by_name(opt_sched); + if ( !scheduler && !ops ) { printk("Could not find scheduler: %s\n", opt_sched); scheduler =3D sched_get_by_name(CONFIG_SCHED_DEFAULT); - BUG_ON(!scheduler); - printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_name); + ops =3D scheduler ? NULL : sched_ops_get_by_name(CONFIG_SCHED_DEFA= ULT); + BUG_ON(!scheduler && !ops); + if ( scheduler ) + printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_na= me); + else + printk("Using '%s' (%s)\n", ops->name, ops->opt_name); } - operations =3D *scheduler; + + if ( scheduler ) + operations =3D *scheduler; + else + sched_ops_to_scheduler(&operations, ops); =20 if ( cpu_schedule_up(0) ) BUG(); @@ -3415,12 +3510,25 @@ struct scheduler *scheduler_alloc(unsigned int sche= d_id) for ( i =3D 0; i < NUM_SCHEDULERS; i++ ) if ( schedulers[i] && schedulers[i]->sched_id =3D=3D sched_id ) goto found; + + for ( i =3D 0; i < NUM_SCHED_OPS; i++ ) + if ( sched_ops_array[i] && sched_ops_array[i]->sched_id =3D=3D sch= ed_id ) + goto found_new; + return ERR_PTR(-ENOENT); =20 found: if ( (sched =3D xmalloc(struct scheduler)) =3D=3D NULL ) return ERR_PTR(-ENOMEM); memcpy(sched, schedulers[i], sizeof(*sched)); + goto init; + + found_new: + if ( (sched =3D xzalloc(struct scheduler)) =3D=3D NULL ) + return ERR_PTR(-ENOMEM); + sched_ops_to_scheduler(sched, sched_ops_array[i]); + + init: if ( (ret =3D sched_init(sched)) !=3D 0 ) { xfree(sched); diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index d6884550cd..4dd5c99b87 100644 --- a/xen/common/sched/private.h +++ b/xen/common/sched/private.h @@ -294,6 +294,76 @@ static inline spinlock_t *pcpu_schedule_trylock(unsign= ed int cpu) return NULL; } =20 +struct sched_ops { + const char *name; /* full name for this sched_ops */ + const char *opt_name; /* option name for this sched_ops */ + unsigned int sched_id; /* ID for this sched_ops */ + + int (*global_init) (void); + + int (*init) (struct scheduler *ops); + void (*deinit) (struct scheduler *ops); + + void (*free_udata) (const struct scheduler *ops, void *pri= v); + void * (*alloc_udata) (const struct scheduler *ops, + struct sched_unit *unit, void *dd); + + void (*free_pdata) (const struct scheduler *ops, + void *pcpu, int cpu); + void * (*alloc_pdata) (const struct scheduler *ops, int cpu); + void (*deinit_pdata) (const struct scheduler *ops, + void *pcpu, int cpu); + + /* Returns ERR_PTR(-err) for error, NULL for 'nothing needed'. */ + void * (*alloc_domdata) (const struct scheduler *ops, + struct domain *dom); + /* Idempotent. */ + void (*free_domdata) (const struct scheduler *ops, void *dat= a); + + spinlock_t * (*switch_sched) (struct scheduler *new_ops, unsigned in= t cpu, + void *pdata, void *vdata); + + /* Activate / deactivate units in a cpu pool */ + void (*insert_unit) (const struct scheduler *ops, + struct sched_unit *unit); + void (*remove_unit) (const struct scheduler *ops, + struct sched_unit *unit); + + void (*sleep) (const struct scheduler *ops, + struct sched_unit *unit); + void (*wake) (const struct scheduler *ops, + struct sched_unit *unit); + void (*yield) (const struct scheduler *ops, + struct sched_unit *unit); + void (*context_saved) (const struct scheduler *ops, + struct sched_unit *unit); + + void (*do_schedule) (const struct scheduler *ops, + struct sched_unit *currunit, s_time_t = now, + bool tasklet_work_scheduled); + + struct sched_resource *(*pick_resource)(const struct scheduler *ops, + const struct sched_unit *unit); + void (*migrate) (const struct scheduler *ops, + struct sched_unit *unit, + unsigned int new_cpu); + int (*adjust) (const struct scheduler *ops, + struct domain *d, + struct xen_domctl_scheduler_op *op); + void (*adjust_affinity)(const struct scheduler *ops, + struct sched_unit *unit, + const struct cpumask *hard, + const struct cpumask *soft); +#ifdef CONFIG_SYSCTL + int (*adjust_global) (const struct scheduler *ops, + struct xen_sysctl_scheduler_op *sc); +#endif + void (*dump_settings) (const struct scheduler *ops); + void (*dump_cpu_state) (const struct scheduler *ops, int cpu); + void (*move_timers) (const struct scheduler *ops, + struct sched_resource *sr); +}; + struct scheduler { const char *name; /* full name for this scheduler */ const char *opt_name; /* option name for this scheduler */ @@ -546,6 +616,9 @@ static inline void sched_unit_unpause(const struct sche= d_unit *unit) #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \ __used_section(".data.schedulers") =3D &(x) =20 +#define REGISTER_SCHED_OPS(x) static const struct sched_ops *x##_entry \ + __used_section(".data.sched_ops") =3D &(x) + struct cpupool { unsigned int cpupool_id; diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h index ea11e3fb62..157d48eabd 100644 --- a/xen/include/xen/xen.lds.h +++ b/xen/include/xen/xen.lds.h @@ -179,6 +179,12 @@ *(.data.schedulers) \ __end_schedulers_array =3D .; =20 +#define SCHED_OPS_ARRAY \ + . =3D ALIGN(POINTER_ALIGN); \ + __start_sched_ops_array =3D .; \ + *(.data.sched_ops) \ + __end_sched_ops_array =3D .; + #ifdef CONFIG_HYPFS #define HYPFS_PARAM \ . =3D ALIGN(POINTER_ALIGN); \ --=20 2.34.1 From nobody Thu Aug 13 09:24:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1785733655; cv=none; d=zohomail.com; s=zohoarc; b=MG8+0EO+BSU79+1M3gaf3b07BzcMDu7FcppGvFQy1V2i/t5sx51rgwGbIpiWWTtWc947qPxuury3Rr00rQCFhKgWimzop6mBi5NhgDZ4ZUuYzTjTo0uNPTxQDR9J44u/yz+tScBDP4xpb6Ff/ySbL0gN8P5wtfUpGrkzV3wS774= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785733655; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kwX99bHKclxWTYHmK+vhBg0zTegHyj1b3u5g7DqxgOA=; b=ZUQveQBI9cet5EKBqXgPBHY5vMv9fggaidH4Tze3ycMotGuX79X+tQa/kjJgGVrAwcbT5CkXltkuGs4ROfrzf2+YY/1pEbmHKKVz2UbWpmUIrEdQwv/5QuaOpbUqc6gAKJrEaTKipzL3+nzmPtXi2IVATYxwkGVVjQbrUhg/uYQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1785733655426270.87390469990487; Sun, 2 Aug 2026 22:07:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1381102.1624673 (Exim 4.92) (envelope-from ) id 1wqktT-0002mf-GK; Mon, 03 Aug 2026 05:07:19 +0000 Received: by outflank-mailman (output) from mailman id 1381102.1624673; Mon, 03 Aug 2026 05:07:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktT-0002mY-Cq; Mon, 03 Aug 2026 05:07:19 +0000 Received: by outflank-mailman (input) for mailman id 1381102; Mon, 03 Aug 2026 05:07:18 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktS-0002lj-F3 for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 05:07:18 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wqktR-006WBT-S7 for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 07:07:17 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a702204-e002-0a2a0a5209dd-0a2a4509bd80-8 for ; Mon, 03 Aug 2026 07:07:17 +0200 Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a702205-be1a-0a2a45090019-d1558031f053-3 for ; Mon, 03 Aug 2026 07:07:17 +0200 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4953e04ef16so17071495e9.2 for ; Sun, 02 Aug 2026 22:07:17 -0700 (PDT) Received: from notebook.. ([78.173.117.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b917efsm310345185e9.11.2026.08.02.22.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 22:07:16 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785733637; x=1786338437; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kwX99bHKclxWTYHmK+vhBg0zTegHyj1b3u5g7DqxgOA=; b=LrHtOCDS+2rHTuc7JUfMY4RT1XOTojHFP/DhHx0KMvxPPdZmBC76FNYOGKU5Y0KRIT 7Ah6KBAqy3j9I/9QtNE6n3T+BYXUMISDF2OEcscLEetdbqSsas3y5O8+//MYUYzxTl1c MbfqZB0PSvEyNlhxuO9AWufa5SuNnWJ7bgSK/hWojq/6aJJTC9X1YQa8UNXXmq3Nczz9 KhXJ9BjYHi8Cy4+D1GUalz/zJyB2yn6YqoD/3m9ONfgMOgxHQiw5mvNFaGS1nW7ZJKDe F2QNsPRE/bCcM2RgNEerocFDvkZVyX5/ilI1C89ojVrLebK78cHJ2sf+ZoBXOZP4e0Wl s4eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785733637; x=1786338437; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=kwX99bHKclxWTYHmK+vhBg0zTegHyj1b3u5g7DqxgOA=; b=JnvgHv9TRh9pXg/DK6oJU2eRMa4bAs3kavudTCKrZ/OPsPRsO+xUNW+vt4YvfIZhdN 0MnFunzUFKj0gvhfqFfARMJ9aSCJloLHh7A1UhmjbjIHVMSASlTe98c8g4qXYRjd5qTy 84IVe6dFowLXhDu0fNgzNUgscvjaKx7/2HJYyxb4Gp4euM3eiXOaCAkYq13E7jVsZCoT OvsqwsPg3ndy5m/bopXE8VynJYE5E/g4zZfv9YzPiJVDIDZh6U2EDWkQZKkhpCy4ari+ a3ZQ+xpy8r4YvSdQwxGxNZr3KSSjQeArunWC4iNF/Sp/zV+cykCTXS9Uih4/ESA2+Z/Z Y6Dg== X-Gm-Message-State: AOJu0Yy3Ac26CAHGq3zr8sJbyM2D1zJd8X0jyGHpYcEaw0Om/SYT3/pj 34dG5Qu6PSU2nROdGE/oXyn/a02GBvtMnLWB6Sx0AD35C7EsS7wjqOrNTUr3uQ== X-Gm-Gg: AR+sD11x6ITQ8aCGR2NQmLtepzSY+/ZON2Y3igv/AsIXGI110mszaIKKib2lUpWv+ym yUfhZpS5fzlIwNs+cjWc/ohJ7Kr3wS6zbFkrsp2QcW3CLXsw5cLE7mN7BH5FcPB7g8mFRl4BjSA WVMLLQxTn3S8yFNJBN1NYnSjDUVVNzq1xA3oajykug4+gASORNnnygJ/j6ANnNqCRtg5MQR78QQ P7F4nagNWytlq0zSCigG7XwyRl4WWJububb3lcU54fwL7brlKEW/95QRMifsJwhsSA4D+Q2cqDu IJCx2R92GUpkZRKMnrmeijCGYi/HsfnJ1VnI9hQ4UDU2gjf1/Y5BFuBD4COWsccDfqb8wn1lxOC Z5u522tToFeKMiN7bOdQhg7hq4AqpMIzbZ4840Dcl4f5ueGwUEn7dnPT8mvvV4XXi0InJf4VVEp LnmQNMFLRRNBgZT3+53jrGrtGt7xnngb8a/CSzfOKIQwUiq5InNp1sE/P4bDhTEQ== X-Received: by 2002:a05:600c:8b33:b0:495:779a:ed33 with SMTP id 5b1f17b1804b1-4980c66c798mr200299205e9.7.1785733637288; Sun, 02 Aug 2026 22:07:17 -0700 (PDT) From: Furkan Caliskan To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, jbeulich@suse.com, jgross@suse.com, gwd@xenproject.org, dfaggioli@suse.com, stewart.hildebrand@amd.com, nathan.studer@dornerworks.com, roger@xenproject.org, anthony.perard@vates.tech, julien@xen.org, sstabellini@kernel.org, michal.orzel@amd.com, bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, teddy.astie@vates.tech, tpearson@raptorengineering.com, alistair.francis@wdc.com, connojdavis@gmail.com, oleksii.kurochko@gmail.com, Furkan Caliskan Subject: [PATCH 2/7] xen/sched: credit: migrate to new sched_ops Date: Mon, 3 Aug 2026 08:06:09 +0300 Message-Id: <20260803050614.5222-3-frn1furkan10@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260803050614.5222-1-frn1furkan10@gmail.com> References: <20260803050614.5222-1-frn1furkan10@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-bad1c0/1785733637-FCA16034-6DD59F6E/0/0 X-purgate-type: clean X-purgate-size: 1237 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1785733657507158500 Content-Type: text/plain; charset="utf-8" Declare sched_credit_def as a struct sched_ops instead of a struct scheduler, dropping the .sched_data field, and register it with REGISTER_SCHED_OPS() so it is found through sched_ops_array[] instead of schedulers[]. This moves the credit scheduler onto the new sched_ops registration path. Signed-off-by: Furkan Caliskan --- xen/common/sched/credit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c index 328c802d0c..d8c949af11 100644 --- a/xen/common/sched/credit.c +++ b/xen/common/sched/credit.c @@ -2273,11 +2273,10 @@ csched_deinit(struct scheduler *ops) } } =20 -static const struct scheduler sched_credit_def =3D { +static const struct sched_ops sched_credit_def =3D { .name =3D "SMP Credit Scheduler", .opt_name =3D "credit", .sched_id =3D XEN_SCHEDULER_CREDIT, - .sched_data =3D NULL, =20 .global_init =3D csched_global_init, =20 @@ -2312,4 +2311,4 @@ static const struct scheduler sched_credit_def =3D { .move_timers =3D csched_move_timers, }; =20 -REGISTER_SCHEDULER(sched_credit_def); +REGISTER_SCHED_OPS(sched_credit_def); --=20 2.34.1 From nobody Thu Aug 13 09:24:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1785733663; cv=none; d=zohomail.com; s=zohoarc; b=YOG6fDdc2meeGBkDPX3OlT5BGs4mK4hkvIhcaoIRjbJLgyPyGURDFZw6uDC+hQir7MCza1E+B/OAW/+6Ik0z8MTCSu6iB3AToS/S7tOC8iv/GfiOfU7+bOmPJA45KlVzLYAJ4gQE8uu7MkQv2iz0F511QHe1otXdtf205mTviqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785733663; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CM+qUXy25CRFKkF1HaPx8PYdTauLZnNcJY3C0JI+/Dc=; b=kMBXldhG2l38IvdZleWnnGq2KQ056OZ7WytXHXSHrzJju7rojvp0FTvbfxcKid9PmZ0F9yLYMrObVl3rVK2l4aW1i2tul6WCU/Bq2PhWsNzzPPO4ntVKs9DPPFi1kgYFCrHmkIGYZJyD/rVK2o8+N2vQ/vWYul8wckzK9gQDvdE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1785733663318766.8635459660146; Sun, 2 Aug 2026 22:07:43 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1381103.1624682 (Exim 4.92) (envelope-from ) id 1wqktY-00034s-NP; Mon, 03 Aug 2026 05:07:24 +0000 Received: by outflank-mailman (output) from mailman id 1381103.1624682; Mon, 03 Aug 2026 05:07:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktY-00034h-Jp; Mon, 03 Aug 2026 05:07:24 +0000 Received: by outflank-mailman (input) for mailman id 1381103; Mon, 03 Aug 2026 05:07:23 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktX-00032f-Bx for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 05:07:23 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wqktW-006W8q-P2 for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 07:07:22 +0200 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a7021f1-2eae-0a2a0a5409dd-0a2a450aec7a-34 for ; Mon, 03 Aug 2026 07:07:22 +0200 Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a702209-f2d2-0a2a450a0019-d1558034b5d3-3 for ; Mon, 03 Aug 2026 07:07:21 +0200 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-49557167508so14758105e9.1 for ; Sun, 02 Aug 2026 22:07:21 -0700 (PDT) Received: from notebook.. ([78.173.117.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b917efsm310345185e9.11.2026.08.02.22.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 22:07:20 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785733641; x=1786338441; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CM+qUXy25CRFKkF1HaPx8PYdTauLZnNcJY3C0JI+/Dc=; b=TCB+1OEl9u/sNipcbKczY61o/1VCQ2cKvMu9vCsZxuZYjSCIC+lbD8uxSbSpA9hMkf C7RQvNNHKu1AeZr7jHTyvZ0GTYURSf5ewWYa40W3s/rvl0zZHrmfpRUpMcfk3T6qIJxS UzX283JLA7W1WpQ5ZGqvrKiFpJJlANnjnM/5bWXahjGJQpFHelDaDU+10i3Q0KtwFmeD XCDCORthkgSwR+UJZGrqJiuhFDGqYr6WCTeMIXZx5xkqbMYfcnIU13FQStaHIIo98LLG YvKwaXeNDJbk+yqv5oKVsQl1MQaA8WCQukDhTDGSgeqQ48uYdsOGE4ZfD2Tgel6ch8Jb pmxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785733641; x=1786338441; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CM+qUXy25CRFKkF1HaPx8PYdTauLZnNcJY3C0JI+/Dc=; b=Fi5ahYbfUudRk+xY9zKdsQ0TGMN478GrmrMx6lq/NEkpj79j07uuU0Hx7Uy/ne+1DL YH8CKQnaGUwR1P6HUQteaotZn5pP7uhnvkxDSSMfcUA/MjYhQQnEXBzEHHUwA1drh5Fe 4eZu6HG+lcnjVA7vUFZzlOyInGhKs75rFMdoCfsy/lCR1Wtcze9sWgHGEIPhgUm7TxMW Hh7neA1W2sECaUVKct+SqDNW3sWBRzgYiII3FgNjP4gloKKdZcQxMB6zEP6uya2UUHeS 1WdwePmLn9sLwo5URu9didSk6H6msYxZ2HtK2/hGvraFZMRVJOoo6QKBlWm09+B7NTIp fXeQ== X-Gm-Message-State: AOJu0YwYSU7n/hbCFNjkpvnZDMsooeCFb8MlOj5O+1HQUOBjeo3ZY5tU gfNGqZyo8J8NBJOXPGS5rc4EdoUX+NzktkvZiRUtyM8P/t2AQoECaX33pmuz3w== X-Gm-Gg: AR+sD10wWtpzyABgA4Jnl+/5ppJRow5vpdjy958Co3o8wtwM6j0Y6xILBUX+nlN3c7u sLMxRWd4GW9mgjrR+cLFajVryYHbu2yTuMoNYcjEdT98XAJxEg1gaW+/QODyAswv8D/KAxG9sO/ FaasbhF568aBSc/xZnkPykGkJAXhKBalS2G+YCD2qSXDLNdOl/S9CsfgjOl5s7tLRKZt8Q5ZZni M/XdGKgKeTAInx0lMjWXo2Cu6USCUfKxd0yq7Z83oIPzLHlZkwHdHPBV5K4qofDPrHgduTlCsKe uOemx92QnEe1v6hDL1CoWZxSK3o66xnqzDc/031W7CjRn3EgoZoW2lnOCyMvGNiVVV6HyQMLzjp mKUv2HpaBR0kyc7Rx0aWOnDtkdDFCqcrAJJWASRKCoHdirdv+KAwQG2c6PT6d197MKtFe6vTYB6 Nvs+i4JyHCYsANXWexr92N0TsrW1dgYPgPb+xiKeNGbFVuVRyypVkZ4NYqLSqI0mA= X-Received: by 2002:a05:600c:354a:b0:490:b8c0:d470 with SMTP id 5b1f17b1804b1-4980c67d71emr173613755e9.19.1785733640879; Sun, 02 Aug 2026 22:07:20 -0700 (PDT) From: Furkan Caliskan To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, jbeulich@suse.com, jgross@suse.com, gwd@xenproject.org, dfaggioli@suse.com, stewart.hildebrand@amd.com, nathan.studer@dornerworks.com, roger@xenproject.org, anthony.perard@vates.tech, julien@xen.org, sstabellini@kernel.org, michal.orzel@amd.com, bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, teddy.astie@vates.tech, tpearson@raptorengineering.com, alistair.francis@wdc.com, connojdavis@gmail.com, oleksii.kurochko@gmail.com, Furkan Caliskan Subject: [PATCH 3/7] xen/sched: credit2: migrate to new sched_ops Date: Mon, 3 Aug 2026 08:06:10 +0300 Message-Id: <20260803050614.5222-4-frn1furkan10@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260803050614.5222-1-frn1furkan10@gmail.com> References: <20260803050614.5222-1-frn1furkan10@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-4011c0/1785733641-518C5CFC-88A0B142/0/0 X-purgate-type: clean X-purgate-size: 1270 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1785733665141158500 Content-Type: text/plain; charset="utf-8" Declare sched_credit2_def as a struct sched_ops instead of a struct scheduler, dropping the .sched_data field, and register it with REGISTER_SCHED_OPS() so it is found through sched_ops_array[] instead of schedulers[]. This moves the credit2 scheduler onto the new sched_ops registration path. Signed-off-by: Furkan Caliskan --- xen/common/sched/credit2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c index 95946634d1..9bcc90004a 100644 --- a/xen/common/sched/credit2.c +++ b/xen/common/sched/credit2.c @@ -4230,11 +4230,10 @@ csched2_deinit(struct scheduler *ops) xfree(prv); } =20 -static const struct scheduler sched_credit2_def =3D { +static const struct sched_ops sched_credit2_def =3D { .name =3D "SMP Credit Scheduler rev2", .opt_name =3D "credit2", .sched_id =3D XEN_SCHEDULER_CREDIT2, - .sched_data =3D NULL, =20 .global_init =3D csched2_global_init, =20 @@ -4269,4 +4268,4 @@ static const struct scheduler sched_credit2_def =3D { .free_domdata =3D csched2_free_domdata, }; =20 -REGISTER_SCHEDULER(sched_credit2_def); +REGISTER_SCHED_OPS(sched_credit2_def); --=20 2.34.1 From nobody Thu Aug 13 09:24:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1785733665; cv=none; d=zohomail.com; s=zohoarc; b=R20QOEJNbJ1RGsEBkWfjLA0Z60JgREJxbR4ze/SF4rmM1R8IHNHn/yjHQgAami8G3jJK5EBoZkGWTsW7s5MOZ+TkSTY4CWxjCEIetAh/C2Uf2vhgpj58KUFBoH8l/Jtkdj90DRi8bVkWS031mRlojnl8na8L8AjY4eHkY+fNVwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785733665; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=21wuOD8HUjAVDqLCXgTFbv9BZRqUOWoQ8lloGzNNeyI=; b=A57ToCqzPyzH3eR9LZ4gCwz/JB3WF/nQHrti19SNg/q5YdRru6i24JpYReFIfYvxswjY30jEgghUgBLk4HY+GJTKyqlGqy1z3mq8SYg0/3hrGUJ7rhy9exRD/oCaa+FgS29zk9sRGDk/Sf3CAt4zWAYapoOfAwYcPSynJ+9rLvk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1785733665228914.7231840217304; Sun, 2 Aug 2026 22:07:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1381105.1624690 (Exim 4.92) (envelope-from ) id 1wqktc-0003Ly-0E; Mon, 03 Aug 2026 05:07:28 +0000 Received: by outflank-mailman (output) from mailman id 1381105.1624690; Mon, 03 Aug 2026 05:07:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktb-0003Lr-TR; Mon, 03 Aug 2026 05:07:27 +0000 Received: by outflank-mailman (input) for mailman id 1381105; Mon, 03 Aug 2026 05:07:26 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqkta-0003Jz-Rr for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 05:07:26 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wqkta-006WBT-8p for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 07:07:26 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a702204-e002-0a2a0a5209dd-0a2a4509bd80-24 for ; Mon, 03 Aug 2026 07:07:26 +0200 Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a70220e-be1a-0a2a45090019-d1558035bc4b-3 for ; Mon, 03 Aug 2026 07:07:26 +0200 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4921eed3fa2so8338955e9.0 for ; Sun, 02 Aug 2026 22:07:26 -0700 (PDT) Received: from notebook.. ([78.173.117.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b917efsm310345185e9.11.2026.08.02.22.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 22:07:25 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785733646; x=1786338446; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=21wuOD8HUjAVDqLCXgTFbv9BZRqUOWoQ8lloGzNNeyI=; b=W23IIMugZihv/E9MpUAS+BTshG2DONDxQU8e4HBIv7F9awZTjnUrciiIjKI3ytTOnN S0SjitHls5jaJ3iGwOoptFw48jeG+IFzMTJ3fNS4utYyMK301Qsdm2L+rTbuPkdpg2He 6mGb6YUZyMQb2vGgetwGTWEY5TK2CD8ql7twP7st9E1DhwQpQlKliJc8v3Dib8W/UXZy tYxstGgejFRbfeMVT7tdP24aTyxh8YC07bohejlLN34exn+XLfl5pRuumumHokirBeTS sOYUeRjQ+nSj+w+R0q2kw7CYY5z9grp1KPBFjl1Z1ivcHNvRx8eMjoJr1ftZY5nB3gB3 40mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785733646; x=1786338446; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=21wuOD8HUjAVDqLCXgTFbv9BZRqUOWoQ8lloGzNNeyI=; b=H6oHgdCZgrsk4H6axV3roDcSR8/qykmtAYGjLFZJCVaTntmtSdewUWGR1Sfc0rvV2a 8TNiVMkm1ls9e20kAZ8+emvtuQjD2nlc/26XS9kHkqxMryVOKtDnHgP+gmVCAync6Hg7 2tcUEz2hbpg5rvCuiSX/fITi+iYsHvhhDW6RHZlk8AF9iWvwhoXghntsuj2FLqTdNfrc XlxTJfSxxRO+5co28p4lsdsizPYq2V1Bals+b67D3kl4dtMgo4hYJA+CvfBAtQzsoxIi uHlVAu7krYkeKjmf69ZXBVQIhmcWqnnQ10kAvHFiRO4AyQAlQtNbnxAohgONlktxDgql ns+Q== X-Gm-Message-State: AOJu0YysNBoDhQ6/kWHS+H9elxYcqZs47xGn4j3EJkCn1uODDuo4+5Wk 3hWyPN3BpunpOA1T4y40QXkDAI7gG7wTWIh2k6C+zVDW7fYrs+zDQnX4WCl0fw== X-Gm-Gg: AR+sD13NVLoLS3Axl+d/RuimuCzfkWglb0hAOt/C604Hr9ndJUgY8Tuk0Vr4Lv4KROJ mjqsnV7OrewQxl3O+wofqVpjIn+NcIiVUVsfwWzHtJa/+Rjk41ntLvPrFFt4oybv9nuooi8LyTA V08aIKfwbRnT5hsdbPboAKyOl70PusSAmOSQ5LjAlO2RXnSmgdvGVYy3j0yuqjcj2RtuzX0o/9A WjuPdNZyRLzHmukNf+mGjpagRRLrvBk3ybJ/FtxmHWjdV+NdDF9xm+6+tfIMdFLVaLCbWFSFpOw Cre4nIF/FECs/gDUsT1Y/8IE60Ne6+mwmUTvnlugFZUPyr0kgx0RjgoWADEvko4bOpKh37TAmp9 osE9ITBLFAp6rdaEMIbVd1KiuDUeTLeuXiJl2at4yrSVSxYSt57Xtlx2uXAVBJF4M7bIu2R3TOH 7M9xgBLtauuGnMZxlnTqRDhDdTfLDVRd4JxvUl3jpI/Vfbbh6JIK4HZLN9pew6+w== X-Received: by 2002:a05:600d:8498:20b0:497:fecd:5b00 with SMTP id 5b1f17b1804b1-4980c673230mr145973255e9.9.1785733645587; Sun, 02 Aug 2026 22:07:25 -0700 (PDT) From: Furkan Caliskan To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, jbeulich@suse.com, jgross@suse.com, gwd@xenproject.org, dfaggioli@suse.com, stewart.hildebrand@amd.com, nathan.studer@dornerworks.com, roger@xenproject.org, anthony.perard@vates.tech, julien@xen.org, sstabellini@kernel.org, michal.orzel@amd.com, bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, teddy.astie@vates.tech, tpearson@raptorengineering.com, alistair.francis@wdc.com, connojdavis@gmail.com, oleksii.kurochko@gmail.com, Furkan Caliskan Subject: [PATCH 4/7] xen/sched: rtds: migrate to new sched_ops Date: Mon, 3 Aug 2026 08:06:11 +0300 Message-Id: <20260803050614.5222-5-frn1furkan10@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260803050614.5222-1-frn1furkan10@gmail.com> References: <20260803050614.5222-1-frn1furkan10@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-bad1c0/1785733646-FDC6D034-B5E3BD18/0/0 X-purgate-type: clean X-purgate-size: 1259 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1785733667130158500 Content-Type: text/plain; charset="utf-8" Declare sched_rtds_def as a struct sched_ops instead of a struct scheduler, dropping the .sched_data field, and register it with REGISTER_SCHED_OPS() so it is found through sched_ops_array[] instead of schedulers[]. This moves the rtds scheduler onto the new sched_ops registration path. Signed-off-by: Furkan Caliskan --- xen/common/sched/rt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c index 744f214173..8b4f05e2d1 100644 --- a/xen/common/sched/rt.c +++ b/xen/common/sched/rt.c @@ -1617,11 +1617,10 @@ static void cf_check repl_timer_handler(void *data) spin_unlock_irq(&prv->lock); } =20 -static const struct scheduler sched_rtds_def =3D { +static const struct sched_ops sched_rtds_def =3D { .name =3D "SMP RTDS Scheduler", .opt_name =3D "rtds", .sched_id =3D XEN_SCHEDULER_RTDS, - .sched_data =3D NULL, =20 .dump_cpu_state =3D rt_dump_pcpu, .dump_settings =3D rt_dump, @@ -1646,4 +1645,4 @@ static const struct scheduler sched_rtds_def =3D { .move_timers =3D rt_move_timers, }; =20 -REGISTER_SCHEDULER(sched_rtds_def); +REGISTER_SCHED_OPS(sched_rtds_def); --=20 2.34.1 From nobody Thu Aug 13 09:24:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1785733675; cv=none; d=zohomail.com; s=zohoarc; b=AFKrD1BobFbgyzwBfkbhQg4ZeOXdvBKQWl/QVxCbuDKbu5vmHCAgQ7tfMnMgirxO48+sD79te3A7APyw7iN8S9n0lwiocHipEBIlsOXRa3+EdJyxgdpRCCDu11HwkG8qKh/mCdOWFtWY9LYgTl1TzNsqUNhe9swZB5aA/7trANg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785733675; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JMMpBw4vbiYd/isxZEkW0aMhzAaKpMobKqilYthaK3Q=; b=FIux/oFbmSfTZYYd5ECbatGIEF79fWzxgcP9fmqsD/e+3xc+OqBKN2c8TsXQu3XwrBV0B8I2CcyYbyvNXGzlbe5VJBYlEXCtxMFNZuvOda6auuE0dRu4R1zB6TwCr4yCet6S/13RUYCdbN0cZPwVoEArSEUljQRIWpmIU+dURgg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1785733675005266.8160197561426; Sun, 2 Aug 2026 22:07:55 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1381107.1624700 (Exim 4.92) (envelope-from ) id 1wqktg-0003mE-6J; Mon, 03 Aug 2026 05:07:32 +0000 Received: by outflank-mailman (output) from mailman id 1381107.1624700; Mon, 03 Aug 2026 05:07:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktg-0003m5-3J; Mon, 03 Aug 2026 05:07:32 +0000 Received: by outflank-mailman (input) for mailman id 1381107; Mon, 03 Aug 2026 05:07:31 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktf-0003fS-4Y for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 05:07:31 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wqkte-00DMN1-Hk for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 07:07:30 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a702203-bab6-0a2a0a5309dd-0a2a450b8eae-44 for ; Mon, 03 Aug 2026 07:07:30 +0200 Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a702212-b7e8-0a2a450b0019-d1558034e9ac-3 for ; Mon, 03 Aug 2026 07:07:30 +0200 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4955de8797cso9107745e9.3 for ; Sun, 02 Aug 2026 22:07:30 -0700 (PDT) Received: from notebook.. ([78.173.117.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b917efsm310345185e9.11.2026.08.02.22.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 22:07:29 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785733650; x=1786338450; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=JMMpBw4vbiYd/isxZEkW0aMhzAaKpMobKqilYthaK3Q=; b=Wp06fp7foYAnABLEJc4NYwHmXkWBaExspDvCGo4STNyI6Tf8//6mewsVoCIMZn9bFm NQHJg/VFr2XVPQdKPrOclQrQIiqp7BixscQAS0eYURiFTv00ZGHrab/r3KJIbmVVlAFg wN5RTLVk6rhyGnvRjjkwZxeF2msgaAwHML3QWOQ+E+NmDVsiWr/a0J0q5maq2EfL0+XL HRdLLinvJPmowhPUt/Ixxu4Jgvqu97BD1RoG8qFDqGWgMh5B4cyO/QjC4mm4/n3KwMvN al5GvX0AnFc+A0xHN2alfvrEdCSz75Lc+ZshthfjmNxX85SEo4mTkHczDmdnbooy9Wr5 9daQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785733650; x=1786338450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=JMMpBw4vbiYd/isxZEkW0aMhzAaKpMobKqilYthaK3Q=; b=J2DHJ5nJNcsuQ7WPmDVjO3I1+/wi0ee5GmwNpC41pRUuIEmskffz+gMyLbzaL9JyFN /IYwqSrmyeUrOeklk2BYNd06xYaHKqdBwlAS9iSFohF1zSmEfpifXXyBGB1kXx3Fg6SO eiLSPXokXGgontFm8L8GUTwHHek6y+SE3ZYIJVMxhqGDg5lwkboOUYz5YgKkYmir+bNp DWZsoGcHkqDscG0jDjCpHu+56dHfvx4j3H6RP4DbEJUbETBxJaanDicuX6jGAVh4uic+ ymETxyks/hdL3jawjxt7O4fHGVuHZIz5gbVfDHWcah/AmDWceIHe/uVrCvEEghuIuC3+ Mhcw== X-Gm-Message-State: AOJu0Ywftkr+24lSEORak2pvgnutdQOb0UILBO/THiyk6WH3vS93ZYfp 6lLJtNfNOs+45O12X1MGrg1jS+EcLz3zxdUdPMRrsYofUDuyvg6T/5cgJcoQig== X-Gm-Gg: AR+sD10d+tkzIz7FUfNLEyV+NgiNVZ3DgfuFrxUtv8btQDCXyvDWdfJYTUp/+rcffi8 5AnNReXsa7Q4Oq2Bnhfh71np9omhVPoOhnWoNgAOhtvmcNR1/p3UhSAYEn7eG8uE8BXc2Mo/Xt/ sL3Q62cU233aVS1HeU0iej5tDkXYr8eWA5VzCmdQp+MzjXnKxIiL34z7O1LD6DEXoqnU16DyOne IEkkjSpRCbbTVlhPgeW1Blclvm02y0+XuHcyZ90M9iDE3wud4fxjc4zVS6TXPxFvg2BiQ6xUswg Mb4Q0b/tX8fRy44Bgco+7S4dbOhYbiPnOsmvd/VV7TRHUHeCSko8SM4NNyN8mEAZUE/non9FX5S yXD17u+Bs2Pf4zWDcXgUazJe0Xd1TSgKA3GLxqS4VYMzLEqGkv8nd+Sxqxa5NgEK1W+2sNaxTMk w6Og8Th/Si64l7Slvb9XvDJxpdPsDgDn9k9zwrd/zFjKaueUtu8gApLfu76WYhRw== X-Received: by 2002:a05:600c:3488:b0:493:e6f7:ad75 with SMTP id 5b1f17b1804b1-4980c653e15mr179910915e9.11.1785733649963; Sun, 02 Aug 2026 22:07:29 -0700 (PDT) From: Furkan Caliskan To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, jbeulich@suse.com, jgross@suse.com, gwd@xenproject.org, dfaggioli@suse.com, stewart.hildebrand@amd.com, nathan.studer@dornerworks.com, roger@xenproject.org, anthony.perard@vates.tech, julien@xen.org, sstabellini@kernel.org, michal.orzel@amd.com, bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, teddy.astie@vates.tech, tpearson@raptorengineering.com, alistair.francis@wdc.com, connojdavis@gmail.com, oleksii.kurochko@gmail.com, Furkan Caliskan Subject: [PATCH 5/7] xen/sched: arinc653: migrate to new sched_ops Date: Mon, 3 Aug 2026 08:06:12 +0300 Message-Id: <20260803050614.5222-6-frn1furkan10@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260803050614.5222-1-frn1furkan10@gmail.com> References: <20260803050614.5222-1-frn1furkan10@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1785733650-1B8D19EA-0CF7C641/0/0 X-purgate-type: clean X-purgate-size: 1571 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1785733675344158500 Content-Type: text/plain; charset="utf-8" Declare sched_arinc653_def as a struct sched_ops instead of a struct scheduler, dropping the .sched_data field, and register it with REGISTER_SCHED_OPS() so it is found through sched_ops_array[] instead of schedulers[]. This moves the arinc653 scheduler onto the new sched_ops registration path. Signed-off-by: Furkan Caliskan --- xen/common/sched/arinc653.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c index 32c596a23c..efcaa44089 100644 --- a/xen/common/sched/arinc653.c +++ b/xen/common/sched/arinc653.c @@ -702,17 +702,10 @@ a653sched_adjust_global(const struct scheduler *ops, } #endif /* CONFIG_SYSCTL */ =20 -/** - * This structure defines our scheduler for Xen. - * The entries tell Xen where to find our scheduler-specific - * callback functions. - * The symbol must be visible to the rest of Xen at link time. - */ -static const struct scheduler sched_arinc653_def =3D { +static const struct sched_ops sched_arinc653_def =3D { .name =3D "ARINC 653 Scheduler", .opt_name =3D "arinc653", .sched_id =3D XEN_SCHEDULER_ARINC653, - .sched_data =3D NULL, =20 .init =3D a653sched_init, .deinit =3D a653sched_deinit, @@ -743,7 +736,7 @@ static const struct scheduler sched_arinc653_def =3D { .dump_cpu_state =3D NULL, }; =20 -REGISTER_SCHEDULER(sched_arinc653_def); +REGISTER_SCHED_OPS(sched_arinc653_def); =20 /* * Local variables: --=20 2.34.1 From nobody Thu Aug 13 09:24:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1785733733; cv=none; d=zohomail.com; s=zohoarc; b=JV3CTs38QzLnMIv1RPOdpgXpkQbTSnSosVHRuMhnVgudemEpfI618bcgaFXkQwDNOxNMxE5DUDgjjCnHzoEi3IBZIly0+J1SPF20xmkOuBc6oO7YKhqyPm6tYs7arPyXt38T0LJcFTCqtAQEVcrlxwxldrVhn0Ejl3mu9hUD89Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785733733; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=V6MENfzpjRK8Go/oREv4Ua4C28lp8j5eDhquh247IHI=; b=oISZehY9xy9MJ0ZUhECI/tL9Ak0oLn9GFIZYI4iAjaQxwp42NZnLhJS5U1T348CiOAg36yzrTGP509e8cF5w9Z4dEC2zgskBGEClD5y70bxOXTn7smAtl6KNnl2vii+Vtz4MuiVccQO628D14q+QPqaZz54f/qI9Xy4Mxni+W88= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 178573373332766.85337985597903; Sun, 2 Aug 2026 22:08:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1381153.1624718 (Exim 4.92) (envelope-from ) id 1wqkuj-0006JV-RV; Mon, 03 Aug 2026 05:08:37 +0000 Received: by outflank-mailman (output) from mailman id 1381153.1624718; Mon, 03 Aug 2026 05:08:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqkuj-0006JM-Oo; Mon, 03 Aug 2026 05:08:37 +0000 Received: by outflank-mailman (input) for mailman id 1381153; Mon, 03 Aug 2026 05:08:37 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqkuj-0006JC-7e for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 05:08:37 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wqkui-00Dbdy-KR for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 07:08:36 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a702231-bab6-0a2a0a5309dd-0a2a4502e77e-34 for ; Mon, 03 Aug 2026 07:08:36 +0200 Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a702218-6ca4-0a2a45020019-d1558030c85d-3 for ; Mon, 03 Aug 2026 07:07:36 +0200 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4956869750eso9792965e9.2 for ; Sun, 02 Aug 2026 22:07:36 -0700 (PDT) Received: from notebook.. ([78.173.117.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b917efsm310345185e9.11.2026.08.02.22.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 22:07:35 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785733656; x=1786338456; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=V6MENfzpjRK8Go/oREv4Ua4C28lp8j5eDhquh247IHI=; b=i41N1IpN0Z9IJSaLvE/8GYPpXT/XvvfNg8xaQinM5VqeJSOVqNfO+EcoekSzHmOQVt xSseD0QqkF4Cp47yp8ExeX/kN6rpv0sElVHhNabXkqSw7BoyuCf4r7oU/z2HjsRUCJe7 cxqryWYe4VAIWiRDiR/J1buM4MU5V7BnZ4rNY7IkrrNPUHUhfgcd04+cXL4Hd6WNw1pV ZWec+hQCLJHN2ORGGmoxVIVT7hT+ddecyhfrsWYbOaBkeNPOQ8oNGjVVtLZitCO/nj6X h3YRlMMUJPJ+szQ91DR9JnO8dLjkeJljlZ8GcvHTy1UHtAdSPB9xkiMOmdLzkpFGznzr qjSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785733656; x=1786338456; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=V6MENfzpjRK8Go/oREv4Ua4C28lp8j5eDhquh247IHI=; b=TOLtUlTQYR9cmjfTctILigprQJiyydl9Ix4RMkLVQKTFhL7/Cva9wAMT7ZQigInnT5 nmvGRBtNQOZnm3O7S0/skAOX48VVzsqnsFk5n1QIE0PHN/xeGCvcmzgquLcuP1S6q6jq PHiTFo+xdfUJ40IyPcGPOJu+u0rH3mYS7L3K0kEzDx3bdcfscQxSSmYizs3w2SybKRVg Pu+SNBUfPuE6wUtY2EWP+KaspMS83fQwrJ/gvYK2eq5c7zBBW3y8FEEd1tCjsGBXsNAT RS9j5ArWYi3BqxkcUmEAY9lCbdjOOFAsjxk+viDH1g3yHe8/RcHZ2sY11HgCuEr0hCmO 1I/A== X-Gm-Message-State: AOJu0Yw5buLPzuADYNh+TI71tAUvkq9wP2QqPrbLlkRUCcRq0Z5G2m4a rM900uVKxUjZoI/jKy6qs/v7QwCP2d/YSYBv+94HnBeXvJ24hsO4QyuEaXUtaQ== X-Gm-Gg: AR+sD13ioTfCJEMjRb8hkWhKhav6RM2eVVPPEMuJIOtJEwa5uPDbYw1DFmCX7nzk3O4 Nca0SNIAVkWp+A1YT5RxXb7GwvChT9TgBUHdg+8+L1zBZCeJdnrr18h7keZ9juv3p4Ie5wDstpD aTVCLM1mNdpBDU0xNd3ULiAd1c2kyp0wCBBWtignRc1mhKYJwdHsfDdSe47QctuZitXd7TwgCgW eboz1K3sgpMkfxdj6D0Z2ma2KTClcztMmf2R4sQPXdU6x7owjkvQtxjjvAuRiN2/3+E6Kl+kAFU +waKzdvKLgnAQKDZatx7Ws+e433+4+Tga6ddebxJpKvoVR5xJHPb6JBZLDpK2Ib3t1GuGrHBdfx 2OQpyqKNazOYOdE8R63XnkbIo5sq4zOO1rn/dI6vFXCps8aN9IrzwTB637neASoJg5syxw4Z86R W1yP4NN0Cyf449HfYpKT9hAWd1BwvrvOwsM7s/8mSvA0GaHeuaTDurFrWpL7kwyYZJJgcj463+ X-Received: by 2002:a05:600c:548d:b0:495:6134:6d61 with SMTP id 5b1f17b1804b1-4980c674de0mr196641985e9.19.1785733656026; Sun, 02 Aug 2026 22:07:36 -0700 (PDT) From: Furkan Caliskan To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, jbeulich@suse.com, jgross@suse.com, gwd@xenproject.org, dfaggioli@suse.com, stewart.hildebrand@amd.com, nathan.studer@dornerworks.com, roger@xenproject.org, anthony.perard@vates.tech, julien@xen.org, sstabellini@kernel.org, michal.orzel@amd.com, bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, teddy.astie@vates.tech, tpearson@raptorengineering.com, alistair.francis@wdc.com, connojdavis@gmail.com, oleksii.kurochko@gmail.com, Furkan Caliskan Subject: [PATCH 6/7] xen/sched: null: migrate to new sched_ops Date: Mon, 3 Aug 2026 08:06:13 +0300 Message-Id: <20260803050614.5222-7-frn1furkan10@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260803050614.5222-1-frn1furkan10@gmail.com> References: <20260803050614.5222-1-frn1furkan10@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1785733656-F1CAA2AC-CC47DECB/0/0 X-purgate-type: clean X-purgate-size: 1283 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1785733735387158500 Content-Type: text/plain; charset="utf-8" Declare sched_null_def as a struct sched_ops instead of a struct scheduler, dropping the .sched_data field, and register it with REGISTER_SCHED_OPS() so it is found through sched_ops_array[] instead of schedulers[]. This moves the null scheduler onto the new sched_ops registration path. Signed-off-by: Furkan Caliskan --- xen/common/sched/null.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c index 952bb47444..5194c8216c 100644 --- a/xen/common/sched/null.c +++ b/xen/common/sched/null.c @@ -1037,11 +1037,10 @@ static void cf_check null_dump(const struct schedul= er *ops) spin_unlock_irqrestore(&prv->lock, flags); } =20 -static const struct scheduler sched_null_def =3D { +static const struct sched_ops sched_null_def =3D { .name =3D "null Scheduler", .opt_name =3D "null", .sched_id =3D XEN_SCHEDULER_NULL, - .sched_data =3D NULL, =20 .init =3D null_init, .deinit =3D null_deinit, @@ -1068,4 +1067,4 @@ static const struct scheduler sched_null_def =3D { .dump_settings =3D null_dump, }; =20 -REGISTER_SCHEDULER(sched_null_def); +REGISTER_SCHED_OPS(sched_null_def); --=20 2.34.1 From nobody Thu Aug 13 09:24:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1785733680; cv=none; d=zohomail.com; s=zohoarc; b=RQvyCl1h7IcyAS6cVWXeSD32vYjlX63dXn7uOPMdDM21/hT1hf3nOWvXs3OhI5vxwNsowWvUhAAn0JewSQzbeKL2goO8rHUxeXrkPJTj8Rz5ZwK6/UiIyJ5a2kn94t6l6OQSyRZD4hDDmbIuuGUR9yShvJ5HVwyFGCo67KQXsNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785733680; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Dfo9WveiLxrAqqO79sjLeKOkwe8r7c3VXRClpdMKLaI=; b=hJ8S0Q91n2PLdFsvdPofOrD18Kg98zobuQnqC4RLbiXsoG2yYJMe/mzzQ7c+LF/lCs3nY+ZBjiD9qIMv+FzmMElxBnW9n5BrXTxQppfLxOHpRpCJVsegdrfRaeMDj+itxUotPELN/og2MyZkHR8Y1/Aj50P4CoSxPBGLumkaJRI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1785733680432726.203493597897; Sun, 2 Aug 2026 22:08:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1381131.1624709 (Exim 4.92) (envelope-from ) id 1wqktu-0005Mh-EJ; Mon, 03 Aug 2026 05:07:46 +0000 Received: by outflank-mailman (output) from mailman id 1381131.1624709; Mon, 03 Aug 2026 05:07:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqktu-0005Ll-BI; Mon, 03 Aug 2026 05:07:46 +0000 Received: by outflank-mailman (input) for mailman id 1381131; Mon, 03 Aug 2026 05:07:44 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wqkts-0005Gb-Lx for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 05:07:44 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wqkts-003lut-2o for xen-devel@lists.xenproject.org; Mon, 03 Aug 2026 07:07:44 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a702215-2eae-0a2a0a5409dd-0a2a45028d14-18 for ; Mon, 03 Aug 2026 07:07:44 +0200 Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a70221f-6ca4-0a2a45020019-d1558034ccc0-3 for ; Mon, 03 Aug 2026 07:07:43 +0200 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4955aa106b1so15227285e9.0 for ; Sun, 02 Aug 2026 22:07:43 -0700 (PDT) Received: from notebook.. ([78.173.117.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b917efsm310345185e9.11.2026.08.02.22.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 22:07:42 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785733663; x=1786338463; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Dfo9WveiLxrAqqO79sjLeKOkwe8r7c3VXRClpdMKLaI=; b=WnxsgV08P7pAvLdbzi4gu2aO28A/JQqERE42GrWvurPzt1MRNFhXrWPd179i44dp39 GP/QTO1QU2dMnO6cqsTCl+sbZnm1IW4SmwRkEXLPTDAQffANuDjMNn4DRJR/PsChQPi6 X/ZfRbik6/ahzjhKWw7qkKeLB81KOK6Kh3mV302zJOMB1eK6c8f+ShgwPFt0+A6bqpwz asov8DtioNL4tH6dCN7+O8DuzfpqY89a33Ld6b9m9OgpI4c25F27uO29ygx0ffWAmJGP ib2o6qsSR10zdQ1OzY/bVk8AtTUuWVjLo1pv9j/O21usoLk00JTLVFUTygDrzbgUfl4h dyVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785733663; x=1786338463; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Dfo9WveiLxrAqqO79sjLeKOkwe8r7c3VXRClpdMKLaI=; b=BHB4UvxOXoezvnogpZjXoeuGBae0dyiMr9j6SjEPBe6dc4rmzm3Crk/JSxR6OWIiBD V560phCi7MujTWFZNdMUYeuSFJx8icu4Uzgws7p/G+nqZNDRNQhuxnnXL3eTP9zEjwl2 sHkugO3B9EWoR0U8QZtctW8W7Aa23AKiJIaoLFOrnt1vCPsceSfjqbIgVcszhbsXU2dr 2IAzFV2lKzvlwolFoj+LciNkKB9speTTju6Gl3VxCkFuWbwbRQZtzpsvGyfs/g78A/X1 t2jzyQGwxvpM2lJyVRJcnZOsNjYB1TKKNNg1BHD02ljcLjoq4hSvG7yhlaarrbc78hx0 Bi6g== X-Gm-Message-State: AOJu0Yzpo2IBp14364b0Cy8P4uJds3/WhzqDLWaKhFMMaViHfABw+sZO YSHfZaZbWUVeCvftd/UgRtIquJzVtN/bpm0sw4Ef4j8yU1G6lN3shaCzmRWKkQ== X-Gm-Gg: AR+sD1292SEmgbWgb49iGWx5xy9mfyDPIFYySsqFy6WYPYYr+gZUkNDNdmU0fMjIcEY 0rhBqeQC4E6NmEAxFwdBGGSZjzrF/cwk22o6APdw2qnWxJ+Ofn614+Dq7ZH6p5wgY7cczliAsYg Nlwlun3tzKy5KlHP5g5zNQNAmF11g3I+JhLPEPpxqM21ZcXVTLOPBrkOWU6cnosDmGhRmwuNqhO pVHelQGsVaJLkAOxS3TopyD1TT7IAtha8yb4AnvNfs2nmAbSM/5CQx8JzMQhq5/T9Q5U9WF4n3z 4/ElqbEaCJR8eKMMz/pI7b4I9inqff3htCZBqcd2MaivFKHsqH2WDuz8mtQNuBFh+Kfh3KOk8PV XT5+AxJpaG/LAs5TO5wqBZh24bcPpyAqfsK6Jq3b2U9WCl5SYh9XJ89Veb4Nu0hV7kDYuuWEIMm GlUxAR2Qopzo6WOY6xSIJ6dUMvxSseIVz2JxjvkZxB3ycNWrYoYE6iizjAkxWJtg== X-Received: by 2002:a05:600c:8b14:b0:495:4cb8:42b9 with SMTP id 5b1f17b1804b1-4980c66d8cemr193280875e9.4.1785733663338; Sun, 02 Aug 2026 22:07:43 -0700 (PDT) From: Furkan Caliskan To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, jbeulich@suse.com, jgross@suse.com, gwd@xenproject.org, dfaggioli@suse.com, stewart.hildebrand@amd.com, nathan.studer@dornerworks.com, roger@xenproject.org, anthony.perard@vates.tech, julien@xen.org, sstabellini@kernel.org, michal.orzel@amd.com, bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, teddy.astie@vates.tech, tpearson@raptorengineering.com, alistair.francis@wdc.com, connojdavis@gmail.com, oleksii.kurochko@gmail.com, Furkan Caliskan Subject: [PATCH 7/7] xen/sched: remove old scheduler registration, shrink struct scheduler Date: Mon, 3 Aug 2026 08:06:14 +0300 Message-Id: <20260803050614.5222-8-frn1furkan10@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260803050614.5222-1-frn1furkan10@gmail.com> References: <20260803050614.5222-1-frn1furkan10@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1785733664-662A92AC-64EF8C7C/0/0 X-purgate-type: clean X-purgate-size: 25587 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1785733681437158500 Content-Type: text/plain; charset="utf-8" Every in-tree scheduler now registers through sched_ops instead of the original struct-scheduler-as-vtable path, so schedulers[], REGISTER_SCHEDULER() and NUM_SCHEDULERS have no remaining users. Remove them and finish the change struct sched_ops was introduced for: struct scheduler is shrunk down to just its per-cpupool fields - a pointer to a shared sched_ops, plus sched_data and cpupool. scheduler_alloc() now stores a pointer to the matching sched_ops instance instead of copying every field into a fresh allocation. Cpupools sharing a scheduler type now share one dispatch table instead of each holding a private copy of it. Every accessor in private.h is updated from s->field to s->ops->field to match. sched_idle_ops is split the same way every other scheduler was. A handful of call sites elsewhere read a scheduler's name, opt_name or sched_id directly and are updated to go through ->ops as well. Signed-off-by: Furkan Caliskan --- xen/arch/arm/xen.lds.S | 1 - xen/arch/ppc/xen.lds.S | 1 - xen/arch/riscv/xen.lds.S | 1 - xen/arch/x86/xen.lds.S | 1 - xen/common/sched/core.c | 144 +++++----------------------------- xen/common/sched/cpupool.c | 6 +- xen/common/sched/private.h | 155 ++++++++++--------------------------- xen/include/xen/xen.lds.h | 6 -- 8 files changed, 67 insertions(+), 248 deletions(-) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 9a63fa36a0..07bf875599 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -93,7 +93,6 @@ SECTIONS .data : { /* Data */ *(.data.page_aligned) =20 - SCHEDULER_ARRAY SCHED_OPS_ARRAY HYPFS_PARAM =20 diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S index da8f73d85b..1f4e200693 100644 --- a/xen/arch/ppc/xen.lds.S +++ b/xen/arch/ppc/xen.lds.S @@ -84,7 +84,6 @@ SECTIONS DECL_SECTION(.data) { /* Data */ *(.data.page_aligned) =20 - SCHEDULER_ARRAY SCHED_OPS_ARRAY HYPFS_PARAM =20 diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 01f202e504..97f2db1dfd 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -89,7 +89,6 @@ SECTIONS .data : { /* Data */ *(.data.page_aligned) =20 - SCHEDULER_ARRAY SCHED_OPS_ARRAY HYPFS_PARAM =20 diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index d128a30440..0f506ff1f6 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -306,7 +306,6 @@ SECTIONS DECL_SECTION(.data.read_mostly) { *(.data.read_mostly) =20 - SCHEDULER_ARRAY SCHED_OPS_ARRAY HYPFS_PARAM } PHDR(text) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index fb2d1d5314..4e5f78e84d 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -87,10 +87,6 @@ DEFINE_PER_CPU(cpumask_t, cpumask_scratch); /* How many urgent vcpus. */ DEFINE_PER_CPU(atomic_t, sched_urgent_count); =20 -extern const struct scheduler *__start_schedulers_array[], *__end_schedule= rs_array[]; -#define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array) -#define schedulers __start_schedulers_array - extern const struct sched_ops *__start_sched_ops_array[], *__end_sched_ops= _array[]; #define NUM_SCHED_OPS (__end_sched_ops_array - __start_sched_ops_array) #define sched_ops_array __start_sched_ops_array @@ -103,42 +99,6 @@ static void sched_set_affinity( struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft); =20 =20 -static void sched_ops_to_scheduler( - struct scheduler *sched, const struct sched_ops *ops) -{ - sched->name =3D ops->name; - sched->opt_name =3D ops->opt_name; - sched->sched_id =3D ops->sched_id; - sched->global_init =3D ops->global_init; - sched->init =3D ops->init; - sched->deinit =3D ops->deinit; - sched->free_udata =3D ops->free_udata; - sched->alloc_udata =3D ops->alloc_udata; - sched->free_pdata =3D ops->free_pdata; - sched->alloc_pdata =3D ops->alloc_pdata; - sched->deinit_pdata =3D ops->deinit_pdata; - sched->alloc_domdata =3D ops->alloc_domdata; - sched->free_domdata =3D ops->free_domdata; - sched->switch_sched =3D ops->switch_sched; - sched->insert_unit =3D ops->insert_unit; - sched->remove_unit =3D ops->remove_unit; - sched->sleep =3D ops->sleep; - sched->wake =3D ops->wake; - sched->yield =3D ops->yield; - sched->context_saved =3D ops->context_saved; - sched->do_schedule =3D ops->do_schedule; - sched->pick_resource =3D ops->pick_resource; - sched->migrate =3D ops->migrate; - sched->adjust =3D ops->adjust; - sched->adjust_affinity =3D ops->adjust_affinity; -#ifdef CONFIG_SYSCTL - sched->adjust_global =3D ops->adjust_global; -#endif - sched->dump_settings =3D ops->dump_settings; - sched->dump_cpu_state =3D ops->dump_cpu_state; - sched->move_timers =3D ops->move_timers; -} - static struct sched_resource *cf_check sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *= unit) { @@ -168,10 +128,9 @@ static void cf_check sched_idle_schedule( unit->next_task =3D sched_idle_unit(cpu); } =20 -static struct scheduler sched_idle_ops =3D { +static struct sched_ops sched_idle_sched_ops =3D { .name =3D "Idle Scheduler", .opt_name =3D "idle", - .sched_data =3D NULL, =20 .pick_resource =3D sched_idle_res_pick, .do_schedule =3D sched_idle_schedule, @@ -180,6 +139,11 @@ static struct scheduler sched_idle_ops =3D { .free_udata =3D sched_idle_free_udata, }; =20 +static struct scheduler sched_idle_ops =3D { + .ops =3D &sched_idle_sched_ops, + .sched_data =3D NULL, +}; + static inline struct vcpu *unit2vcpu_cpu(const struct sched_unit *unit, unsigned int cpu) { @@ -2122,7 +2086,7 @@ long do_set_timer_op(s_time_t timeout) /* scheduler_id - fetch ID of current scheduler */ int scheduler_id(void) { - return operations.sched_id; + return operations.ops->sched_id; } #endif =20 @@ -2131,7 +2095,7 @@ long sched_adjust(struct domain *d, struct xen_domctl= _scheduler_op *op) { long ret; =20 - if ( op->sched_id !=3D dom_scheduler(d)->sched_id ) + if ( op->sched_id !=3D dom_scheduler(d)->ops->sched_id ) return -EINVAL; =20 switch ( op->cmd ) @@ -2177,7 +2141,7 @@ long sched_adjust_global(struct xen_sysctl_scheduler_= op *op) =20 rcu_read_lock(&sched_res_rculock); =20 - rc =3D ((op->sched_id =3D=3D pool->sched->sched_id) + rc =3D ((op->sched_id =3D=3D pool->sched->ops->sched_id) ? sched_adjust_cpupool(pool->sched, op) : -EINVAL); =20 rcu_read_unlock(&sched_res_rculock); @@ -2344,7 +2308,7 @@ static struct sched_unit *do_schedule(struct sched_un= it *prev, s_time_t now, struct sched_unit *next; =20 /* get policy-specific decision on scheduling... */ - sched->do_schedule(sched, prev, now, sched_tasklet_check(cpu)); + sched->ops->do_schedule(sched, prev, now, sched_tasklet_check(cpu)); =20 next =3D prev->next_task; =20 @@ -3033,18 +2997,6 @@ void scheduler_enable(void) scheduler_active =3D true; } =20 -static inline -const struct scheduler *__init sched_get_by_name(const char *sched_name) -{ - unsigned int i; - - for ( i =3D 0; i < NUM_SCHEDULERS; i++ ) - if ( schedulers[i] && !strcmp(schedulers[i]->opt_name, sched_name)= ) - return schedulers[i]; - - return NULL; -} - static inline const struct sched_ops *__init sched_ops_get_by_name(const char* sched_nam= e) { @@ -3058,13 +3010,7 @@ const struct sched_ops *__init sched_ops_get_by_name= (const char* sched_name) =20 int __init sched_get_id_by_name(const char *sched_name) { - const struct scheduler *scheduler =3D sched_get_by_name(sched_name); - const struct sched_ops *ops; - - if ( scheduler ) - return scheduler->sched_id; - - ops =3D sched_ops_get_by_name(sched_name); + const struct sched_ops *ops =3D sched_ops_get_by_name(sched_name); return ops ? ops->sched_id : -1; } =20 @@ -3072,40 +3018,11 @@ int __init sched_get_id_by_name(const char *sched_n= ame) void __init scheduler_init(void) { struct domain *idle_domain; - const struct scheduler *scheduler; const struct sched_ops *ops; int i; =20 scheduler_enable(); =20 - for ( i =3D 0; i < NUM_SCHEDULERS; i++) - { -#define sched_test_func(f) \ - if ( !schedulers[i]->f ) \ - { \ - printk("scheduler %s misses .%s, dropped\n", \ - schedulers[i]->opt_name, #f); \ - schedulers[i] =3D NULL; \ - } - - sched_test_func(init); - sched_test_func(deinit); - sched_test_func(pick_resource); - sched_test_func(alloc_udata); - sched_test_func(free_udata); - sched_test_func(switch_sched); - sched_test_func(do_schedule); - -#undef sched_test_func - - if ( schedulers[i]->global_init && schedulers[i]->global_init() < = 0 ) - { - printk("scheduler %s failed initialization, dropped\n", - schedulers[i]->opt_name); - schedulers[i] =3D NULL; - } - } - for ( i =3D 0; i < NUM_SCHED_OPS; i++) { #define sched_test_func(f) \ @@ -3134,30 +3051,22 @@ void __init scheduler_init(void) } } =20 - scheduler =3D sched_get_by_name(opt_sched); - ops =3D scheduler ? NULL : sched_ops_get_by_name(opt_sched); - if ( !scheduler && !ops ) + ops =3D sched_ops_get_by_name(opt_sched); + if ( !ops ) { printk("Could not find scheduler: %s\n", opt_sched); - scheduler =3D sched_get_by_name(CONFIG_SCHED_DEFAULT); - ops =3D scheduler ? NULL : sched_ops_get_by_name(CONFIG_SCHED_DEFA= ULT); - BUG_ON(!scheduler && !ops); - if ( scheduler ) - printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_na= me); - else - printk("Using '%s' (%s)\n", ops->name, ops->opt_name); + ops =3D sched_ops_get_by_name(CONFIG_SCHED_DEFAULT); + BUG_ON(!ops); + printk("Using '%s' (%s)\n", ops->name, ops->opt_name); } =20 - if ( scheduler ) - operations =3D *scheduler; - else - sched_ops_to_scheduler(&operations, ops); + operations.ops =3D ops; =20 if ( cpu_schedule_up(0) ) BUG(); register_cpu_notifier(&cpu_schedule_nfb); =20 - printk("Using scheduler: %s (%s)\n", operations.name, operations.opt_n= ame); + printk("Using scheduler: %s (%s)\n", operations.ops->name, operations.= ops->opt_name); if ( sched_init(&operations) ) panic("scheduler returned error on init\n"); =20 @@ -3507,28 +3416,17 @@ struct scheduler *scheduler_alloc(unsigned int sche= d_id) int ret; struct scheduler *sched; =20 - for ( i =3D 0; i < NUM_SCHEDULERS; i++ ) - if ( schedulers[i] && schedulers[i]->sched_id =3D=3D sched_id ) - goto found; - for ( i =3D 0; i < NUM_SCHED_OPS; i++ ) if ( sched_ops_array[i] && sched_ops_array[i]->sched_id =3D=3D sch= ed_id ) - goto found_new; + goto found; =20 return ERR_PTR(-ENOENT); =20 found: - if ( (sched =3D xmalloc(struct scheduler)) =3D=3D NULL ) - return ERR_PTR(-ENOMEM); - memcpy(sched, schedulers[i], sizeof(*sched)); - goto init; - - found_new: if ( (sched =3D xzalloc(struct scheduler)) =3D=3D NULL ) return ERR_PTR(-ENOMEM); - sched_ops_to_scheduler(sched, sched_ops_array[i]); + sched->ops =3D sched_ops_array[i]; =20 - init: if ( (ret =3D sched_init(sched)) !=3D 0 ) { xfree(sched); @@ -3559,7 +3457,7 @@ void schedule_dump(struct cpupool *c) { sched =3D c->sched; cpus =3D c->res_valid; - printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name); + printk("Scheduler: %s (%s)\n", sched->ops->name, sched->ops->opt_n= ame); sched_dump_settings(sched); } else diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index 081e1053eb..1c70b58409 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -338,7 +338,7 @@ static struct cpupool *cpupool_create(unsigned int pool= id, spin_unlock(&cpupool_lock); =20 debugtrace_printk("Created cpupool %u with scheduler %s (%s)\n", - c->cpupool_id, c->sched->name, c->sched->opt_name); + c->cpupool_id, c->sched->ops->name, c->sched->ops->o= pt_name); =20 return c; =20 @@ -862,7 +862,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) if ( c =3D=3D NULL ) break; op->cpupool_id =3D c->cpupool_id; - op->sched_id =3D c->sched->sched_id; + op->sched_id =3D c->sched->ops->sched_id; op->n_dom =3D c->n_dom; ret =3D cpumask_to_xenctl_bitmap(&op->cpumap, c->cpu_valid); cpupool_put(c); @@ -1294,7 +1294,7 @@ struct cpupool *__init cpupool_create_pool(unsigned i= nt pool_id, int sched_id) struct cpupool *pool; =20 if ( sched_id < 0 ) - sched_id =3D scheduler_get_default()->sched_id; + sched_id =3D scheduler_get_default()->ops->sched_id; =20 pool =3D cpupool_create(pool_id, sched_id); =20 diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index 4dd5c99b87..c03063befe 100644 --- a/xen/common/sched/private.h +++ b/xen/common/sched/private.h @@ -365,198 +365,132 @@ struct sched_ops { }; =20 struct scheduler { - const char *name; /* full name for this scheduler */ - const char *opt_name; /* option name for this scheduler */ - unsigned int sched_id; /* ID for this scheduler */ - void *sched_data; /* global data pointer */ - struct cpupool *cpupool;/* points to this scheduler's pool */ - - int (*global_init) (void); - - int (*init) (struct scheduler *ops); - void (*deinit) (struct scheduler *ops); - - void (*free_udata) (const struct scheduler *ops, void *pri= v); - void * (*alloc_udata) (const struct scheduler *ops, - struct sched_unit *unit, void *dd); - - void (*free_pdata) (const struct scheduler *ops, - void *pcpu, int cpu); - void * (*alloc_pdata) (const struct scheduler *ops, int cpu); - void (*deinit_pdata) (const struct scheduler *ops, - void *pcpu, int cpu); - - /* Returns ERR_PTR(-err) for error, NULL for 'nothing needed'. */ - void * (*alloc_domdata) (const struct scheduler *ops, - struct domain *dom); - /* Idempotent. */ - void (*free_domdata) (const struct scheduler *ops, void *dat= a); - - spinlock_t * (*switch_sched) (struct scheduler *new_ops, unsigned in= t cpu, - void *pdata, void *vdata); - - /* Activate / deactivate units in a cpu pool */ - void (*insert_unit) (const struct scheduler *ops, - struct sched_unit *unit); - void (*remove_unit) (const struct scheduler *ops, - struct sched_unit *unit); - - void (*sleep) (const struct scheduler *ops, - struct sched_unit *unit); - void (*wake) (const struct scheduler *ops, - struct sched_unit *unit); - void (*yield) (const struct scheduler *ops, - struct sched_unit *unit); - void (*context_saved) (const struct scheduler *ops, - struct sched_unit *unit); - - void (*do_schedule) (const struct scheduler *ops, - struct sched_unit *currunit, s_time_t = now, - bool tasklet_work_scheduled); - - struct sched_resource *(*pick_resource)(const struct scheduler *ops, - const struct sched_unit *unit); - void (*migrate) (const struct scheduler *ops, - struct sched_unit *unit, - unsigned int new_cpu); - int (*adjust) (const struct scheduler *ops, - struct domain *d, - struct xen_domctl_scheduler_op *op); - void (*adjust_affinity)(const struct scheduler *ops, - struct sched_unit *unit, - const struct cpumask *hard, - const struct cpumask *soft); -#ifdef CONFIG_SYSCTL - int (*adjust_global) (const struct scheduler *ops, - struct xen_sysctl_scheduler_op *sc); -#endif - void (*dump_settings) (const struct scheduler *ops); - void (*dump_cpu_state) (const struct scheduler *ops, int cpu); - void (*move_timers) (const struct scheduler *ops, - struct sched_resource *sr); + const struct sched_ops *ops; /* shared, read-only dispatch table */ + void *sched_data; /* global data pointer */ + struct cpupool *cpupool; /* points to this scheduler's pool */ }; =20 static inline int sched_init(struct scheduler *s) { - return s->init(s); + return s->ops->init(s); } =20 static inline void sched_deinit(struct scheduler *s) { - s->deinit(s); + s->ops->deinit(s); } =20 static inline spinlock_t *sched_switch_sched(struct scheduler *s, unsigned int cpu, void *pdata, void *vdata) { - return s->switch_sched(s, cpu, pdata, vdata); + return s->ops->switch_sched(s, cpu, pdata, vdata); } =20 static inline void sched_dump_settings(const struct scheduler *s) { - if ( s->dump_settings ) - s->dump_settings(s); + if ( s->ops->dump_settings ) + s->ops->dump_settings(s); } =20 static inline void sched_dump_cpu_state(const struct scheduler *s, int cpu) { - if ( s->dump_cpu_state ) - s->dump_cpu_state(s, cpu); + if ( s->ops->dump_cpu_state ) + s->ops->dump_cpu_state(s, cpu); } =20 static inline void *sched_alloc_domdata(const struct scheduler *s, struct domain *d) { - return s->alloc_domdata ? s->alloc_domdata(s, d) : NULL; + return s->ops->alloc_domdata ? s->ops->alloc_domdata(s, d) : NULL; } =20 static inline void sched_free_domdata(const struct scheduler *s, void *data) { - ASSERT(s->free_domdata || !data); - if ( s->free_domdata ) - s->free_domdata(s, data); + ASSERT(s->ops->free_domdata || !data); + if ( s->ops->free_domdata ) + s->ops->free_domdata(s, data); } =20 static inline void *sched_alloc_pdata(const struct scheduler *s, int cpu) { - return s->alloc_pdata ? s->alloc_pdata(s, cpu) : NULL; + return s->ops->alloc_pdata ? s->ops->alloc_pdata(s, cpu) : NULL; } =20 static inline void sched_free_pdata(const struct scheduler *s, void *data, int cpu) { - ASSERT(s->free_pdata || !data); - if ( s->free_pdata ) - s->free_pdata(s, data, cpu); + ASSERT(s->ops->free_pdata || !data); + if ( s->ops->free_pdata ) + s->ops->free_pdata(s, data, cpu); } =20 static inline void sched_deinit_pdata(const struct scheduler *s, void *dat= a, int cpu) { - if ( s->deinit_pdata ) - s->deinit_pdata(s, data, cpu); + if ( s->ops->deinit_pdata ) + s->ops->deinit_pdata(s, data, cpu); } =20 static inline void *sched_alloc_udata(const struct scheduler *s, struct sched_unit *unit, void *dom_d= ata) { - return s->alloc_udata(s, unit, dom_data); + return s->ops->alloc_udata(s, unit, dom_data); } =20 static inline void sched_free_udata(const struct scheduler *s, void *data) { - s->free_udata(s, data); + s->ops->free_udata(s, data); } =20 static inline void sched_insert_unit(const struct scheduler *s, struct sched_unit *unit) { - if ( s->insert_unit ) - s->insert_unit(s, unit); + if ( s->ops->insert_unit ) + s->ops->insert_unit(s, unit); } =20 static inline void sched_remove_unit(const struct scheduler *s, struct sched_unit *unit) { - if ( s->remove_unit ) - s->remove_unit(s, unit); + if ( s->ops->remove_unit ) + s->ops->remove_unit(s, unit); } =20 static inline void sched_sleep(const struct scheduler *s, struct sched_unit *unit) { - if ( s->sleep ) - s->sleep(s, unit); + if ( s->ops->sleep ) + s->ops->sleep(s, unit); } =20 static inline void sched_wake(const struct scheduler *s, struct sched_unit *unit) { - if ( s->wake ) - s->wake(s, unit); + if ( s->ops->wake ) + s->ops->wake(s, unit); } =20 static inline void sched_yield(const struct scheduler *s, struct sched_unit *unit) { - if ( s->yield ) - s->yield(s, unit); + if ( s->ops->yield ) + s->ops->yield(s, unit); } =20 static inline void sched_context_saved(const struct scheduler *s, struct sched_unit *unit) { - if ( s->context_saved ) - s->context_saved(s, unit); + if ( s->ops->context_saved ) + s->ops->context_saved(s, unit); } =20 static inline void sched_migrate(const struct scheduler *s, struct sched_unit *unit, unsigned int cpu) { - if ( s->migrate ) - s->migrate(s, unit, cpu); + if ( s->ops->migrate ) + s->ops->migrate(s, unit, cpu); else sched_set_res(unit, get_sched_res(cpu)); } @@ -564,7 +498,7 @@ static inline void sched_migrate(const struct scheduler= *s, static inline struct sched_resource *sched_pick_resource( const struct scheduler *s, const struct sched_unit *unit) { - return s->pick_resource(s, unit); + return s->ops->pick_resource(s, unit); } =20 static inline void sched_adjust_affinity(const struct scheduler *s, @@ -572,29 +506,29 @@ static inline void sched_adjust_affinity(const struct= scheduler *s, const cpumask_t *hard, const cpumask_t *soft) { - if ( s->adjust_affinity ) - s->adjust_affinity(s, unit, hard, soft); + if ( s->ops->adjust_affinity ) + s->ops->adjust_affinity(s, unit, hard, soft); } =20 static inline int sched_adjust_dom(const struct scheduler *s, struct domai= n *d, struct xen_domctl_scheduler_op *op) { - return s->adjust ? s->adjust(s, d, op) : 0; + return s->ops->adjust ? s->ops->adjust(s, d, op) : 0; } =20 #ifdef CONFIG_SYSCTL static inline int sched_adjust_cpupool(const struct scheduler *s, struct xen_sysctl_scheduler_op *op) { - return s->adjust_global ? s->adjust_global(s, op) : 0; + return s->ops->adjust_global ? s->ops->adjust_global(s, op) : 0; } #endif =20 static inline void sched_move_timers(const struct scheduler *s, struct sched_resource *sr) { - if ( s->move_timers ) - s->move_timers(s, sr); + if ( s->ops->move_timers ) + s->ops->move_timers(s, sr); } =20 static inline void sched_unit_pause_nosync(const struct sched_unit *unit) @@ -613,9 +547,6 @@ static inline void sched_unit_unpause(const struct sche= d_unit *unit) vcpu_unpause(v); } =20 -#define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \ - __used_section(".data.schedulers") =3D &(x) - #define REGISTER_SCHED_OPS(x) static const struct sched_ops *x##_entry \ __used_section(".data.sched_ops") =3D &(x) =20 diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h index 157d48eabd..0005c38486 100644 --- a/xen/include/xen/xen.lds.h +++ b/xen/include/xen/xen.lds.h @@ -173,12 +173,6 @@ _edevice =3D .; \ } :text =20 -#define SCHEDULER_ARRAY \ - . =3D ALIGN(POINTER_ALIGN); \ - __start_schedulers_array =3D .; \ - *(.data.schedulers) \ - __end_schedulers_array =3D .; - #define SCHED_OPS_ARRAY \ . =3D ALIGN(POINTER_ALIGN); \ __start_sched_ops_array =3D .; \ --=20 2.34.1