Skip to content

Commit 3ec20e2

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Martin Schwidefsky: "Three bug fixes and an update to the default configuration" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/defconfig: set SCSI_DH=y s390/vtime: correct scaled cputime of partially idle CPUs s390/boot/decompression: disable floating point in decompressor s390/numa: use correct type for node_to_cpumask_map
2 parents 3c68319 + daad0bf commit 3ec20e2

File tree

11 files changed

+77
-40
lines changed

11 files changed

+77
-40
lines changed

arch/s390/boot/compressed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ targets += misc.o piggy.o sizes.h head.o
1010

1111
KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUX_INCLUDE) -O2
1212
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
13-
KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks
13+
KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -msoft-float
1414
KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
1515
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
1616

arch/s390/configs/default_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ CONFIG_ISCSI_TCP=m
381381
CONFIG_SCSI_DEBUG=m
382382
CONFIG_ZFCP=y
383383
CONFIG_SCSI_VIRTIO=m
384-
CONFIG_SCSI_DH=m
384+
CONFIG_SCSI_DH=y
385385
CONFIG_SCSI_DH_RDAC=m
386386
CONFIG_SCSI_DH_HP_SW=m
387387
CONFIG_SCSI_DH_EMC=m

arch/s390/configs/gcov_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ CONFIG_ISCSI_TCP=m
377377
CONFIG_SCSI_DEBUG=m
378378
CONFIG_ZFCP=y
379379
CONFIG_SCSI_VIRTIO=m
380-
CONFIG_SCSI_DH=m
380+
CONFIG_SCSI_DH=y
381381
CONFIG_SCSI_DH_RDAC=m
382382
CONFIG_SCSI_DH_HP_SW=m
383383
CONFIG_SCSI_DH_EMC=m

arch/s390/configs/performance_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ CONFIG_ISCSI_TCP=m
377377
CONFIG_SCSI_DEBUG=m
378378
CONFIG_ZFCP=y
379379
CONFIG_SCSI_VIRTIO=m
380-
CONFIG_SCSI_DH=m
380+
CONFIG_SCSI_DH=y
381381
CONFIG_SCSI_DH_RDAC=m
382382
CONFIG_SCSI_DH_HP_SW=m
383383
CONFIG_SCSI_DH_EMC=m

arch/s390/include/asm/numa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int numa_pfn_to_nid(unsigned long pfn);
1919
int __node_distance(int a, int b);
2020
void numa_update_cpu_topology(void);
2121

22-
extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
22+
extern cpumask_t node_to_cpumask_map[MAX_NUMNODES];
2323
extern int numa_debug_enabled;
2424

2525
#else

arch/s390/include/asm/topology.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static inline int cpu_to_node(int cpu)
6868
#define cpumask_of_node cpumask_of_node
6969
static inline const struct cpumask *cpumask_of_node(int node)
7070
{
71-
return node_to_cpumask_map[node];
71+
return &node_to_cpumask_map[node];
7272
}
7373

7474
/*

arch/s390/kernel/asm-offsets.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ int main(void)
176176
DEFINE(__LC_PASTE, offsetof(struct _lowcore, paste));
177177
DEFINE(__LC_FP_CREG_SAVE_AREA, offsetof(struct _lowcore, fpt_creg_save_area));
178178
DEFINE(__LC_LAST_BREAK, offsetof(struct _lowcore, breaking_event_addr));
179+
DEFINE(__LC_PERCPU_OFFSET, offsetof(struct _lowcore, percpu_offset));
179180
DEFINE(__LC_VDSO_PER_CPU, offsetof(struct _lowcore, vdso_per_cpu_data));
180181
DEFINE(__LC_GMAP, offsetof(struct _lowcore, gmap));
181182
DEFINE(__LC_PGM_TDB, offsetof(struct _lowcore, pgm_tdb));

arch/s390/kernel/entry.S

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,14 @@ ENTRY(psw_idle)
733733
stg %r3,__SF_EMPTY(%r15)
734734
larl %r1,.Lpsw_idle_lpsw+4
735735
stg %r1,__SF_EMPTY+8(%r15)
736+
#ifdef CONFIG_SMP
737+
larl %r1,smp_cpu_mtid
738+
llgf %r1,0(%r1)
739+
ltgr %r1,%r1
740+
jz .Lpsw_idle_stcctm
741+
.insn rsy,0xeb0000000017,%r1,5,__SF_EMPTY+16(%r15)
742+
.Lpsw_idle_stcctm:
743+
#endif
736744
STCK __CLOCK_IDLE_ENTER(%r2)
737745
stpt __TIMER_IDLE_ENTER(%r2)
738746
.Lpsw_idle_lpsw:
@@ -1159,7 +1167,27 @@ cleanup_critical:
11591167
jhe 1f
11601168
mvc __CLOCK_IDLE_ENTER(8,%r2),__CLOCK_IDLE_EXIT(%r2)
11611169
mvc __TIMER_IDLE_ENTER(8,%r2),__TIMER_IDLE_EXIT(%r2)
1162-
1: # account system time going idle
1170+
1: # calculate idle cycles
1171+
#ifdef CONFIG_SMP
1172+
clg %r9,BASED(.Lcleanup_idle_insn)
1173+
jl 3f
1174+
larl %r1,smp_cpu_mtid
1175+
llgf %r1,0(%r1)
1176+
ltgr %r1,%r1
1177+
jz 3f
1178+
.insn rsy,0xeb0000000017,%r1,5,__SF_EMPTY+80(%r15)
1179+
larl %r3,mt_cycles
1180+
ag %r3,__LC_PERCPU_OFFSET
1181+
la %r4,__SF_EMPTY+16(%r15)
1182+
2: lg %r0,0(%r3)
1183+
slg %r0,0(%r4)
1184+
alg %r0,64(%r4)
1185+
stg %r0,0(%r3)
1186+
la %r3,8(%r3)
1187+
la %r4,8(%r4)
1188+
brct %r1,2b
1189+
#endif
1190+
3: # account system time going idle
11631191
lg %r9,__LC_STEAL_TIMER
11641192
alg %r9,__CLOCK_IDLE_ENTER(%r2)
11651193
slg %r9,__LC_LAST_UPDATE_CLOCK

arch/s390/kernel/vtime.c

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static DEFINE_SPINLOCK(virt_timer_lock);
2525
static atomic64_t virt_timer_current;
2626
static atomic64_t virt_timer_elapsed;
2727

28-
static DEFINE_PER_CPU(u64, mt_cycles[32]);
28+
DEFINE_PER_CPU(u64, mt_cycles[8]);
2929
static DEFINE_PER_CPU(u64, mt_scaling_mult) = { 1 };
3030
static DEFINE_PER_CPU(u64, mt_scaling_div) = { 1 };
3131
static DEFINE_PER_CPU(u64, mt_scaling_jiffies);
@@ -60,6 +60,34 @@ static inline int virt_timer_forward(u64 elapsed)
6060
return elapsed >= atomic64_read(&virt_timer_current);
6161
}
6262

63+
static void update_mt_scaling(void)
64+
{
65+
u64 cycles_new[8], *cycles_old;
66+
u64 delta, fac, mult, div;
67+
int i;
68+
69+
stcctm5(smp_cpu_mtid + 1, cycles_new);
70+
cycles_old = this_cpu_ptr(mt_cycles);
71+
fac = 1;
72+
mult = div = 0;
73+
for (i = 0; i <= smp_cpu_mtid; i++) {
74+
delta = cycles_new[i] - cycles_old[i];
75+
div += delta;
76+
mult *= i + 1;
77+
mult += delta * fac;
78+
fac *= i + 1;
79+
}
80+
div *= fac;
81+
if (div > 0) {
82+
/* Update scaling factor */
83+
__this_cpu_write(mt_scaling_mult, mult);
84+
__this_cpu_write(mt_scaling_div, div);
85+
memcpy(cycles_old, cycles_new,
86+
sizeof(u64) * (smp_cpu_mtid + 1));
87+
}
88+
__this_cpu_write(mt_scaling_jiffies, jiffies_64);
89+
}
90+
6391
/*
6492
* Update process times based on virtual cpu times stored by entry.S
6593
* to the lowcore fields user_timer, system_timer & steal_clock.
@@ -69,7 +97,6 @@ static int do_account_vtime(struct task_struct *tsk, int hardirq_offset)
6997
struct thread_info *ti = task_thread_info(tsk);
7098
u64 timer, clock, user, system, steal;
7199
u64 user_scaled, system_scaled;
72-
int i;
73100

74101
timer = S390_lowcore.last_update_timer;
75102
clock = S390_lowcore.last_update_clock;
@@ -85,34 +112,10 @@ static int do_account_vtime(struct task_struct *tsk, int hardirq_offset)
85112
S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer;
86113
S390_lowcore.steal_timer += S390_lowcore.last_update_clock - clock;
87114

88-
/* Do MT utilization calculation */
115+
/* Update MT utilization calculation */
89116
if (smp_cpu_mtid &&
90-
time_after64(jiffies_64, __this_cpu_read(mt_scaling_jiffies))) {
91-
u64 cycles_new[32], *cycles_old;
92-
u64 delta, fac, mult, div;
93-
94-
cycles_old = this_cpu_ptr(mt_cycles);
95-
if (stcctm5(smp_cpu_mtid + 1, cycles_new) < 2) {
96-
fac = 1;
97-
mult = div = 0;
98-
for (i = 0; i <= smp_cpu_mtid; i++) {
99-
delta = cycles_new[i] - cycles_old[i];
100-
div += delta;
101-
mult *= i + 1;
102-
mult += delta * fac;
103-
fac *= i + 1;
104-
}
105-
div *= fac;
106-
if (div > 0) {
107-
/* Update scaling factor */
108-
__this_cpu_write(mt_scaling_mult, mult);
109-
__this_cpu_write(mt_scaling_div, div);
110-
memcpy(cycles_old, cycles_new,
111-
sizeof(u64) * (smp_cpu_mtid + 1));
112-
}
113-
}
114-
__this_cpu_write(mt_scaling_jiffies, jiffies_64);
115-
}
117+
time_after64(jiffies_64, this_cpu_read(mt_scaling_jiffies)))
118+
update_mt_scaling();
116119

117120
user = S390_lowcore.user_timer - ti->user_timer;
118121
S390_lowcore.steal_timer -= user;
@@ -181,6 +184,11 @@ void vtime_account_irq_enter(struct task_struct *tsk)
181184
S390_lowcore.last_update_timer = get_vtimer();
182185
S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer;
183186

187+
/* Update MT utilization calculation */
188+
if (smp_cpu_mtid &&
189+
time_after64(jiffies_64, this_cpu_read(mt_scaling_jiffies)))
190+
update_mt_scaling();
191+
184192
system = S390_lowcore.system_timer - ti->system_timer;
185193
S390_lowcore.steal_timer -= system;
186194
ti->system_timer = S390_lowcore.system_timer;

arch/s390/numa/mode_emu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ static void topology_add_core(struct toptree *core)
368368
cpumask_copy(&top->thread_mask, &core->mask);
369369
cpumask_copy(&top->core_mask, &core_mc(core)->mask);
370370
cpumask_copy(&top->book_mask, &core_book(core)->mask);
371-
cpumask_set_cpu(cpu, node_to_cpumask_map[core_node(core)->id]);
371+
cpumask_set_cpu(cpu, &node_to_cpumask_map[core_node(core)->id]);
372372
top->node_id = core_node(core)->id;
373373
}
374374
}
@@ -383,7 +383,7 @@ static void toptree_to_topology(struct toptree *numa)
383383

384384
/* Clear all node masks */
385385
for (i = 0; i < MAX_NUMNODES; i++)
386-
cpumask_clear(node_to_cpumask_map[i]);
386+
cpumask_clear(&node_to_cpumask_map[i]);
387387

388388
/* Rebuild all masks */
389389
toptree_for_each(core, numa, CORE)

arch/s390/numa/numa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
pg_data_t *node_data[MAX_NUMNODES];
2424
EXPORT_SYMBOL(node_data);
2525

26-
cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
26+
cpumask_t node_to_cpumask_map[MAX_NUMNODES];
2727
EXPORT_SYMBOL(node_to_cpumask_map);
2828

2929
const struct numa_mode numa_mode_plain = {
@@ -144,7 +144,7 @@ void __init numa_setup(void)
144144
static int __init numa_init_early(void)
145145
{
146146
/* Attach all possible CPUs to node 0 for now. */
147-
cpumask_copy(node_to_cpumask_map[0], cpu_possible_mask);
147+
cpumask_copy(&node_to_cpumask_map[0], cpu_possible_mask);
148148
return 0;
149149
}
150150
early_initcall(numa_init_early);

0 commit comments

Comments
 (0)