From: Phil Auld <pauld@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: [PATCH] sched: use rq_lock/unlock in online_fair_sched_group
Date: Thu, 1 Aug 2019 09:37:49 -0400 [thread overview]
Message-ID: <20190801133749.11033-1-pauld@redhat.com> (raw)
Enabling WARN_DOUBLE_CLOCK in /sys/kernel/debug/sched_features causes
warning to fire in update_rq_clock. This seems to be caused by onlining
a new fair sched group not using the rq lock wrappers.
[472978.683085] rq->clock_update_flags & RQCF_UPDATED
[472978.683100] WARNING: CPU: 5 PID: 54385 at kernel/sched/core.c:210 update_rq_clock+0xec/0x150
[472978.758465] Modules linked in: fuse vfat msdos fat ext4 mbcache jbd2 sunrpc iTCO_wdt gpio_ich iTCO_vendor_support intel_powerclamp coretemp kvm_intel kvm ipmi_ssif irqbypass ipmi_si crct10dif_pclmul crc32_pclmul ghash_clmulni_intel joydev pcspkr intel_cstate acpi_power_meter ipmi_devintf sg intel_uncore i7core_edac hpilo hpwdt lpc_ich ipmi_msghandler acpi_cpufreq ip_tables xfs libcrc32c sr_mod sd_mod cdrom ata_generic radeon i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm ata_piix drm myri10ge hpsa libata serio_raw crc32c_intel scsi_transport_sas netxen_nic dca dm_mirror dm_region_hash dm_log dm_mod
[472979.050101] CPU: 5 PID: 54385 Comm: cgcreate Not tainted 5.2.0-rc6+ #135
[472979.089586] Hardware name: HP ProLiant DL580 G7, BIOS P65 08/16/2015
[472979.123638] RIP: 0010:update_rq_clock+0xec/0x150
[472979.146435] Code: a8 04 0f 84 55 ff ff ff 80 3d 93 34 2c 01 00 0f 85 48 ff ff ff 48 c7 c7 08 b9 a8 b7 31 c0 c6 05 7d 34 2c 01 01 e8 04 21 fd ff <0f> 0b 8b 83 b0 09 00 00 e9 26 ff ff ff e8 72 c3 f5 ff 66 90 4c 8b
[472979.247671] RSP: 0018:ffffa9addac67d48 EFLAGS: 00010086
[472979.277071] RAX: 0000000000000000 RBX: ffff9db3ff62a380 RCX: 0000000000000000
[472979.314842] RDX: 0000000000000005 RSI: ffffffffb8434a45 RDI: ffffffffb84325ec
[472979.352189] RBP: 0000000000000000 R08: ffffffffb8434a20 R09: ffffffb27562d751
[472979.389326] R10: 000000000000d471 R11: ffffa9addac67a58 R12: ffff9d8a1c9d5a00
[472979.425255] R13: ffff9db3fbbed400 R14: 000000000002a380 R15: 0000000000000000
[472979.462417] FS: 00007f6a8218cb80(0000) GS:ffff9db3ff740000(0000) knlGS:0000000000000000
[472979.511306] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[472979.543386] CR2: 00007f6a82198000 CR3: 0000003f33f16005 CR4: 00000000000206e0
[472979.578646] Call Trace:
[472979.591702] online_fair_sched_group+0x53/0x100
[472979.618172] cpu_cgroup_css_online+0x16/0x20
[472979.640264] online_css+0x1c/0x60
[472979.657648] cgroup_apply_control_enable+0x231/0x3b0
[472979.684979] cgroup_mkdir+0x41b/0x530
[472979.704845] kernfs_iop_mkdir+0x61/0xa0
[472979.726278] vfs_mkdir+0x108/0x1a0
[472979.745665] do_mkdirat+0x77/0xe0
[472979.764981] do_syscall_64+0x55/0x1d0
[472979.785990] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Using the wrappers in online_fair_sched_group instead of the raw locking
removes this warning.
Signed-off-by: Phil Auld <pauld@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
---
Resend with PATCH instead of CHANGE in subject, and more recent upstream x86 backtrace.
kernel/sched/fair.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 036be95a87e9..5c1299a5675c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10242,17 +10242,17 @@ void online_fair_sched_group(struct task_group *tg)
{
struct sched_entity *se;
struct rq *rq;
+ struct rq_flags rf;
int i;
for_each_possible_cpu(i) {
rq = cpu_rq(i);
se = tg->se[i];
-
- raw_spin_lock_irq(&rq->lock);
+ rq_lock(rq, &rf);
update_rq_clock(rq);
attach_entity_cfs_rq(se);
sync_throttle(tg, i);
- raw_spin_unlock_irq(&rq->lock);
+ rq_unlock(rq, &rf);
}
}
--
2.18.0
next reply other threads:[~2019-08-01 13:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 13:37 Phil Auld [this message]
2019-08-05 14:06 ` [PATCH] sched: use rq_lock/unlock in online_fair_sched_group Phil Auld
2019-08-06 13:03 ` Peter Zijlstra
2019-08-06 13:58 ` Phil Auld
2019-08-09 13:33 ` Phil Auld
2019-08-09 17:43 ` Valentin Schneider
2019-08-15 13:39 ` Phil Auld
2019-08-08 11:01 ` [tip:sched/core] sched/fair: Use " tip-bot for Phil Auld
2019-08-09 16:21 ` Dietmar Eggemann
2019-08-09 17:28 ` Phil Auld
2019-08-12 9:56 ` Dietmar Eggemann
2019-08-12 12:52 ` tip-bot for Phil Auld
2019-08-12 13:13 ` Phil Auld
[not found] <20190806060416.11440-1-hdanton@sina.com>
2019-08-06 12:58 ` [PATCH] sched: use " Phil Auld
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=20190801133749.11033-1-pauld@redhat.com \
--to=pauld@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.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.