mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Bristot de Oliveira <bristot@redhat.com>
To: "Vineeth Pillai (Google)" <vineeth@bitbyteword.org>,
	Daniel Bristot de Oliveira <bristot@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org,
	Luca Abeni <luca.abeni@santannapisa.it>,
	Tommaso Cucinotta <tommaso.cucinotta@santannapisa.it>,
	Thomas Gleixner <tglx@linutronix.de>,
	Joel Fernandes <joel@joelfernandes.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Phil Auld <pauld@redhat.com>,
	Suleiman Souhlal <suleiman@google.com>,
	Youssef Esmat <youssefesmat@google.com>
Subject: Re: [PATCH] sched/fair: fix dlserver duplicate start and stop
Date: Wed, 24 Apr 2024 18:56:08 +0200	[thread overview]
Message-ID: <99c1761a-9c00-4167-86e5-8a69cb6d9e5d@redhat.com> (raw)
In-Reply-To: <20240412192304.3201847-1-vineeth@bitbyteword.org>

On 4/12/24 21:23, Vineeth Pillai (Google) wrote:
> dlserver is started when a cfs task is enqueued to an empty runqueue.
> Similarly dlserver is stopped when the last cfs task is dequeued. But
> this logic doesn't take care of the cfs throttling scenarios where the
> root cfs runqueue's h_nr_running stays zero while enqueue/dequeue can
> happen on throttled runqueues. This causes duplicate calls to start/stop
> and causes issues with deadline logic. One example is a WARN_ON in
> task_non_contending because of duplicate calls to dl_server_stop().
> 
> WARNING kernel: [ 1970.747755] ------------[ cut here ]------------
> WARNING kernel: [ 1970.747767] WARNING: CPU: 0 PID: 14202 at kernel/sched/deadline.c:352 task_non_contending+0x404/0x500
> 
> WARNING kernel: [ 1970.747868] CPU: 0 PID: 14202 Comm: tpm_manager_cli Tainted: G  W 5.15.152-22017-ga797d64dcd15 #1
> WARNING kernel: [ 1970.747874] Hardware name: HP Meep/Meep, BIOS Google_Meep.11297.250.0 01/25/2021
> WARNING kernel: [ 1970.747877] RIP: 0010:task_non_contending+0x404/0x500
> 
> WARNING kernel: [ 1970.747910] Call Trace:
> WARNING kernel: [ 1970.747914]  <TASK>
> WARNING kernel: [ 1970.747918]  ? __warn+0xa3/0x131
> WARNING kernel: [ 1970.747923]  ? task_non_contending+0x404/0x500
> WARNING kernel: [ 1970.747927]  ? report_bug+0x97/0xfa
> WARNING kernel: [ 1970.747932]  ? handle_bug+0x41/0x66
> WARNING kernel: [ 1970.747937]  ? exc_invalid_op+0x1b/0x4b
> WARNING kernel: [ 1970.747941]  ? asm_exc_invalid_op+0x16/0x20
> WARNING kernel: [ 1970.747946]  ? task_non_contending+0x404/0x500
> WARNING kernel: [ 1970.747949]  ? dequeue_dl_entity+0x112/0x2cd
> WARNING kernel: [ 1970.747952]  dl_server_stop+0x17/0x2b
> WARNING kernel: [ 1970.747956]  dequeue_task_fair+0x262/0x4c4
> WARNING kernel: [ 1970.747962]  __schedule+0x17c/0xf13
> WARNING kernel: [ 1970.747966]  ? update_load_avg+0x9b/0x611
> WARNING kernel: [ 1970.747970]  schedule+0x4e/0xd0
> WARNING kernel: [ 1970.747974]  schedule_hrtimeout_range_clock+0x10f/0x126
> WARNING kernel: [ 1970.747977]  ? add_wait_queue+0x4d/0x84
> WARNING kernel: [ 1970.747982]  poll_schedule_timeout+0x33/0x50
> WARNING kernel: [ 1970.747987]  do_sys_poll+0x4a3/0x626
> WARNING kernel: [ 1970.747993]  ? __se_sys_ppoll+0xdf/0xdf
> WARNING kernel: [ 1970.748000]  __se_sys_poll+0x70/0xf7
> WARNING kernel: [ 1970.748003]  do_syscall_64+0x51/0xa1
> WARNING kernel: [ 1970.748007]  entry_SYSCALL_64_after_hwframe+0x5c/0xc6
> WARNING kernel: [ 1970.748012] RIP: 0033:0x7bc815769510

I saw that as well.... but from a robot.. not with a reproducer.

> dlserver should be started on an idle root cfs rq, when
>  - enqueue on a non-throttled cfs_rq causing the root cfs rq to
>    go non-idle, or
>  - untthrottle results in the root cfs rq to go non-idle.
> 
> Similarly dlserver should be stopped on a non-idle root cfs rq, when
>  - dequeue on a non-throttled cfs_rq causing the root cfs rq to
>    go idle, or
>  - throttle results in the root cfs rq to go idle.


seem to make sense, I will add this check on v7.

Btw, as this is an ongoing thread discussion, instead of sending a patch, next time,
please reply to the patchset... it is easier for everybody to keep track.

-- Daniel


  reply	other threads:[~2024-04-24 16:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 19:23 Vineeth Pillai (Google)
2024-04-24 16:56 ` Daniel Bristot de Oliveira [this message]
2024-04-24 21:59   ` Vineeth Remanan Pillai

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=99c1761a-9c00-4167-86e5-8a69cb6d9e5d@redhat.com \
    --to=bristot@redhat.com \
    --cc=bristot@kernel.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joel@joelfernandes.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@santannapisa.it \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=pauld@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=skhan@linuxfoundation.org \
    --cc=suleiman@google.com \
    --cc=tglx@linutronix.de \
    --cc=tommaso.cucinotta@santannapisa.it \
    --cc=vincent.guittot@linaro.org \
    --cc=vineeth@bitbyteword.org \
    --cc=vschneid@redhat.com \
    --cc=youssefesmat@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®