Linux-kernel mailing list archive 2000-32,: [PATCH] signal_struct slab cache

# [PATCH] signal_struct slab cache

Mark Hemment (markhe@veritas.com)
Mon, 7 Aug 2000 14:22:54 +0100 (BST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Seth Vidal: "Re: [NFS] Re: nfsv3 won't interoperate with solaris (still!)"
- Previous message: Karl Hammar: "Re: Kernel Panic at Boot"

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.

--168455872-729718577-965654574=:21086
Content-Type: TEXT/PLAIN; charset=US-ASCII

Linus, all,

The per-task signal handling structure (signal_struct) is a "bad" size
for the general sized slab caches; on IA32, it is 1312bytes which means it
comes from the 2048 byte cache - giving only 2 structures from each
page. It is probably a bad size for many other architectures.

By creating a specific slab cache for the signal_struct gives 3
structures per page, saving memory. Also, by using a specific cache,
allocation and release of the structures is slightly fast.

Please find a patch (against 2.4.0-test5) attached.

Mark

--168455872-729718577-965654574=:21086
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="signal.markhe.patch"
Content-ID: <Pine.LNX.4.21.0008071422540.21086@alloc>
Content-Description: signal.markhe.patch
Content-Disposition: attachment; filename="signal.markhe.patch"
Content-Transfer-Encoding: BASE64

ZGlmZiAtdXIgLVggaWdub3JlIC0tbmV3LWZpbGUgbGludXgtMi40LjAtdGVz
dDUva2VybmVsL2V4aXQuYyBtZW0tMi40LjAtdGVzdDUva2VybmVsL2V4aXQu
Yw0KLS0tIGxpbnV4LTIuNC4wLXRlc3Q1L2tlcm5lbC9leGl0LmMJRnJpIEp1
bCAyOCAwMDo0NzoxNiAyMDAwDQorKysgbWVtLTIuNC4wLXRlc3Q1L2tlcm5l
bC9leGl0LmMJTW9uIEF1ZyAgNyAxNDowNjoyNyAyMDAwDQpAQCAtMjAsNiAr
MjAsOCBAQA0KIGV4dGVybiB2b2lkIHNlbV9leGl0ICh2b2lkKTsNCiBleHRl
cm4gc3RydWN0I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nVjdCAqcGlkaGFzaFtQ
SURIQVNIX1NaXTsNCiANCiAvKiBVSUQgdGFzayBjb3VudCBjYWNoZSwgdG8g
cHJldmVudCB3YWxraW5nIGVudGlyZSBwcm9jZXNzIGxpc3QgZXZlcnkNCkBA
IC0xOTMsNiArMTk2LDEyIEBADQogCWlmKCF1aWRfY2FjaGVwKQ0KIAkJcGFu
aWMoIkNhbm5vdCBjcmVhdGUgdWlkIHRhc2tjb3VudCBTTEFCIGNhY2hlXG4i
KTsNCiANCisJc2lnYWN0X2NhY2hlcCA9IGttZW1fY2FjaGVfY3JlYXRlKCJz
aWduYWxfYWN0IiwNCisJCQkJCSAgc2l6ZW9mKHN0cnVjdCBzaWduYWxfc3Ry
dWN0KSwNCisJCQkJCSAgMCwgU0xBQl9IV0NBQ0hFX0FMSUdOLCBOVUxMLCBO
VUxMKTsNCisJaWYgKCFzaWdhY3RfY2FjaGVwKQ0KKwkJcGFuaWMoIkNhbm5v
dCBjcmVhdGUgc2lnbmFsIGFjdGlvbiBTTEFCIGNhY2hlXG4iKTsNCisNCiAJ
Zm9yKGkgPSAwOyBpIDwgVUlESEFTSF9TWjsgaSsrKQ0KIAkJdWlkaGFzaFtp
XSA9IDA7DQogDQpAQCAtNjE0LDcgKzYyMyw3IEBADQogCQlhdG9taWNfaW5j
KCZjdXJyZW50LT5zaWctPmNvdW50KTsNCiAJCXJldHVybiAwOw0KIAl9DQot
CXRzay0+c2lnID0ga21hbGxvYyhzaXplb2YoKnRzay0+c2lnKSwgR0ZQX0tF
Uk5FTCk7DQorCXRzay0+c2lnID0ga21lbV9jYWNoZV9hbGxvYyhzaWdhY3Rf
Y2FjaGVwLCBHRlBfS0VSTkVMKTsNCiAJaWYgKCF0c2stPnNpZykNCiAJCXJl
dHVybiAtMTsNCiAJc3Bpbl9sb2NrX2luaXQoJnRzay0+c2lnLT5zaWdsb2Nr
KTsNCg==
--168455872-729718577-965654574=:21086--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Seth Vidal: "Re: [NFS] Re: nfsv3 won't interoperate with solaris (still!)"
- Previous message: Karl Hammar: "Re: Kernel Panic at Boot"