linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry Adamushko" <dmitry.adamushko@gmail.com>
To: "Jarek Poplawski" <jarkao2@o2.pl>
Cc: "Ingo Molnar" <mingo@elte.hu>,
	"David Schwartz" <davids@webmaster.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Network slowdown due to CFS
Date: Wed, 3 Oct 2007 12:55:34 +0200	[thread overview]
Message-ID: <b647ffbd0710030355p116f9b36vae3f24e652921de6@mail.gmail.com> (raw)
In-Reply-To: <20071003095057.GD1726@ff.dom.local>

[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]

On 03/10/2007, Jarek Poplawski <jarkao2@o2.pl> wrote:
> I can't see anything about clearing. I think, this was about charging,
> which should change the key enough, to move a task to, maybe, a better
> place in a que (tree) than with current ways.

just a quick patch, not tested and I've not evaluated all possible
implications yet.
But someone might give it a try with his/(her -- are even more
welcomed :-) favourite sched_yield() load.

(and white space damaged)

--- sched_fair-old.c    2007-10-03 12:45:17.010306000 +0200
+++ sched_fair.c        2007-10-03 12:44:46.899851000 +0200
@@ -803,7 +803,35 @@ static void yield_task_fair(struct rq *r
                update_curr(cfs_rq);

                return;
+       } else if (sysctl_sched_compat_yield == 2) {
+               unsigned long ideal_runtime, delta_exec,
+                             delta_exec_weighted;
+
+               __update_rq_clock(rq);
+               /*
+                * Update run-time statistics of the 'current'.
+                */
+               update_curr(cfs_rq);
+
+               /*
+                * Emulate (speed up) the effect of us being preempted
+                * by scheduler_tick().
+                */
+               ideal_runtime = sched_slice(cfs_rq, curr);
+               delta_exec = curr->sum_exec_runtime -
curr->prev_sum_exec_runtime;
+
+               if (ideal_runtime > delta_exec) {
+                       delta_exec_weighted = ideal_runtime - delta_exec;
+
+                       if (unlikely(curr->load.weight != NICE_0_LOAD)) {
+                               delta_exec_weighted =
calc_delta_fair(delta_exec_weighted,
+
 &se->load);
+                       }
+                       se->vruntime += delta_exec_weighted;
+               }
+               return;
        }
+
        /*
         * Find the rightmost entry in the rbtree:
         */


>
> Jarek P.
>

-- 
Best regards,
Dmitry Adamushko

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: yield.patch --]
[-- Type: text/x-patch; name="yield.patch", Size: 1012 bytes --]

--- sched_fair-old.c	2007-10-03 12:45:17.010306000 +0200
+++ sched_fair.c	2007-10-03 12:44:46.899851000 +0200
@@ -803,7 +803,35 @@ static void yield_task_fair(struct rq *r
 		update_curr(cfs_rq);
 
 		return;
+	} else if (sysctl_sched_compat_yield == 2) {
+		unsigned long ideal_runtime, delta_exec,
+			      delta_exec_weighted;
+
+		__update_rq_clock(rq);
+		/*
+		 * Update run-time statistics of the 'current'.
+		 */
+		update_curr(cfs_rq);
+
+		/*
+		 * Emulate the effect of us being preempted
+		 * by scheduler_tick().
+		 */
+		ideal_runtime = sched_slice(cfs_rq, curr);
+		delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
+
+		if (ideal_runtime > delta_exec) {
+			delta_exec_weighted = ideal_runtime - delta_exec;
+
+			if (unlikely(curr->load.weight != NICE_0_LOAD)) {
+				delta_exec_weighted = calc_delta_fair(delta_exec_weighted,
+									&se->load);
+			}
+			se->vruntime += delta_exec_weighted;
+		}
+		return;
 	}
+
 	/*
 	 * Find the rightmost entry in the rbtree:
 	 */

  reply	other threads:[~2007-10-03 10:56 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-26  8:52 Network slowdown due to CFS Martin Michlmayr
2007-09-26  9:34 ` Ingo Molnar
2007-09-26  9:47   ` Ingo Molnar
2007-09-26 10:08     ` Martin Michlmayr
2007-09-26 10:18       ` Ingo Molnar
2007-09-26 10:20 ` Mike Galbraith
2007-09-26 10:23 ` Mike Galbraith
2007-09-26 10:48   ` Martin Michlmayr
2007-09-26 11:21     ` Ingo Molnar
2007-09-26 11:29       ` Martin Michlmayr
2007-09-26 12:00         ` David Schwartz
2007-09-26 13:31           ` Ingo Molnar
2007-09-26 15:40             ` Stephen Hemminger
2007-09-26 15:46             ` Stephen Hemminger
2007-09-27  9:30             ` Jarek Poplawski
2007-09-27  9:46               ` Ingo Molnar
2007-09-27 12:27                 ` Jarek Poplawski
2007-09-27 13:31                   ` Ingo Molnar
2007-09-27 14:42                     ` Jarek Poplawski
2007-09-28  6:10                       ` Nick Piggin
2007-10-01  8:43                         ` Jarek Poplawski
2007-10-01 16:25                           ` Ingo Molnar
2007-10-01 16:49                             ` David Schwartz
2007-10-01 17:31                               ` Ingo Molnar
2007-10-01 18:23                                 ` David Schwartz
2007-10-02  6:06                                   ` Ingo Molnar
2007-10-02  6:47                                     ` Andi Kleen
2007-10-03  8:02                                     ` Jarek Poplawski
2007-10-03  8:16                                       ` Ingo Molnar
2007-10-03  8:56                                         ` Jarek Poplawski
2007-10-03  9:10                                           ` Ingo Molnar
2007-10-03  9:50                                             ` Jarek Poplawski
2007-10-03 10:55                                               ` Dmitry Adamushko [this message]
2007-10-03 10:58                                                 ` Dmitry Adamushko
2007-10-03 11:20                                                   ` Jarek Poplawski
2007-10-03 11:22                                                 ` Ingo Molnar
2007-10-03 11:40                                                 ` Jarek Poplawski
2007-10-03 11:56                                                   ` yield Ingo Molnar
2007-10-03 12:16                                                     ` yield Jarek Poplawski
2007-10-07  7:18                                               ` Network slowdown due to CFS Ingo Molnar
2007-10-04  5:33                                             ` Casey Dahlin
2007-10-02  6:08                                   ` Ingo Molnar
2007-10-02  6:26                                   ` Ingo Molnar
2007-10-02  6:46                                   ` yield API Ingo Molnar
2007-10-02 11:50                                     ` linux-os (Dick Johnson)
2007-10-02 15:24                                       ` Douglas McNaught
2007-10-02 21:57                                     ` Eric St-Laurent
2007-12-12 22:39                                     ` Jesper Juhl
2007-12-13  4:43                                       ` Kyle Moffett
2007-12-13 20:10                                         ` David Schwartz
2007-10-01 19:53                               ` Network slowdown due to CFS Arjan van de Ven
2007-10-01 22:17                                 ` David Schwartz
2007-10-01 22:35                                   ` Arjan van de Ven
2007-10-01 22:44                                     ` David Schwartz
2007-10-01 22:55                                       ` Arjan van de Ven
2007-10-02 15:37                                         ` David Schwartz
2007-10-03  7:15                                           ` Jarek Poplawski
2007-10-03 11:31                               ` Helge Hafting
2007-10-04  0:31                               ` Rusty Russell
2007-10-01 16:55                             ` Chris Friesen
2007-10-01 17:09                               ` Ingo Molnar
2007-10-01 17:45                                 ` Chris Friesen
2007-10-01 19:09                                   ` iperf yield usage Ingo Molnar
2007-10-02  9:03                             ` Network slowdown due to CFS Jarek Poplawski
2007-10-02 13:39                               ` Jarek Poplawski
2007-10-02  9:26                           ` Jarek Poplawski
2007-09-27  9:49         ` Ingo Molnar
2007-09-27 10:54           ` Martin Michlmayr
2007-09-27 10:56             ` Ingo Molnar
2007-09-27 11:12               ` Martin Michlmayr
2007-10-01 22:27 Hubert Tonneau

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=b647ffbd0710030355p116f9b36vae3f24e652921de6@mail.gmail.com \
    --to=dmitry.adamushko@gmail.com \
    --cc=davids@webmaster.com \
    --cc=jarkao2@o2.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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;
as well as URLs for NNTP newsgroup(s).