Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1517446
| From | Luca Abeni <luca.abeni@unitn.it> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC v3 1/6] Track the active utilisation |
| Date | 2016-11-08 19:20 +0100 |
| Message-ID | <sBja2-4re-27@gated-at.bofh.it> (permalink) |
| References | <svO6S-ak-7@gated-at.bofh.it> <svO6S-ak-23@gated-at.bofh.it> <syKq5-2Hy-1@gated-at.bofh.it> <syODo-5xo-43@gated-at.bofh.it> <sBiQG-40g-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Juri,
On Tue, 8 Nov 2016 17:56:35 +0000
Juri Lelli <juri.lelli@arm.com> wrote:
[...]
> > > > static void switched_to_dl(struct rq *rq, struct task_struct
> > > > *p) {
> > > > + add_running_bw(&p->dl, &rq->dl);
> > > >
> > > > /* If p is not queued we will update its parameters at
> > > > next wakeup. */ if (!task_on_rq_queued(p))
> > >
> > > Don't we also need to remove bw in task_dead_dl()?
> > I think task_dead_dl() is invoked after invoking dequeue_task_dl(),
> > which takes care of this... Or am I wrong? (I think I explicitly
> > tested this, and modifications to task_dead_dl() turned out to be
> > unneeded)
> >
>
> Mmm. You explicitly check that TASK_ON_RQ_MIGRATING or DEQUEUE_SLEEP
> (which btw can be actually put together with an or condition), so I
> don't think that any of those turn out to be true when the task dies.
I might be very wrong here, but I think do_exit() just does something
like
tsk->state = TASK_DEAD;
and then invokes schedule(), and __schedule() does
if (!preempt && prev->state) {
if (unlikely(signal_pending_state(prev->state, prev))) {
prev->state = TASK_RUNNING;
} else {
deactivate_task(rq, prev, DEQUEUE_SLEEP);
[...]
so dequeue_task_dl() will see DEQUEUE_SLEEP... Or am I misunderstanding
what you are saying?
> Also, AFAIU, do_exit() works on current and the TASK_DEAD case is
> handled in finish_task_switch(), so I don't think we are taking care
> of the "task is dying" condition.
Ok, so I am missing something... The state is set to TASK_DEAD, and
then schedule() is called... So, __schedule() sees the dying task as
"prev" and invokes deactivate_task() with the DEQUEUE_SLEEP flag...
After that, finish_task_switch() calls task_dead_dl(). Is this wrong?
If not, why aren't we taking care of the "task is dying" condition?
> Peter, does what I'm saying make any sense? :)
>
> I still have to set up things here to test these patches (sorry, I was
> travelling), but could you try to create some tasks and that kill them
> from another shell to see if the accounting deviates or not? Or did
> you already do this test?
I think this is one of the tests I tried...
I have to check if I changed this code after the test (but I do not
think I did). Anyway, tomorrow I'll write a script for automating this
test, and I'll leave it running for some hours.
Luca
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC v3 1/6] Track the active utilisation Juri Lelli <juri.lelli@arm.com> - 2016-11-01 17:50 +0100
Re: [RFC v3 1/6] Track the active utilisation luca abeni <luca.abeni@unitn.it> - 2016-11-01 22:20 +0100
Re: [RFC v3 1/6] Track the active utilisation Juri Lelli <juri.lelli@arm.com> - 2016-11-08 19:00 +0100
Re: [RFC v3 1/6] Track the active utilisation Luca Abeni <luca.abeni@unitn.it> - 2016-11-08 19:20 +0100
Re: [RFC v3 1/6] Track the active utilisation Juri Lelli <juri.lelli@arm.com> - 2016-11-08 20:00 +0100
Re: [RFC v3 1/6] Track the active utilisation Luca Abeni <luca.abeni@unitn.it> - 2016-11-08 20:20 +0100
Re: [RFC v3 1/6] Track the active utilisation Juri Lelli <juri.lelli@arm.com> - 2016-11-08 21:10 +0100
Re: [RFC v3 1/6] Track the active utilisation luca abeni <luca.abeni@unitn.it> - 2016-11-09 16:30 +0100
Re: [RFC v3 1/6] Track the active utilisation luca abeni <luca.abeni@unitn.it> - 2016-11-09 17:30 +0100
csiph-web