Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266861AbUFXSMU (ORCPT ); Thu, 24 Jun 2004 14:12:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266856AbUFXSLm (ORCPT ); Thu, 24 Jun 2004 14:11:42 -0400 Received: from cfcafw.SGI.COM ([198.149.23.1]:52092 "EHLO omx1.americas.sgi.com") by vger.kernel.org with ESMTP id S266844AbUFXSJO (ORCPT ); Thu, 24 Jun 2004 14:09:14 -0400 Date: Thu, 24 Jun 2004 13:08:56 -0500 From: Erik Jacobson To: linux-kernel@vger.kernel.org cc: jlan@engr.sgi.com, limin@engr.sgi.com, pwil3058@bigpond.net.au Subject: [PATCH] Process Aggregates (PAGG) for 2.6.7 Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-2136806248-1308750959-1088100536=:340142" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 40513 Lines: 679 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---2136806248-1308750959-1088100536=:340142 Content-Type: TEXT/PLAIN; charset=US-ASCII Attached is a PAGG patch to kernel 2.6.7. The maintainers of two patches that make use of PAGG will post their patches in to this discussion thread shortly. The biggest change in this patch from the last one I posted is that Peter Williams supplied an implementation for the init function pointer in the pagg hook. We kicked this around a few times to flush out locking issues. Thanks to Robin Holt for helping me with that. A bug was found by Dean Roe and fixed - we had to move our pagg_attach call in fork.c. There a couple other minor changes too. Signed-off-by: Erik Jacobson -- Erik Jacobson - Linux System Software - Silicon Graphics - Eagan, Minnesota ---2136806248-1308750959-1088100536=:340142 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=pagg Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pagg SW5kZXg6IGxpbnV4L0RvY3VtZW50YXRpb24vcGFnZy50eHQNCj09PT09PT09 PT09P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VjY2VzcyAqLw0KIAkJc2Vj dXJpdHlfYnBybV9mcmVlKCZicHJtKTsNCkluZGV4OiBsaW51eC9pbmNsdWRl L2xpbnV4L2luaXRfdGFzay5oDQo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQot LS0gbGludXgub3JpZy9pbmNsdWRlL2xpbnV4L2luaXRfdGFzay5oDQorKysg bGludXgvaW5jbHVkZS9saW51eC9pbml0X3Rhc2suaA0KQEAgLTIsNiArMiw3 IEBADQogI2RlZmluZSBfTElOVVhfX0lOSVRfVEFTS19IDQogDQogI2luY2x1 ZGUgPGxpbnV4L2ZpbGUuaD4NCisjaW5jbHVkZSA8bGludXgvcGFnZy5oPg0K IA0KICNkZWZpbmUgSU5JVF9GSUxFUyBcDQogeyAJCQkJCQkJXA0KQEAgLTEx Miw2ICsxMTMsNyBAQA0KIAkucHJvY19sb2NrCT0gU1BJTl9MT0NLX1VOTE9D S0VELAkJCQlcDQogCS5zd2l0Y2hfbG9jawk9IFNQSU5fTE9DS19VTkxPQ0tF RCwJCQkJXA0KIAkuam91cm5hbF9pbmZvCT0gTlVMTCwJCQkJCQlcDQorCUlO SVRfVEFTS19QQUdHKHRzaykJCQkJCQlcDQogfQ0KIA0KIA0KSW5kZXg6IGxp bnV4L2luY2x1ZGUvbGludXgvcGFnZy5oDQo9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09DQotLS0gL2Rldi9udWxsDQorKysgbGludXgvaW5jbHVkZS9saW51eC9w YWdnLmgNCkBAIC0wLDAgKzEsMjAyIEBADQorLyogDQorICogUEFHRyAoUHJv Y2VzcyBBZ2dyZWdhdGVzKSBpbnRlcmZhY2UNCisgKg0KKyAqIA0KKyAqIENv cHlyaWdodCAoYykgMjAwMC0yMDAyLCAyMDA0IFNpbGljb24gR3JhcGhpY3Ms IEluYy4gIEFsbCBSaWdod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gcGFnZyB7DQorICAgICAgIHN0cnVj dCBwYWdnX2hvb2sJKmhvb2s7DQorICAgICAgIHZvaWQJCSpkYXRhOw0KKyAg ICAgICBzdHJ1Y3QgbGlzdF9oZWFkCWVudHJ5Ow0KK307DQorDQorLyoNCisg KiBVc2VkIGJ5IHBhZ2cgbW9kdWxlcyB0byBkZWZpbmUgdGhlIGNhbGxiYWNr IGZ1bmN0aW9ucyBpbnRvIHRoZSANCisgKiBtb2R1bGUuDQorICoNCisgKiBT VFJVQ1QgTUVNQkVSUzoNCisgKiAgICAgbmFtZTogICAgICAgICAgIFRoZSBu YW1lIG9mIHRoZSBwYWdnIGNvbnRhaW5lciB0eXBlIHByb3ZpZGVkIGJ5DQor ICogICAgICAgICAgICAgICAgICAgICB0aGUgbW9kdWxlLiBUaGlzIHdpbGwg YmUgc2V0IGJ5IHRoZSBwYWdnIG1vZHVsZS4NCisgKiAgICAgYXR0YWNoOiAg ICAgICAgIEZ1bmN0aW9uIHBvaW50ZXIgdG8gZnVuY3Rpb24gdXNlZCB3aGVu IGF0dGFjaGluZw0KKyAqICAgICAgICAgICAgICAgICAgICAgYSBwcm9jZXNz IHRvIHRoZSBwYWdnIGNvbnRhaW5lciByZWZlcmVuY2VkIGJ5IA0KKyAqICAg ICAgICAgICAgICAgICAgICAgdGhpcyBzdHJ1Y3QuDQorICogICAgIGRldGFj aDogICAgICAgICBGdW5jdGlvbiBwb2ludGVyIHRvIGZ1bmN0aW9uIHVzZWQg d2hlbiBkZXRhY2hpbmcNCisgKiAgICAgICAgICAgICAgICAgICAgIGEgcHJv Y2VzcyB0byB0aGUgcGFnZyBjb250YWluZXIgcmVmZXJlbmNlZCBieSANCisg KiAgICAgICAgICAgICAgICAgICAgIHRoaXMgc3RydWN0Lg0KKyAqICAgICBp bml0OiAgICAgICAgICAgRnVuY3Rpb24gcG9pbnRlciB0byBpbml0aWFsaXph dGlvbiBmdW5jdGlvbi4gIFRoaXMNCisgKiAgICAgICAgICAgICAgICAgICAg IGZ1bmN0aW9uIGlzIHVzZWQgd2hlbiB0aGUgbW9kdWxlIGlzIGxvYWRlZCB0 byBhdHRhY2gNCisgKiAgICAgICAgICAgICAgICAgICAgIGV4aXN0aW5nIHBy b2Nlc3NlcyB0byBhIGRlZmF1bHQgY29udGFpbmVyIGFzIGRlZmluZWQgYnkN CisgKiAgICAgICAgICAgICAgICAgICAgIHRoZSBwYWdnIG1vZHVsZS4gVGhp cyBpcyBvcHRpb25hbCBhbmQgbWF5IGJlIHNldCB0byANCisgKiAgICAgICAg ICAgICAgICAgICAgIE5VTEwgaWYgaXQgaXMgbm90IG5lZWRlZCBieSB0aGUg cGFnZyBtb2R1bGUuDQorICogICAgIGRhdGE6ICAgICAgICAgICBPcGFxdWUg ZGF0YSBwb2ludGVyIC0gZGVmaW5lZCBieSBwYWdnIG1vZHVsZXMuDQorICog ICAgIG1vZHVsZTogICAgICAgICBQb2ludGVyIHRvIGtlcm5lbCBtb2R1bGUg c3RydWN0LiAgVXNlZCB0byBpbmNyZW1lbnQgJiANCisgKiAgICAgICAgICAg ICAgICAgICAgIGRlY3JlbWVudCB0aGUgdXNlIGNvdW50IGZvciB0aGUgbW9k dWxlLg0KKyAqICAgICBlbnRyeToJICAgICAgIExpc3QgcG9pbnRlcnMNCisg KiAgICAgZXhlYzogICAgICAgICAgIEZ1bmN0aW9uIHBvaW50ZXIgdG8gZnVu Y3Rpb24gdXNlZCB3aGVuIGEgcHJvY2Vzcw0KKyAqICAgICAgICAgICAgICAg ICAgICAgaW4gdGhlIHBhZ2cgY29udGFpbmVyIGV4ZWMncyBhIG5ldyBwcm9j ZXNzLiBUaGlzDQorICogICAgICAgICAgICAgICAgICAgICBpcyBvcHRpb25h bCBhbmQgbWF5IGJlIHNldCB0byBOVUxMIGlmIGl0IGlzIG5vdCANCisgKiAg ICAgICAgICAgICAgICAgICAgIG5lZWRlZCBieSB0aGUgcGFnZyBtb2R1bGUu DQorICogICAgIHJlZmNudDogICAgICAgICBLZWVwIHRyY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b3J0DQorICAg ICBmb3IgcHJvY2VzcyBhZ2dyZWdhdGUgY29udGFpbmVycy4gIEV4YW1wbGVz IG9mIHN1Y2ggbW9kdWxlcyBpbmNsdWRlIHRoZQ0KKyAgICAgTGludXggSm9i cyBtb2R1bGUgYW5kIHRoZSBMaW51eCBBcnJheSBTZXNzaW9ucyBtb2R1bGUu ICBJZiB5b3Ugd2lsbCBub3QgDQorICAgICBiZSB1c2luZyBzdWNoIG1vZHVs ZXMsIHNheSBOLg0KKw0KIGNvbmZpZyBTWVNDVEwNCiAJYm9vbCAiU3lzY3Rs IHN1cHBvcnQiDQogCS0tLWhlbHAtLS0NCkluZGV4OiBsaW51eC9rZXJuZWwv TWFrZWZpbGUNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSBsaW51eC5v cmlnL2tlcm5lbC9NYWtlZmlsZQ0KKysrIGxpbnV4L2tlcm5lbC9NYWtlZmls ZQ0KQEAgLTE4LDYgKzE4LDcgQEANCiBvYmotJChDT05GSUdfUE0pICs9IHBv d2VyLw0KIG9iai0kKENPTkZJR19CU0RfUFJPQ0VTU19BQ0NUKSArPSBhY2N0 Lm8NCiBvYmotJChDT05GSUdfQ09NUEFUKSArPSBjb21wYXQubw0KK29iai0k KENPTkZJR19QQUdHKSArPSBwYWdnLm8NCiBvYmotJChDT05GSUdfSUtDT05G SUcpICs9IGNvbmZpZ3Mubw0KIG9iai0kKENPTkZJR19JS0NPTkZJR19QUk9D KSArPSBjb25maWdzLm8NCiBvYmotJChDT05GSUdfU1RPUF9NQUNISU5FKSAr PSBzdG9wX21hY2hpbmUubw0KSW5kZXg6IGxpbnV4L2tlcm5lbC9leGl0LmMN Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSBsaW51eC5vcmlnL2tlcm5l bC9leGl0LmMNCisrKyBsaW51eC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saXN0X2Zvcl9lYWNoX2VudHJ5X3NhZmUocGFnZywg cGFnZ3RtcCwgJnRhc2stPnBhZ2dfbGlzdCwgZW50cnkpIHsNCisJCXBhZ2ct Pmhvb2stPmRldGFjaCh0YXNrLCBwYWdnKTsNCisJCXBhZ2dfZnJlZShwYWdn KTsNCisJfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg DQorCXVwX3dyaXRlKCZ0YXNrLT5wYWdnX3NlbSk7IC8qIHdyaXRlIHVubG9j ayB0aGUgcGFnZyBsaXN0ICovDQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICANCisJcmV0dXJuOyAgIC8qIDAgPSBzdWNjZXNzLCBlbHNl IHJldHVybiBsYXN0IGNvZGUgZm9yIGZhaWx1cmUgKi8NCit9DQorDQorDQor LyoqDQorICogX19wYWdnX2V4ZWMgLSBFeGVjdXRlIGNhbGxiYWNrIHdoZW4g YSBwcm9jZXNzIGluIGEgY29udGFpbmVyIGV4ZWNzDQorICogQHRhc2s6IFdl IGdvIHRocm91Z2ggdGhlIHBhZ2cgbGlzdCBpbiB0aGUgZ2l2ZW4gdGFzaw0K KyAqDQorICogVXNlZCB0byB3aGVuIGEgcHJvY2VzcyB0aGF0IGlzIGluIGEg cGFnZyBjb250YWluZXIgZG9lcyBhbiBleGVjLg0KKyAqDQorICogVGhlICJm cm9tIiBhcmd1bWVudCBpcyB0aGUgdGFzay4gIFRoZSAibmFtZSIgYXJndW1l bnQgaXMgdGhlIG5hbWUNCisgKiBvZiB0aGUgcHJvY2VzcyBiZWluZyBleGVj J2VkLg0KKyAqDQorICovDQoraW50IA0KK19fcGFnZ19leGVjKHN0cnVjdCB0 YXNrX3N0cnVjdCAqdGFzaykgDQorew0KKwlzdHJ1Y3QgcGFnZwkqcGFnZzsN CisNCisJLyogbG9jayB0aGUgcGFyZW50cyBwYWdnX2xpc3Qgd2UgYXJlIGNv cHlpbmcgZnJvbSAqLw0KKwlkb3duX3JlYWQoJnRhc2stPnBhZ2dfc2VtKTsg LyogbG9jayB0aGUgcGFnZyBsaXN0ICovDQorDQorCWxpc3RfZm9yX2VhY2hf ZW50cnkocGFnZywgJnRhc2stPnBhZ2dfbGlzdCwgZW50cnkpIHsNCisJCWlm IChwYWdnLT5ob29rLT5leGVjKSAvKiBjb25kaXRpb25hbCBiZWNhdXNlIGl0 J3Mgb3B0aW9uYWwgKi8NCisJCQlwYWdnLT5ob29rLT5leGVjKHRhc2ssIHBh Z2cpOw0KKwl9DQorDQorCXVwX3JlYWQoJnRhc2stPnBhZ2dfc2VtKTsgLyog dW5sb2NrIHRoZSBwYWdnIGxpc3QgKi8NCisJcmV0dXJuIDA7DQorfQ0KKw0K Kw0KK0VYUE9SVF9TWU1CT0wocGFnZ19nZXQpOw0KK0VYUE9SVF9TWU1CT0wo cGFnZ19hbGxvYyk7DQorRVhQT1JUX1NZTUJPTChwYWdnX2ZyZWUpOw0KK0VY UE9SVF9TWU1CT0wocGFnZ19ob29rX3JlZ2lzdGVyKTsNCitFWFBPUlRfU1lN Qk9MKHBhZ2dfaG9va191bnJlZ2lzdGVyKTsNCg== ---2136806248-1308750959-1088100536=:340142-- - 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/