xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Meng Xu <mengxu@cis.upenn.edu>
Subject: Re: [Xen-devel] [PATCH] xen/sched: remove sched_init_pdata()
Date: Tue, 11 Feb 2020 11:37:20 +0100	[thread overview]
Message-ID: <ab00b9b4e25d9d690c803ae5a986881cfa1b6fbd.camel@suse.com> (raw)
In-Reply-To: <20200210153920.4297-1-jgross@suse.com>


[-- Attachment #1.1: Type: text/plain, Size: 2086 bytes --]

On Mon, 2020-02-10 at 16:39 +0100, Juergen Gross wrote:
> sched_init_pdata() is used nowhere, it can be removed. Same applies
> to
> the .init_pdata hook of the per-scheduler interface.
>
Right, and that appear to be the case since
f855dd962523b6cb47a92037bdd28b1485141abe ("sched: add minimalistic idle
scheduler for free cpus"), which removed all call sites.

And that is because switching to a scheduler always happens via
switch_sched from the idle scheduler, and it's there that we do all the
initializations, right?

This change is obviously doing the right thing, removing code that is
never called! :-)

Can we, though:
- add a mention to the commit above and a quick explanation of things 
  in the changelog?
- update the following comments too:
  1) in cpu_schedule_callback()

"* This happens by calling the deinit_pdata and free_pdata hooks, in this                                          
 * order. If no per-pCPU memory was allocated, there is no need to                                                 
 * provide an implementation of free_pdata. deinit_pdata may, however,                                             
 * be necessary/useful in this case too (e.g., it can undo something done                                          
 * on scheduler wide data structure during init_pdata). Both deinit_pdata                                          
 * and free_pdata are called during CPU_DEAD."

  2) schedule_cpu_add()

"*  - a valid instance of per-CPU scheduler specific data, as it is
 *    allocated by sched_alloc_pdata(). Note that we do not want to
 *    initialize it yet (i.e., we are not calling sched_init_pdata()).
 *    That will be done by the target scheduler, in sched_switch_sched(),
 *    in proper ordering and with locking."

Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2020-02-11 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 15:39 [Xen-devel] [PATCH] xen/sched: remove sched_init_pdata() Juergen Gross
2020-02-11 10:37 ` Dario Faggioli [this message]
2020-02-11 10:39   ` Jürgen Groß

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=ab00b9b4e25d9d690c803ae5a986881cfa1b6fbd.camel@suse.com \
    --to=dfaggioli@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=mengxu@cis.upenn.edu \
    --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).