All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	George Dunlap <george.dunlap@citrix.com>
Subject: [PATCH v2 3/7] xen: cpupool: add a back-pointer from a scheduler to its pool
Date: Thu, 28 May 2020 23:29:37 +0200	[thread overview]
Message-ID: <159070137738.12060.10928971799525755388.stgit@Palanthas> (raw)
In-Reply-To: <159070133878.12060.13318432301910522647.stgit@Palanthas>

If we need to know within which pool a particular scheduler
is working, we can do that by querying the cpupool pointer
of any of the sched_resource-s (i.e., ~ any of the CPUs)
assigned to the scheduler itself.

Basically, we pick any sched_resource that we know uses that
scheduler, and we check its *cpupool pointer. If we really
know that the resource uses the scheduler, this is fine, as
it also means the resource is inside the pool we are
looking for.

But, of course, we can do that for a pool/scheduler that has
not any been given any sched_resource yet (or if we do not
know whether or not it has any sched_resource).

To overcome such limitation, add a back pointer from the
scheduler, to its own pool.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
Cc: Juergen Gross <jgross@suse.com>
Cc: George Dunlap <george.dunlap@citrix.com>
---
Changes from v1:
* new patch
---
 xen/common/sched/cpupool.c |    1 +
 xen/common/sched/private.h |    1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index 0664f7fa3d..7ea641ca26 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -287,6 +287,7 @@ static struct cpupool *cpupool_create(
         if ( c->sched == NULL )
             goto err;
     }
+    c->sched->cpupool = c;
     c->gran = opt_sched_granularity;
 
     *q = c;
diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
index b9a5b4c01c..df50976eb2 100644
--- a/xen/common/sched/private.h
+++ b/xen/common/sched/private.h
@@ -275,6 +275,7 @@ struct scheduler {
     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);
 



  parent reply	other threads:[~2020-05-28 21:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 21:29 [PATCH v2 0/7] xen: credit2: limit the number of CPUs per runqueue Dario Faggioli
2020-05-28 21:29 ` [PATCH v2 1/7] xen: credit2: factor cpu to runqueue matching in a function Dario Faggioli
2020-05-29 14:48   ` Jürgen Groß
2020-05-28 21:29 ` [PATCH v2 2/7] xen: credit2: factor runqueue initialization in its own function Dario Faggioli
2020-05-29 14:50   ` Jürgen Groß
2020-05-28 21:29 ` Dario Faggioli [this message]
2020-05-29 14:54   ` [PATCH v2 3/7] xen: cpupool: add a back-pointer from a scheduler to its pool Jürgen Groß
2020-05-29 14:56     ` Dario Faggioli
2020-05-28 21:29 ` [PATCH v2 4/7] xen: credit2: limit the max number of CPUs in a runqueue Dario Faggioli
2020-05-29 15:23   ` Jürgen Groß
2020-05-29 15:36     ` Dario Faggioli
2020-05-28 21:29 ` [PATCH v2 5/7] xen: credit2: compute cpus per-runqueue more dynamically Dario Faggioli
2020-05-28 21:29 ` [PATCH v2 6/7] cpupool: create an the 'cpupool sync' infrastructure Dario Faggioli
2020-05-28 21:30 ` [PATCH v2 7/7] xen: credit2: rebalance the number of CPUs in the scheduler runqueues Dario Faggioli
2020-07-21 12:08 ` [PATCH v2 0/7] xen: credit2: limit the number of CPUs per runqueue Jan Beulich
2020-07-22 15:33   ` Dario Faggioli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=159070137738.12060.10928971799525755388.stgit@Palanthas \
    --to=dfaggioli@suse.com \
    --cc=george.dunlap@citrix.com \
    --cc=jgross@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.