xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Josh Whitehead <josh.whitehead@dornerworks.com>,
	Meng Xu <mengxu@cis.upenn.edu>,
	Robert VanVossen <robert.vanvossen@dornerworks.com>
Subject: Re: [PATCH 3/6] xen/sched: Improvements to the {alloc, free}_domdata() interfaces
Date: Thu, 01 Mar 2018 11:39:08 +0100	[thread overview]
Message-ID: <1519900748.9145.14.camel@suse.com> (raw)
In-Reply-To: <1519827268-18199-4-git-send-email-andrew.cooper3@citrix.com>


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

On Wed, 2018-02-28 at 14:14 +0000, Andrew Cooper wrote:
> The main purpose of this change is for the subsequent cleanup it
> enables, but
> it stands on its own merits.
> 
> In principle, these hooks are optional, but the SCHED_OP() default
> aliases a
> memory allocation failure, which causes arinc653 to play the
> dangerous game of
> passing its priv pointer back, and remembering not to actually free
> it.
> 
> Redefine alloc_domdata to use ERR_PTR() for errors, NULL for nothing,
> and
> non-NULL for a real allocation, which allows the hook to become
> properly
> optional.  Redefine free_domdata to be idempotent.
> 
> For arinc653, this means the dummy hooks can be dropped
> entirely.  For the
> other schedulers, this means returning ERR_PTR(-ENOMEM) instead of
> NULL for
> memory allocation failures, and modifying the free hooks to cope with
> a NULL
> pointer.  While making the alterations, drop some spurious casts to
> void *.
> 
> Introduce and use proper wrappers for
> sched_{alloc,free}_domdata().  These are
> strictly better than SCHED_OP(), as the source code is visible to
> grep/cscope/tags, the generated code is better, and there can be
> proper
> per-hook defaults and checks.
> 
> Callers of the alloc hooks are switched to using IS_ERR(), rather
> than
> checking for NULL.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

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

[-- 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

  parent reply	other threads:[~2018-03-01 10:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28 14:14 [PATCH 0/6] Assorted improvements to domain creation Andrew Cooper
2018-02-28 14:14 ` [PATCH 1/6] xen/domain: Reduce the quantity of initialisation for system domains Andrew Cooper
2018-02-28 15:22   ` George Dunlap
2018-03-01 10:10   ` Dario Faggioli
2018-02-28 14:14 ` [PATCH 2/6] xen/credit2: Move repl_timer into struct csched2_dom Andrew Cooper
2018-02-28 15:26   ` George Dunlap
2018-03-01 10:12     ` Dario Faggioli
2018-02-28 14:14 ` [PATCH 3/6] xen/sched: Improvements to the {alloc, free}_domdata() interfaces Andrew Cooper
2018-02-28 15:40   ` George Dunlap
2018-02-28 16:31   ` Meng Xu
2018-03-01 10:39   ` Dario Faggioli [this message]
2018-03-05 18:20   ` Andrew Cooper
2018-02-28 14:14 ` [PATCH 4/6] xen/sched: Remove {init, destroy}_domain() interfaces Andrew Cooper
2018-02-28 16:22   ` George Dunlap
2018-02-28 16:33     ` Andrew Cooper
2018-03-01 11:08       ` Dario Faggioli
2018-02-28 16:34   ` Meng Xu
2018-03-01 11:00   ` Dario Faggioli
2018-02-28 14:14 ` [PATCH 5/6] xen/domain: Call sched_destroy_domain() in the domain_create() error path Andrew Cooper
2018-02-28 16:24   ` George Dunlap
2018-03-01 13:25   ` Dario Faggioli
2018-03-01 13:27   ` Dario Faggioli
2018-02-28 14:14 ` [PATCH 6/6] xen/domain: Use IS_ERR_OR_NULL() when checking the return value of domain_create() Andrew Cooper
2018-02-28 16:36   ` George Dunlap
2018-03-07 19:12   ` [PATCH v2 6/6] xen/domain: Added debug safety in the domain_create() failure path Andrew Cooper
2018-03-08  9:04     ` 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=1519900748.9145.14.camel@suse.com \
    --to=dfaggioli@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=josh.whitehead@dornerworks.com \
    --cc=mengxu@cis.upenn.edu \
    --cc=robert.vanvossen@dornerworks.com \
    --cc=xen-devel@lists.xen.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).