All of lore.kernel.org
 help / color / mirror / Atom feed
From: chenbaodong <chenbaodong@mxnavi.com>
To: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	<xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Dario Faggioli <dfaggioli@suse.com>,
	Julien Grall <julien.grall@arm.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] xen: superficial clean-ups
Date: Wed, 12 Jun 2019 09:05:52 +0800	[thread overview]
Message-ID: <02a1c122-0b2e-4ab6-f0d4-34634529c224@mxnavi.com> (raw)
In-Reply-To: <28ad7e86-d724-0fcc-85fa-3289dc485c1a@suse.com>


On 6/11/19 18:29, Juergen Gross wrote:
> On 11.06.19 12:27, Andrew Cooper wrote:
>> On 11/06/2019 11:25, Juergen Gross wrote:
>>> On 11.06.19 12:18, George Dunlap wrote:
>>>> On 6/11/19 10:20 AM, Baodong Chen wrote:
>>>>> * Remove redundant set 'DOMDYING_dead'
>>>>> domain_create() will set this when fail, thus no need
>>>>> set in arch_domain_create().
>>>>>
>>>>> * Set error when really happened
>>>>
>>>>> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
>>>>> index 86341bc..d6cdcf8 100644
>>>>> --- a/xen/common/schedule.c
>>>>> +++ b/xen/common/schedule.c
>>>>> @@ -1894,9 +1894,11 @@ struct scheduler *scheduler_alloc(unsigned
>>>>> int sched_id, int *perr)
>>>>>        return NULL;
>>>>>       found:
>>>>> -    *perr = -ENOMEM;
>>>>>        if ( (sched = xmalloc(struct scheduler)) == NULL )
>>>>> +    {
>>>>> +        *perr = -ENOMEM;
>>>>>            return NULL;
>>>>> +    }
>>>>>        memcpy(sched, schedulers[i], sizeof(*sched));
>>>>>        if ( (*perr = SCHED_OP(sched, init)) != 0 )
>>>>
>>>> I was going to say, this is a common idiom in the Xen code, and the
>>>> compiler will end up re-organizing things such that the write doesn't
>>>> happen anyway.  But in this case, its' actually writing through a
>>>> pointer before and after a function call; I don't think the compiler
>>>> would actually be allowed to optimize this write away.
>>>>
>>>> So, I guess I'd be OK with this particular hunk.  Dario, any opinions?
>>>
>>> I'd rather switch to PTR_ERR() here dropping the perr parameter.
>>
>> +2 for this, but I was going to wait until core scheduling had gotten a
>> bit further before suggesting cleanup which is guaranteed to collide.
>>
>> Sadly, it's fairly intrusive in the cpupool code as well.
>
> I can add this to my list of scheduler cleanups to do.
Copy that.
>
>
> Juergen
> .
>

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

  reply	other threads:[~2019-06-12  1:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11  9:20 [Xen-devel] [PATCH] xen: superficial clean-ups Baodong Chen
2019-06-11  9:45 ` Andrew Cooper
2019-06-11 10:33   ` chenbaodong
2019-06-11 10:53     ` Andrew Cooper
2019-06-12  0:51       ` chenbaodong
2019-06-11 10:18 ` George Dunlap
2019-06-11 10:25   ` Juergen Gross
2019-06-11 10:27     ` Andrew Cooper
2019-06-11 10:29       ` Juergen Gross
2019-06-12  1:05         ` chenbaodong [this message]
2019-06-11 10:34     ` 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=02a1c122-0b2e-4ab6-f0d4-34634529c224@mxnavi.com \
    --to=chenbaodong@mxnavi.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dfaggioli@suse.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.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 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.