Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262497AbTHUHtZ (ORCPT ); Thu, 21 Aug 2003 03:49:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262520AbTHUHtY (ORCPT ); Thu, 21 Aug 2003 03:49:24 -0400 Received: from pop.gmx.net ([213.165.64.20]:8407 "HELO mail.gmx.net") by vger.kernel.org with SMTP id S262497AbTHUHtT (ORCPT ); Thu, 21 Aug 2003 03:49:19 -0400 Message-Id: <5.2.1.1.2.20030821090657.00b45af8@pop.gmx.net> X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Thu, 21 Aug 2003 09:53:15 +0200 To: Con Kolivas From: Mike Galbraith Subject: Re: [PATCH] O17int Cc: Voluspa , linux kernel mailing list , Andrew Morton In-Reply-To: <200308211526.01796.kernel@kolivas.org> References: <200308210723.42789.kernel@kolivas.org> <200308200102.04155.kernel@kolivas.org> <20030820162736.GA711@gmx.de> <200308210723.42789.kernel@kolivas.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_12798906==_" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6842 Lines: 110 --=====================_12798906==_ Content-Type: text/plain; charset="us-ascii"; format=flowed At 03:26 PM 8/21/2003 +1000, Con Kolivas wrote: >Unhappy with this latest O16.3-O17int patch I'm withdrawing it, and >recommending nothing on top of O16.3 yet. > >More and more it just seems to be a bandaid to the priority inverting spin on >waiters, and it does seem to be of detriment to general interacivity. I can >now reproduce some loss of interactive feel with O17. > >Something specific for the spin on waiters is required that doesn't affect >general performance. The fact that I can reproduce the same starvation in >vanilla 2.6.0-test3 but to a lesser extent means this is an intrinsic problem >that needs a specific solution. I can see only one possible answer to this - never allow a normal task to hold the cpu for long stretches (define) while there are other tasks runnable. (see attachment) I think the _easiest_ fix for this particular starvation (without tossing baby out with bath water;) is to try to "down-shift" in schedule() when next == prev. This you can do very cheaply with a find_next_bit(). That won't help the case where there are multiple tasks involved, but should fix the most common case for dirt cheap. (another simple alternative is to globally "down-shift" periodically) The most generally effective form of the "down-shift" anti-starvation tactic that I've tried, is to periodically check the head of all queues below current position (can do very quickly), and actively select the oldest task who hasn't run since some defined deadline. Queues are serviced based upon priority most of the time, and based upon age some of the time. Everything I've tried along these lines has a common upside: works, and downside: butt ugly :) -Mike --=====================_12798906==_ Content-Type: application/octet-stream; name="strace-blender" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="strace-blender" PFNOSVA+CjEwNjE0NDU4MTAuODEyNDU0IHNvY2tldChQRl9VTklYLCBTT0NLX1NUUkVBTSwgMCkg PSAzIDwwLjAwMDA3Mz4KMTA2MTQ0NTgxMC44MTI3MDQgdW5hbWUoe3N5cz0iTGludXgiLCBub2Rl PSJtaWtlZyIsIC4uLn0pID0gMCA8MC4wMDAwMjA+CjEwNjE0NDU4MTAuODEzMDE0IHVuYW1lKHtz eXM9IkxpbnV4Iiwgbm9kZT0ibWlrZWciLCAuLi59KSA9IDAgPDAuMDAwMDE5PgoxMDYxNDQ1ODEw LjgxMzQwMCBjb25uZWN0KDMsIHtzaW5fZmFtaWx5PUFGX1VOSVgsIHBhdGg9Ii90bXAvLlgxMS11 bml4L1gwIn0sIDE5KSA9IDAgPDAuMDAwMzcyPgoxMDYxNDQ1ODEwLjgxMzk4OCB1bmFtZSh7c3lz PSJMaW51eCIsIG5vZGU9Im1pa2VnIiwgLi4ufSkgPSAwIDwwLjAwMDAyMT4KMTA2MTQ0NTgxMC44 MTQzNDUgZmNudGw2NCgzLCBGX1NFVEZELCBGRF9DTE9FWEVDKSA9IDAgPDAuMDAwMDIxPgoxMDYx NDQ1ODEwLjgxNDYwMCBhY2Nlc3MoIi9yb290Ly5YYXV0aG9yaXR5IiwgUl9PSykgPSAwIDwwLjAw MDAzNj4KMTA2MTQ0NTgxMC44MTQ4MDQgb3BlbigiL3Jvb3QvLlhhdXRob3JpdHkiLCBPX1JET05M WSkgPSA0IDwwLjAwMDA1N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Bpb2N0bCgzLCBGSU9OUkVBRCwgWzMyXSkgPSAwIDwwLjAwMTgyND4KMTA2MTQ0 NTgzNi4zMDg5MzUgcmVhZCgzLCAiXDZcMFwzNTdcIlwyM1wzNlwzMiM/XDBcMFwwXDJcMFwzMDBc MVwwXDBcMFwwXDBcMHBcMVwwIi4uLiwgMzIpID0gMzIgPDAuMDAwMDI4PgoxMDYxNDQ1ODM2LjMw OTE5NCBnZXR0aW1lb2ZkYXkoezEwNjE0NDU4MzYsIDMwOTI0MH0sIE5VTEwpID0gMCA8MC4wMDAw MTk+CjEwNjE0NDU4MzYuMzA5MzMxIGlvY3RsKDMsIEZJT05SRUFELCBbMF0pID0gMCA8MC4wMDAw MjE+CjEwNjE0NDU4MzYuMzA5NDk2IHdyaXRlKDMsICIobFw0XDA/XDBcMFwwXDJcMFwzMDBcMVww XDBwXDEiLCAxNikgPSAxNiA8MC4wMDAwMjk+CjEwNjE0NDU4MzYuMzA5NjcyIHJlYWQoMywgMHhi ZmZmZjJjNCwgMzIpID0gLTEgRUFHQUlOIChSZXNvdXJjZSB0ZW1wb3JhcmlseSB1bmF2YWlsYWJs ZSkgPDAuMDAwMDIyPgo= --=====================_12798906==_-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/