From: Jan Beulich <jbeulich@suse.com>
To: Dario Faggioli <dfaggioli@suse.com>
Cc: Juergen Gross <jgross@suse.com>,
xen-devel@lists.xenproject.org,
George Dunlap <george.dunlap@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/sched: rework credit2 run-queue allocation
Date: Wed, 19 Feb 2020 17:52:44 +0100 [thread overview]
Message-ID: <6aff04ca-904b-cf27-d6f4-af9a146e4c04@suse.com> (raw)
In-Reply-To: <95f651ddc1639d1c498067e4af71759585aa48b3.camel@suse.com>
On 19.02.2020 17:47, Dario Faggioli wrote:
> On Thu, 2020-01-23 at 09:55 +0100, Juergen Gross wrote:
>> --- a/xen/common/sched/credit2.c
>> +++ b/xen/common/sched/credit2.c
>> @@ -849,51 +822,71 @@ static inline bool same_core(unsigned int cpua,
>> unsigned int cpub)
>> cpu_to_core(cpua) == cpu_to_core(cpub);
>> }
>>
>> -static unsigned int
>> -cpu_to_runqueue(const struct csched2_private *prv, unsigned int cpu)
>> +static struct csched2_runqueue_data *
>> +cpu_add_to_runqueue(struct csched2_private *prv, unsigned int cpu)
>> {
>> - const struct csched2_runqueue_data *rqd;
>> - unsigned int rqi;
>> + struct csched2_runqueue_data *rqd, *rqd_new;
>> + struct list_head *rqd_ins;
>> + unsigned long flags;
>> + int rqi = 0;
>> + bool rqi_unused = false, rqd_valid = false;
>> +
>> + rqd_new = xzalloc(struct csched2_runqueue_data);
>>
>>
> So, I'm not sure I see why it's better to allocating this here, and
> then free it if we didn't need it, instead than allocating it later,
> only if we actually need it... What am I missing? :-)
Where possible we should try to avoid calling allocation functions
with locks held.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2020-02-19 16:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-23 8:55 [Xen-devel] [PATCH] xen/sched: rework credit2 run-queue allocation Juergen Gross
2020-02-06 12:04 ` Jürgen Groß
2020-02-19 16:47 ` Dario Faggioli
2020-02-19 16:52 ` Jan Beulich [this message]
2020-02-19 18:37 ` Dario Faggioli
2020-02-20 6:56 ` Jürgen Groß
2020-02-20 9:28 ` Dario Faggioli
2020-02-20 6:54 ` 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=6aff04ca-904b-cf27-d6f4-af9a146e4c04@suse.com \
--to=jbeulich@suse.com \
--cc=dfaggioli@suse.com \
--cc=george.dunlap@eu.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.