From: Davide Libenzi <davidel@xmailserver.org>
To: Hubertus Franke <frankeh@us.ibm.com>
Cc: lse-tech@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: CPU affinity & IPI latency
Date: Mon, 16 Jul 2001 15:56:39 -0700 (PDT) [thread overview]
Message-ID: <XFMail.20010716155639.davidel@xmailserver.org> (raw)
In-Reply-To: <OFEFD69977.739BBF18-ON85256A8B.00763728@pok.ibm.com>
On 16-Jul-2001 Hubertus Franke wrote:
>
> Clean, but in this solutions, you can lock out tasks for a
> several cycles, if indeed several of them where added
> in the time before we can service the IPI on the target cpu.
> You can end up with strange priority inversion problems,
> because these tasks aren't seen by the general scheduler
> or let alone are on the runqueue.
> That's why I opted in my design for a single slot.
The idea of list was kind of extension, but to solve this particular problem we
just need a single task ( with no extra member in task_struct ) pointer.
> One could opt for the following implementation to ensure only
> a single waiting task, namely put the already enqueued one back
> if the goodness is worse.
>
>
> static inline void wpush(aligned_data * ad, struct task_struct * tsk) {
> if (ad->wlist &&
> (preemption_goodness(tsk,ad->wlist,ad->curr->mm) > 0))
> {
> add_to_runqueue(ad->wlist,tsk);
> if (task_on_runqueue(tsk))
> list_del(&tsk->run_list);
> /* obsolete now tsk->wlist_next = ad->wlist; */
> ad->wlist = tsk;
> }
> }
wpush() must be called only if *) the target is idle <and> *) the list ( slot )
is empty.
I won't add the goodness checking in there.
Yes, it could happen that another task with greater goodness needs a CPU to run
and, w/o goodness checking this could not be rescheduled on the idle.
But think about at what would happen if the IPI had a zero time response.
The idle would be running the old ( listed or slotted ) task and the CPU would
not be idle anymore.
>
> I also don't like the fact that with reschedule_idle() you
> just put the task into the runqueue, then you take it out again,
> just to put it back into it after the IPI and that as it seems
> on every reschedule_idle() path.
You can "suspend" the task even by adding an extra field inside the task
struct and add checking of this field around inside the code.
The list removal does not need you to spread extra checking into the code.
It's a simple method to hide a task without modifying a bunch of code.
> In my design one simply wouldn't send the IPI to a target CPU that
> has a pending IPI waiting and preemption wouldn't happen based on
> the goodness values.
You do exactly that with this solution, you reserve the task for
the target idle.
What do You mean with "preemption wouldn't happen based on the goodness values"?
> I grant, that my design seems a bit more intrusive on the code,
> but you were argueing just yesterday not to get stuck up with
> closeness to the current code and semantics.
Pls, don't make me say this stuff.
My was not to make the code more intrusive but, on the contrary, to make it
light by relaxing, in some aspect, the SMP scheduler behaviour compatibility.
I already expressed my opinion about that in previous emails.
- Davide
next prev parent reply other threads:[~2001-07-16 22:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-16 21:45 CPU affinity & IPI latency Hubertus Franke
2001-07-16 22:56 ` Davide Libenzi [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-07-16 18:26 Hubertus Franke
2001-07-16 10:10 Hubertus Franke
2001-07-16 16:16 ` Davide Libenzi
2001-07-14 3:25 Hubertus Franke
2001-07-16 16:14 ` Mike Kravetz
2001-07-16 21:25 ` Davide Libenzi
2001-07-12 23:40 Mike Kravetz
2001-07-13 0:22 ` Davide Libenzi
2001-07-13 0:36 ` Larry McVoy
2001-07-13 2:06 ` Mark Hahn
2001-07-13 16:41 ` Davide Libenzi
2001-07-13 17:31 ` Mike Kravetz
2001-07-13 19:17 ` Davide Libenzi
2001-07-13 17:05 ` Mike Kravetz
2001-07-13 19:51 ` David Lang
2001-07-13 22:43 ` Mike Kravetz
2001-07-15 20:02 ` Davide Libenzi
2001-07-15 20:15 ` Andi Kleen
2001-07-15 20:31 ` Davide Libenzi
2001-07-13 19:54 ` Chris Wedgwood
2001-07-15 7:42 ` Troy Benjegerdes
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=XFMail.20010716155639.davidel@xmailserver.org \
--to=davidel@xmailserver.org \
--cc=frankeh@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
/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