xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Dario Faggioli <dfaggioli@suse.com>
Subject: Re: [PATCH v2 15/17] xen/cpupool: add cpupool directories
Date: Wed, 2 Dec 2020 16:46:35 +0100	[thread overview]
Message-ID: <89f52bed-c611-70c5-1349-63838530debd@suse.com> (raw)
In-Reply-To: <20201201082128.15239-16-jgross@suse.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2890 bytes --]

On 01.12.20 09:21, Juergen Gross wrote:
> Add /cpupool/<cpupool-id> directories to hypfs. Those are completely
> dynamic, so the related hypfs access functions need to be implemented.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - added const (Jan Beulich)
> - call hypfs_add_dir() in helper (Dario Faggioli)
> - switch locking to enter/exit callbacks
> ---
>   docs/misc/hypfs-paths.pandoc |   9 +++
>   xen/common/sched/cpupool.c   | 122 +++++++++++++++++++++++++++++++++++
>   2 files changed, 131 insertions(+)
> 
> diff --git a/docs/misc/hypfs-paths.pandoc b/docs/misc/hypfs-paths.pandoc
> index 6c7b2f7ee3..aaca1cdf92 100644
> --- a/docs/misc/hypfs-paths.pandoc
> +++ b/docs/misc/hypfs-paths.pandoc
> @@ -175,6 +175,15 @@ The major version of Xen.
>   
>   The minor version of Xen.
>   
> +#### /cpupool/
> +
> +A directory of all current cpupools.
> +
> +#### /cpupool/*/
> +
> +The individual cpupools. Each entry is a directory with the name being the
> +cpupool-id (e.g. /cpupool/0/).
> +
>   #### /params/
>   
>   A directory of runtime parameters.
> diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
> index 0db7d77219..3e17fdf95b 100644
> --- a/xen/common/sched/cpupool.c
> +++ b/xen/common/sched/cpupool.c
> @@ -13,6 +13,8 @@
>   
>   #include <xen/cpu.h>
>   #include <xen/cpumask.h>
> +#include <xen/guest_access.h>
> +#include <xen/hypfs.h>
>   #include <xen/init.h>
>   #include <xen/keyhandler.h>
>   #include <xen/lib.h>
> @@ -33,6 +35,7 @@ static int cpupool_moving_cpu = -1;
>   static struct cpupool *cpupool_cpu_moving = NULL;
>   static cpumask_t cpupool_locked_cpus;
>   
> +/* This lock nests inside sysctl or hypfs lock. */
>   static DEFINE_SPINLOCK(cpupool_lock);
>   
>   static enum sched_gran __read_mostly opt_sched_granularity = SCHED_GRAN_cpu;
> @@ -1003,12 +1006,131 @@ static struct notifier_block cpu_nfb = {
>       .notifier_call = cpu_callback
>   };
>   
> +#ifdef CONFIG_HYPFS
> +static const struct hypfs_entry *cpupool_pooldir_enter(
> +    const struct hypfs_entry *entry);
> +
> +static struct hypfs_funcs cpupool_pooldir_funcs = {
> +    .enter = cpupool_pooldir_enter,
> +    .exit = hypfs_node_exit,
> +    .read = hypfs_read_dir,
> +    .write = hypfs_write_deny,
> +    .getsize = hypfs_getsize,
> +    .findentry = hypfs_dir_findentry,
> +};
> +
> +static HYPFS_VARDIR_INIT(cpupool_pooldir, "%u", &cpupool_pooldir_funcs);
> +
> +static const struct hypfs_entry *cpupool_pooldir_enter(
> +    const struct hypfs_entry *entry)
> +{
> +    return &cpupool_pooldir.e;
> +}
I have found a more generic way to handle entering a dyndir node,
resulting in no need to have cpupool_pooldir_enter() and
cpupool_pooldir_funcs.

This will add some more lines to the previous patch, but less than
saved here.


Juergen

[-- Attachment #1.1.2: OpenPGP_0xB0DE9DD628BF132F.asc --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  parent reply	other threads:[~2020-12-02 15:47 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01  8:21 [PATCH v2 00/17] xen: support per-cpupool scheduling granularity Juergen Gross
2020-12-01  8:21 ` [PATCH v2 01/17] xen/cpupool: add cpu to sched_res_mask when removing it from cpupool Juergen Gross
2020-12-01  8:21 ` [PATCH v2 02/17] xen/cpupool: add missing bits for per-cpupool scheduling granularity Juergen Gross
2020-12-01  8:21 ` [PATCH v2 03/17] xen/cpupool: sort included headers in cpupool.c Juergen Gross
2020-12-01  8:21 ` [PATCH v2 04/17] xen/cpupool: switch cpupool id to unsigned Juergen Gross
2020-12-01  8:55   ` Jan Beulich
2020-12-01  9:01     ` Jürgen Groß
2020-12-01  9:07       ` Jan Beulich
2020-12-07  9:59       ` Jan Beulich
2020-12-07 14:48         ` Jürgen Groß
2020-12-07 15:00           ` Jan Beulich
2020-12-04 15:52   ` Dario Faggioli
2020-12-07  9:58     ` Jan Beulich
2020-12-07 15:21     ` Jan Beulich
2020-12-01  8:21 ` [PATCH v2 05/17] xen/cpupool: switch cpupool list to normal list interface Juergen Gross
2020-12-01  9:12   ` Jan Beulich
2020-12-01  9:18     ` Jürgen Groß
2020-12-04 16:13       ` Dario Faggioli
2020-12-04 16:16         ` Jürgen Groß
2020-12-04 16:25           ` Dario Faggioli
2020-12-04 16:56   ` Dario Faggioli
2020-12-01  8:21 ` [PATCH v2 06/17] xen/cpupool: use ERR_PTR() for returning error cause from cpupool_create() Juergen Gross
2020-12-02  8:58   ` Jan Beulich
2020-12-02  9:56     ` Jürgen Groß
2020-12-02 10:46       ` Jan Beulich
2020-12-02 10:58         ` Jürgen Groß
2020-12-04 16:29   ` Dario Faggioli
2020-12-01  8:21 ` [PATCH v2 07/17] xen/cpupool: support moving domain between cpupools with different granularity Juergen Gross
2020-12-01  8:21 ` [PATCH v2 08/17] docs: fix hypfs path documentation Juergen Gross
2020-12-01  8:21 ` [PATCH v2 09/17] xen/hypfs: move per-node function pointers into a dedicated struct Juergen Gross
2020-12-02 15:36   ` Jan Beulich
2020-12-02 15:41     ` Jürgen Groß
2020-12-03  8:47     ` Jürgen Groß
2020-12-03  9:12       ` Jan Beulich
2020-12-03  9:51         ` Jürgen Groß
2020-12-01  8:21 ` [PATCH v2 10/17] xen/hypfs: pass real failure reason up from hypfs_get_entry() Juergen Gross
2020-12-01  8:21 ` [PATCH v2 11/17] xen/hypfs: add getsize() and findentry() callbacks to hypfs_funcs Juergen Gross
2020-12-02 15:42   ` Jan Beulich
2020-12-02 15:51     ` Jürgen Groß
2020-12-03  8:12       ` Jan Beulich
2020-12-03  9:39         ` Jürgen Groß
2020-12-04  8:58   ` Jan Beulich
2020-12-04 11:14     ` Jürgen Groß
2020-12-01  8:21 ` [PATCH v2 12/17] xen/hypfs: add new enter() and exit() per node callbacks Juergen Gross
2020-12-03 14:59   ` Jan Beulich
2020-12-03 15:14     ` Jürgen Groß
2020-12-03 15:29       ` Jan Beulich
2020-12-04  8:33         ` Jürgen Groß
2020-12-04  8:30   ` Jan Beulich
2020-12-04  8:35     ` Jürgen Groß
2020-12-01  8:21 ` [PATCH v2 13/17] xen/hypfs: support dynamic hypfs nodes Juergen Gross
2020-12-03 15:08   ` Jan Beulich
2020-12-03 15:18     ` Jürgen Groß
2020-12-01  8:21 ` [PATCH v2 14/17] xen/hypfs: add support for id-based dynamic directories Juergen Gross
2020-12-03 15:44   ` Jan Beulich
2020-12-04  8:52     ` Jürgen Groß
2020-12-04  9:16       ` Jan Beulich
2020-12-04 13:08         ` Jürgen Groß
2020-12-07  7:54           ` Jan Beulich
2020-12-01  8:21 ` [PATCH v2 15/17] xen/cpupool: add cpupool directories Juergen Gross
2020-12-01  9:00   ` Jan Beulich
2020-12-01  9:03     ` Jürgen Groß
2020-12-02 15:46   ` Jürgen Groß [this message]
2020-12-03 14:46     ` Jan Beulich
2020-12-03 15:11       ` Jürgen Groß
2020-12-04  9:10   ` Jan Beulich
2020-12-04 11:08     ` Jürgen Groß
2020-12-04 11:54       ` Jan Beulich
2020-12-01  8:21 ` [PATCH v2 16/17] xen/cpupool: add scheduling granularity entry to cpupool entries Juergen Gross
2020-12-01  8:21 ` [PATCH v2 17/17] xen/cpupool: make per-cpupool sched-gran hypfs node writable Juergen Gross
2020-12-04 23:53 ` [PATCH v2 00/17] xen: support per-cpupool scheduling granularity Andrew Cooper
2020-12-05  7:41   ` Jürgen Groß
2020-12-07  9:00   ` Jan Beulich

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=89f52bed-c611-70c5-1349-63838530debd@suse.com \
    --to=jgross@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dfaggioli@suse.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).