From patchwork Wed Dec 18 07:48:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11299681 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCDF314B7 for ; Wed, 18 Dec 2019 07:50:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C27152176D for ; Wed, 18 Dec 2019 07:50:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C27152176D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihU5e-0003zh-Cl; Wed, 18 Dec 2019 07:49:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihU5d-0003yx-6W for xen-devel@lists.xenproject.org; Wed, 18 Dec 2019 07:49:49 +0000 X-Inumbo-ID: dc92800c-216a-11ea-b6f1-bc764e2007e4 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id dc92800c-216a-11ea-b6f1-bc764e2007e4; Wed, 18 Dec 2019 07:49:21 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 84EE8AD5F; Wed, 18 Dec 2019 07:49:03 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 18 Dec 2019 08:48:53 +0100 Message-Id: <20191218074859.21665-4-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191218074859.21665-1-jgross@suse.com> References: <20191218074859.21665-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 3/9] xen/sched: cleanup sched.h X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Dario Faggioli , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There are some items in include/xen/sched.h which can be moved to sched-if.h as they are scheduler private. Signed-off-by: Juergen Gross Reviewed-by: Dario Faggioli --- xen/common/sched/sched-if.h | 13 +++++++++++++ xen/common/sched/schedule.c | 2 +- xen/include/xen/sched.h | 17 ----------------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/xen/common/sched/sched-if.h b/xen/common/sched/sched-if.h index a702fd23b1..edce354dc7 100644 --- a/xen/common/sched/sched-if.h +++ b/xen/common/sched/sched-if.h @@ -533,6 +533,7 @@ static inline void sched_unit_unpause(const struct sched_unit *unit) struct cpupool { int cpupool_id; +#define CPUPOOLID_NONE -1 unsigned int n_dom; cpumask_var_t cpu_valid; /* all cpus assigned to pool */ cpumask_var_t res_valid; /* all scheduling resources of pool */ @@ -618,5 +619,17 @@ affinity_balance_cpumask(const struct sched_unit *unit, int step, void sched_rm_cpu(unsigned int cpu); const cpumask_t *sched_get_opt_cpumask(enum sched_gran opt, unsigned int cpu); +void schedule_dump(struct cpupool *c); +struct scheduler *scheduler_get_default(void); +struct scheduler *scheduler_alloc(unsigned int sched_id, int *perr); +void scheduler_free(struct scheduler *sched); +int cpu_disable_scheduler(unsigned int cpu); +int schedule_cpu_add(unsigned int cpu, struct cpupool *c); +int schedule_cpu_rm(unsigned int cpu); +int sched_move_domain(struct domain *d, struct cpupool *c); +struct cpupool *cpupool_get_by_id(int poolid); +void cpupool_put(struct cpupool *pool); +int cpupool_add_domain(struct domain *d, int poolid); +void cpupool_rm_domain(struct domain *d); #endif /* __XEN_SCHED_IF_H__ */ diff --git a/xen/common/sched/schedule.c b/xen/common/sched/schedule.c index c751faa741..db8ce146ca 100644 --- a/xen/common/sched/schedule.c +++ b/xen/common/sched/schedule.c @@ -1346,7 +1346,7 @@ int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity) return vcpu_set_affinity(v, affinity, v->sched_unit->cpu_hard_affinity); } -int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinity) +static int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinity) { return vcpu_set_affinity(v, affinity, v->sched_unit->cpu_soft_affinity); } diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 2507a833c2..55335d6ab3 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -685,7 +685,6 @@ int sched_init_vcpu(struct vcpu *v); void sched_destroy_vcpu(struct vcpu *v); int sched_init_domain(struct domain *d, int poolid); void sched_destroy_domain(struct domain *d); -int sched_move_domain(struct domain *d, struct cpupool *c); long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *); long sched_adjust_global(struct xen_sysctl_scheduler_op *); int sched_id(void); @@ -918,19 +917,10 @@ static inline bool sched_has_urgent_vcpu(void) return atomic_read(&this_cpu(sched_urgent_count)); } -struct scheduler; - -struct scheduler *scheduler_get_default(void); -struct scheduler *scheduler_alloc(unsigned int sched_id, int *perr); -void scheduler_free(struct scheduler *sched); -int schedule_cpu_add(unsigned int cpu, struct cpupool *c); -int schedule_cpu_rm(unsigned int cpu); void vcpu_set_periodic_timer(struct vcpu *v, s_time_t value); -int cpu_disable_scheduler(unsigned int cpu); void sched_setup_dom0_vcpus(struct domain *d); int vcpu_temporary_affinity(struct vcpu *v, unsigned int cpu, uint8_t reason); int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity); -int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinity); void restore_vcpu_affinity(struct domain *d); int vcpu_affinity_domctl(struct domain *d, uint32_t cmd, struct xen_domctl_vcpuaffinity *vcpuaff); @@ -1051,17 +1041,10 @@ extern enum cpufreq_controller { FREQCTL_none, FREQCTL_dom0_kernel, FREQCTL_xen } cpufreq_controller; -#define CPUPOOLID_NONE -1 - -struct cpupool *cpupool_get_by_id(int poolid); -void cpupool_put(struct cpupool *pool); -int cpupool_add_domain(struct domain *d, int poolid); -void cpupool_rm_domain(struct domain *d); int cpupool_move_domain(struct domain *d, struct cpupool *c); int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op); int cpupool_get_id(const struct domain *d); cpumask_t *cpupool_valid_cpus(struct cpupool *pool); -void schedule_dump(struct cpupool *c); extern void dump_runq(unsigned char key); void arch_do_physinfo(struct xen_sysctl_physinfo *pi);