Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f125adc authored by Elliot Berman's avatar Elliot Berman
Browse files

sched: Compile cpu_isolated_mask in SCHED_WALT only



cpu_isolated_mask can only be used when SCHED_WALT is enabled. The
addition of the cpu_isolated_mask causes ABI to break. Thus, compile
references to cpu_isolated_mask only when SCHED_WALT is enabled.

Change-Id: I0982f6431abca807168dbabc4aca74771819565c
Signed-off-by: default avatarElliot Berman <eberman@codeaurora.org>
parent a6ba293d
Loading
Loading
Loading
Loading
+17148 −17170

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -1173,10 +1173,12 @@ int lock_device_hotplug_sysfs(void)
	return restart_syscall();
}

#ifdef CONFIG_SCHED_WALT
void lock_device_hotplug_assert(void)
{
	lockdep_assert_held(&device_hotplug_lock);
}
#endif

#ifdef CONFIG_BLOCK
static inline int device_is_not_partition(struct device *dev)
+7 −3
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ static struct attribute_group crash_note_cpu_attr_group = {
};
#endif

#ifdef CONFIG_SCHED_WALT
#ifdef CONFIG_HOTPLUG_CPU
static ssize_t isolate_show(struct device *dev,
				struct device_attribute *attr, char *buf)
@@ -209,7 +210,6 @@ static struct attribute_group cpu_isolated_attr_group = {
};
#endif

#ifdef CONFIG_SCHED_WALT
static ssize_t sched_load_boost_show(struct device *dev,
				struct device_attribute *attr, char *buf)
{
@@ -266,10 +266,10 @@ static const struct attribute_group *common_cpu_attr_groups[] = {
#ifdef CONFIG_KEXEC
	&crash_note_cpu_attr_group,
#endif
#ifdef CONFIG_SCHED_WALT
#ifdef CONFIG_HOTPLUG_CPU
	&cpu_isolated_attr_group,
#endif
#ifdef CONFIG_SCHED_WALT
	&sched_cpu_attr_group,
#endif
	NULL
@@ -279,10 +279,10 @@ static const struct attribute_group *hotplugable_cpu_attr_groups[] = {
#ifdef CONFIG_KEXEC
	&crash_note_cpu_attr_group,
#endif
#ifdef CONFIG_SCHED_WALT
#ifdef CONFIG_HOTPLUG_CPU
	&cpu_isolated_attr_group,
#endif
#ifdef CONFIG_SCHED_WALT
	&sched_cpu_attr_group,
#endif
	NULL
@@ -314,7 +314,9 @@ static struct cpu_attr cpu_attrs[] = {
	_CPU_ATTR(online, &__cpu_online_mask),
	_CPU_ATTR(possible, &__cpu_possible_mask),
	_CPU_ATTR(present, &__cpu_present_mask),
#ifdef CONFIG_SCHED_WALT
	_CPU_ATTR(core_ctl_isolated, &__cpu_isolated_mask),
#endif
};

/*
@@ -564,7 +566,9 @@ static struct attribute *cpu_root_attrs[] = {
	&cpu_attrs[0].attr.attr,
	&cpu_attrs[1].attr.attr,
	&cpu_attrs[2].attr.attr,
#ifdef CONFIG_SCHED_WALT
	&cpu_attrs[3].attr.attr,
#endif
	&dev_attr_kernel_max.attr,
	&dev_attr_offline.attr,
	&dev_attr_isolated.attr,
+1 −1
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ config QCOM_GUESTVM

config QCOM_HYP_CORE_CTL
	bool "CPU reservation scheme for Hypervisor"
	depends on QCOM_GUESTVM
	depends on QCOM_GUESTVM && SCHED_WALT
	help
	  This driver reserve the specified CPUS by isolating them. The reserved
	  CPUs can be assigned to the other guest OS by the hypervisor.
+24 −13
Original line number Diff line number Diff line
@@ -92,12 +92,15 @@ extern struct cpumask __cpu_possible_mask;
extern struct cpumask __cpu_online_mask;
extern struct cpumask __cpu_present_mask;
extern struct cpumask __cpu_active_mask;
extern struct cpumask __cpu_isolated_mask;
#define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
#define cpu_online_mask   ((const struct cpumask *)&__cpu_online_mask)
#define cpu_present_mask  ((const struct cpumask *)&__cpu_present_mask)
#define cpu_active_mask   ((const struct cpumask *)&__cpu_active_mask)

#ifdef CONFIG_SCHED_WALT
extern struct cpumask __cpu_isolated_mask;
#define cpu_isolated_mask ((const struct cpumask *)&__cpu_isolated_mask)
#endif

extern atomic_t __num_online_cpus;

@@ -117,31 +120,35 @@ static inline unsigned int num_online_cpus(void)
#define num_possible_cpus()	cpumask_weight(cpu_possible_mask)
#define num_present_cpus()	cpumask_weight(cpu_present_mask)
#define num_active_cpus()	cpumask_weight(cpu_active_mask)
#define num_isolated_cpus()	cpumask_weight(cpu_isolated_mask)
#define num_online_uniso_cpus()						\
({									\
	cpumask_t mask;							\
									\
	cpumask_andnot(&mask, cpu_online_mask, cpu_isolated_mask);	\
	cpumask_weight(&mask);						\
})
#define cpu_online(cpu)		cpumask_test_cpu((cpu), cpu_online_mask)
#define cpu_possible(cpu)	cpumask_test_cpu((cpu), cpu_possible_mask)
#define cpu_present(cpu)	cpumask_test_cpu((cpu), cpu_present_mask)
#define cpu_active(cpu)		cpumask_test_cpu((cpu), cpu_active_mask)
#define cpu_isolated(cpu)	cpumask_test_cpu((cpu), cpu_isolated_mask)
#else
#define num_online_cpus()	1U
#define num_possible_cpus()	1U
#define num_present_cpus()	1U
#define num_active_cpus()	1U
#define num_isolated_cpus()	0U
#define num_online_uniso_cpus()	1U
#define cpu_online(cpu)		((cpu) == 0)
#define cpu_possible(cpu)	((cpu) == 0)
#define cpu_present(cpu)	((cpu) == 0)
#define cpu_active(cpu)		((cpu) == 0)
#define cpu_isolated(cpu)	((cpu) != 0)
#endif

#if defined(CONFIG_SCHED_WALT) && NR_CPUS > 1
#define num_isolated_cpus()	cpumask_weight(cpu_isolated_mask)
#define num_online_uniso_cpus()						\
({									\
	cpumask_t mask;							\
									\
	cpumask_andnot(&mask, cpu_online_mask, cpu_isolated_mask);	\
	cpumask_weight(&mask);						\
})
#define cpu_isolated(cpu)	cpumask_test_cpu((cpu), cpu_isolated_mask)
#else /* !CONFIG_SCHED_WALT || NR_CPUS == 1 */
#define num_isolated_cpus()	0U
#define num_online_uniso_cpus()	num_online_cpus()
#define cpu_isolated(cpu)	0U
#endif

extern cpumask_t cpus_booted_once_mask;
@@ -821,7 +828,9 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);
#define for_each_possible_cpu(cpu) for_each_cpu((cpu), cpu_possible_mask)
#define for_each_online_cpu(cpu)   for_each_cpu((cpu), cpu_online_mask)
#define for_each_present_cpu(cpu)  for_each_cpu((cpu), cpu_present_mask)
#ifdef CONFIG_SCHED_WALT
#define for_each_isolated_cpu(cpu) for_each_cpu((cpu), cpu_isolated_mask)
#endif

/* Wrappers for arch boot code to manipulate normally-constant masks */
void init_cpu_present(const struct cpumask *src);
@@ -862,6 +871,7 @@ set_cpu_active(unsigned int cpu, bool active)
		cpumask_clear_cpu(cpu, &__cpu_active_mask);
}

#ifdef CONFIG_SCHED_WALT
static inline void
set_cpu_isolated(unsigned int cpu, bool isolated)
{
@@ -870,6 +880,7 @@ set_cpu_isolated(unsigned int cpu, bool isolated)
	else
		cpumask_clear_cpu(cpu, &__cpu_isolated_mask);
}
#endif


/**
Loading