Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756041Ab2FFLUJ (ORCPT ); Wed, 6 Jun 2012 07:20:09 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:59245 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755899Ab2FFLUH (ORCPT ); Wed, 6 Jun 2012 07:20:07 -0400 MIME-Version: 1.0 Date: Wed, 6 Jun 2012 19:20:03 +0800 Message-ID: Subject: [ANNOUNCE][PATCH 06/06]RIFS v4 release. All the complex idea is gone. From: Chen To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Con Kolivas , Peter Zijlstra , Juri Lelli , Linus Torvalds Content-Type: multipart/mixed; boundary=e89a8f9218ecfb069504c1cbf227 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 329270 Lines: 4291 --e89a8f9218ecfb069504c1cbf227 Content-Type: text/plain; charset=ISO-8859-1 http://code.google.com/p/rifs-scheduler/downloads/detail?name=rifs-v4-kernel3.3.x This version of RIFS is the most easiest one. I have removed a lot of complex things from v3 and it is implement in a simple algorithm. When a task sleep, the priority of it will raise.When a task spend all its timeslice, the priority of it will drop. Then when the priority of a tack touched the top priority or the bottom priority, the prio will become its original priority minus/plus(The priority touched the top/bottom) rotary_spin.The default value of rotary_spin is 5. It is tunable and non-root user can also tune it (/proc/sys/kernel/rotary_spin). Chen --e89a8f9218ecfb069504c1cbf227 Content-Type: application/octet-stream; name="rifs-v4-kernel3.3.x" Content-Disposition: attachment; filename="rifs-v4-kernel3.3.x" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h34b0xiv0 ZGlmZiAtcnVOIGxpbnV4LTMuMy41L2FyY2gvcG93ZXJwYy9wbGF0Zm9ybXMvY2VsbC9zcHVmcy9z Y2hlZC5jIGxpbnV4LTMuMy41LVJJRlMvYXJjaC9wb3dlcnBjL3BsYXRmb3Jtcy9jZWxsL3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GluZSB2b2lkIHRza19jcHVzX2N1cnJlbnQoc3RydWN0IHRhc2tfc3RydWN0ICpwKQor eworfQorCitzdGF0aWMgaW5saW5lIGludCBydW5xdWV1ZV9pc19sb2NrZWQoaW50IGNwdSkKK3sK KwlyZXR1cm4gZ3J1bnF1ZXVlX2lzX2xvY2tlZCgpOworfQorCit2b2lkIHByaW50X3NjaGVkdWxl cl92ZXJzaW9uKHZvaWQpOworCisjZWxzZSAvKiBDRlMgKi8KK2V4dGVybiBpbnQgcnVucXVldWVf aXNfbG9ja2VkKGludCBjcHUpOworc3RhdGljIGlubGluZSB2b2lkIGNwdV9zY2FsaW5nKGludCBj cHUpCit7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBjcHVfbm9uc2NhbGluZyhpbnQgY3B1KQor eworfQorI2RlZmluZSB0c2tfc2VydW50aW1lKHQpCSgodCktPnNlLnN1bV9leGVjX3J1bnRpbWUp CisjZGVmaW5lIHRza19ydHRpbWVvdXQodCkJKCh0KS0+cnQudGltZW91dCkKKworc3RhdGljIGlu bGluZSB2b2lkIHRza19jcHVzX2N1cnJlbnQoc3RydWN0IHRhc2tfc3RydWN0ICpwKQoreworCXAt PnJ0Lm5yX2NwdXNfYWxsb3dlZCA9IGN1cnJlbnQtPnJ0Lm5yX2NwdXNfYWxsb3dlZDsKK30KKwor c3RhdGljIGlubGluZSB2b2lkIHByaW50X3NjaGVkdWxlcl92ZXJzaW9uKHZvaWQpCit7CisJcHJp bnRrKEtFUk5fSU5GTyJDRlMgQ1BVIHNjaGVkdWxlci5cbiIpOworfQorCisvKiBBbnlvbmUgZmVl bCBsaWtlIGltcGxlbWVudGluZyB0aGlzPyAqLworc3RhdGljIGlubGluZSBib29sIGFib3ZlX2Jh Y2tncm91bmRfbG9hZCh2b2lkKQoreworCXJldHVybiBmYWxzZTsKK30KKyNlbmRpZiAvKiBDT05G SUdfU0NIRURfUklGUyAqLworCiAvKiBGdXR1cmUtc2FmZSBhY2Nlc3NvciBmb3Ig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odm9pZCkKKwlfX2FjcXVpcmVzKGdycS5sb2NrKQoreworCXJhd19zcGluX2xvY2so JmdycS5sb2NrKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIGdycV91bmxvY2sodm9pZCkKKwlf X3JlbGVhc2VzKGdycS5sb2NrKQoreworCXJhd19zcGluX3VubG9jaygmZ3JxLmxvY2spOworfQor CitzdGF0aWMgaW5saW5lIHZvaWQgZ3JxX2xvY2tfaXJxKHZvaWQpCisJX19hY3F1aXJlcyhncnEu bG9jaykKK3sKKwlyYXdfc3Bpbl9sb2NrX2lycSgmZ3JxLmxvY2spOworfQorCitzdGF0aWMgaW5s aW5lIHZvaWQgdGltZV9sb2NrX2dycShzdHJ1Y3QgcnEgKnJxKQorCV9fYWNxdWlyZXMoZ3JxLmxv Y2spCit7CisJZ3JxX2xvY2soKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIGdycV91bmxvY2tf aXJxKHZvaWQpCisJX19yZWxlYXNlcyhncnEubG9jaykKK3sKKwlyYXdfc3Bpbl91bmxvY2tfaXJx KCZncnEubG9jayk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBncnFfbG9ja19pcnFzYXZlKHVu c2lnbmVkIGxvbmcgKmZsYWdzKQorCV9fYWNxdWlyZXMoZ3JxLmxvY2spCit7CisJcmF3X3NwaW5f bG9ja19pcnFzYXZlKCZncnEubG9jaywgKmZsYWdzKTsKK30KKworc3RhdGljIGlubGluZSB2b2lk IGdycV91bmxvY2tfaXJxcmVzdG9yZSh1bnNpZ25lZCBsb25nICpmbGFncykKKwlfX3JlbGVhc2Vz KGdycS5sb2NrKQoreworCXJhd19zcGluX3VubG9ja19pcnFyZXN0b3JlKCZncnEubG9jaywgKmZs YWdzKTsKK30KKworc3RhdGljIGlubGluZSBzdHJ1Y3QgcnEKKyp0YXNrX2dycV9sb2NrKHN0cnVj dCB0YXNrX3N0cnVjdCAqcCwgdW5zaWduZWQgbG9uZyAqZmxhZ3MpCisJX19hY3F1aXJ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o= --e89a8f9218ecfb069504c1cbf227-- -- 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/