From: Jacques Gelinas (jack_at_solucorp.qc.ca)
Date: Thu 20 Mar 2003 - 01:39:19 GMT
I wrote another patch to solve the problem. Instead of using spinlocks
I am using atomic_t. This should scale even better. The patch also
contains some debugging in case a ip_info struct is corrupted.
Apply on top of ctx-16.
Keep me posted!
(I have fixed the mailing list).
---------------------------------------------------------
Jacques Gelinas <jack_at_solucorp.qc.ca>
vserver: run general purpose virtual servers on one box, full speed!
http://www.solucorp.qc.ca/miscprj/s_context.hc
------nextpart-1048124359
Content-type: application/octet-stream; name="diffctx-17.new"
Content-Transfer-Encoding: BASE64
Content-Description:
Content-Disposition: attachment; filename="diffctx-17.new"
ZGlmZiAtcmMyUCBsaW51eC0yLjQuMjBjdHgtMTYvTWFrZWZpbGUgbGludXgtMi40LjIwY3R4
LTE3L01ha2VmaWxlCioqKiBsaW51eC0yLjQuMjBjdHgtMTYvTWFrZWZpbGUJMjAwMy0wMy0x
OSAxNjo1MDoyOS4wMDAwMDAwMDAgLTA1MDAKLS0tIGxpbnV4LTIuNC4yMGN0eC0xNy9NYWtl
ZmlsZQkyMDAyLTEyLTEzIDE2OjEwOjE2LjAwMDAwMDAwMCAtMDUwMAoqKioqKioqKioqKioq
KioKKioqIDIsNiAqKioqCiAgUEFUQ0hMRVZFTCA9IDQKICBTVUJMRVZFTCA9IDIwCiEgRVhU
UkFWRVJTSU9OID1jdHgtMTYKICAKICBLRVJORUxSRUxFQVNFPSQoVkVSU0lPTikuJChQQVRD
SExFVkVMKS4kKFNVQkxFVkVMKSQoRVhUUkFWRVJTSU9OKQotLS0gMiw2IC0tLS0KICBQQVRD
SExFVkVMID0gNAogIFNVQkxFVkVMID0gMjAKISBFWFRSQVZFUlNJT04gPWN0eC0xNi0xCiAg
CiAgS0VSTkVMUkVMRUFTRT0kKFZFUlNJT04pLiQoUEFUQ0hMRVZFTCkuJChTVUJMRVZFTCkk
KEVYVFJBVkVSU0lPTikKZGlmZiAtcmMyUCBsaW51eC0yLjQuMjBjdHgtMTYvaW5j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