Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750798AbWA0PTb (ORCPT ); Fri, 27 Jan 2006 10:19:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751232AbWA0PTb (ORCPT ); Fri, 27 Jan 2006 10:19:31 -0500 Received: from lirs02.phys.au.dk ([130.225.28.43]:45465 "EHLO lirs02.phys.au.dk") by vger.kernel.org with ESMTP id S1750798AbWA0PT3 (ORCPT ); Fri, 27 Jan 2006 10:19:29 -0500 Date: Fri, 27 Jan 2006 16:18:21 +0100 (MET) From: Esben Nielsen To: Steven Rostedt cc: Bill Huey , Ingo Molnar , david singleton , Subject: Re: RT Mutex patch and tester [PREEMPT_RT] In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="202006529-1967741563-1138375101=:30636" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 77363 Lines: 1318 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. --202006529-1967741563-1138375101=:30636 Content-Type: TEXT/PLAIN; charset=US-ASCII I have patched against 2.6.15-rt15 and I have found a hyperthreaded P4 machine. It works fine on that one. Esben On Mon, 23 Jan 2006, Esben Nielsen wrote: > On Mon, 23 Jan 2006, Steven Rostedt wrote: > > > On Mon, 2006-01-23 at 10:33 +0100, Esben Nielsen wrote: > > > On Sun, 22 Jan 2006, Bill Huey wrote: > > > > > > > On Mon, Jan 23, 2006 at 01:20:12AM +0100, Esben Nielsen wrote: > > > > > Here is the problem: > > > > > > > > > > Task B (non-RT) takes BKL. It then takes mutex 1. Then B > > > > > tries to lock mutex 2, which is owned by task C. B goes blocks and releases the > > > > > BKL. Our RT task A comes along and tries to get 1. It boosts task B > > > > > which boosts task C which releases mutex 2. Now B can continue? No, it has > > > > > to reaquire BKL! The netto effect is that our RT task A waits for BKL to > > > > > be released without ever calling into a module using BKL. But just because > > > > > somebody in some non-RT code called into a module otherwise considered > > > > > safe for RT usage with BKL held, A must wait on BKL! > > > > > > > > True, that's major suckage, but I can't name a single place in the kernel that > > > > does that. > > > > > > Sounds good. But someone might put it in... > > > > Hmm, I wouldn't be surprised if this is done somewhere in the VFS layer. > > > > > > > > > Remember, BKL is now preemptible so the place that it might sleep > > > > similar > > > > to the above would be in spinlock_t definitions. > > > I can't see that from how it works. It is explicitly made such that you > > > are allowed to use semaphores with BKL held - and such that the BKL is > > > released if you do. > > > > Correct. I hope you didn't remove my comment in the rt.c about BKL > > being a PITA :) (Ingo was nice enough to change my original patch to use > > the acronym.) > > I left it there it seems :-) > > > > > > > > > > But BKL is held across schedules()s > > > > so that the BKL semantics are preserved. > > > Only for spinlock_t now rt_mutex operation, not for semaphore/mutex > > > operations. > > > > Contending under a priority inheritance > > > > operation isn't too much of a problem anyways since the use of it already > > > > makes that > > > > path indeterminant. > > > The problem is that you might hit BKL because of what some other low > > > priority task does, thus making your RT code indeterministic. > > > > I disagree here. The fact that you grab a semaphore that may also be > > grabbed by a path while holding the BKL means that grabbing that > > semaphore may be blocked on the BKL too. So the length of grabbing a > > semaphore that can be grabbed while also holding the BKL is the length > > of the critical section of the semaphore + the length of the longest BKL > > hold. > Exactly. What is "the length of the longest BKL hold" ? (see below). > > > > > Just don't let your RT tasks grab semaphores that can be grabbed while > > also holding the BKL :) > > How are you to _know_ that. Even though your code or any code you > call or any code called from code you call haven't changed, this situation > can arise! > > > > > But the main point is that it is still deterministic. Just that it may > > be longer than one thinks. > > > I don't consider "the length of the longest BKL hold" deterministic. > People might traverse all kinds of weird lists and datastructures while > holding BKL. > > > > > > > > Even under contention, a higher priority task above A can still > > > > run since the kernel is preemptive now even when manipulating BKL. > > > > > > No, A waits for BKL because it waits for B which waits for the BKL. > > > > Right. > > > > -- Steve > > > > PS. I might actually get around to testing your patch today :) That is, > > if -rt12 passes all my tests. > > > > Sounds nice :-) I cross my fingers... > > Esben > > > > > > - > > 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/ > > > > --202006529-1967741563-1138375101=:30636 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="pi_lock.patch-rt15" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="pi_lock.patch-rt15" ZGlmZiAtdXByIGxpbnV4LTIuNi4xNS1ydDE1LW9yaWcvZnMvcHJvYy9hcnJh eS5jIGxpbnV4LTIuNi4xNS1ydDE1LXBpcGF0Y2gvZnMvcHJvYy9hcnJheS5j DQotLS0gbGludXgtMi42LjE1LXJ0MTUtb3JpZy9mcy9wcm9jL2FycmF5LmMJ MjAwNi0wMS0yNCAxODo1MDozNy4wMDAwMDAwMDAgKzAxMDANCisrKyBsaW51 eC0yLjYuMTUtcnQxNS1waXBhdGNoL2ZzL3Byb2MvYXJyYXkuYwkyMDA2LTAx LTI0IDE4OjU2OjA3LjAwMDAwMDAwMCArMDEwMA0KQEAgLTI5NSw2ICsyOTUs MTQgQEAgc3RhdGljIGlubGluZSBjaGFyICp0YXNrX2NhcChzdHJ1Y3QgdGFz aw0KIAkJCSAgICBjYXBfdChwLT5jYXBfZWZmZWN0aXZlKSk7DQogfQ0KIA0K Kw0KK3N0YXRpYyBjaGFyICpzaG93X2Jsb2NrZWRfb24odGFza190ICp0YXNr LCBjaGFyICpidWZmZXIpDQorew0KKyAgcGlkX3QgcGlkID0gZ2V0X2Jsb2Nr ZWRfb24odGFzayk7DQorICByZXR1cm4gYnVmZmVyICsgc3ByaW50ZihidWZm ZXIsIkJsY2tPbjogJWRcbiIscGlkKTsNCit9DQorDQorDQogaW50IHByb2Nf cGlkX3N0YXR1cyhzdHJ1Y3QgdGFza19zdHJ1Y3QgKnRhc2ssIGNoYXIgKiBi dWZmZXIpDQogew0KIAljaGFyICogb3JpZyA9IGJ1ZmZlcjsNCkBAIC0zM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kaWYNCiB9DQogDQorc3RhdGljIGlu dCBhbGxvd2VkX3RvX3Rha2VfbG9jayhzdHJ1Y3QgdGhyZWFkX2luZm8gKnRp LA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFza190ICp0 YXNrLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IHRocmVhZF9pbmZvICpvbGRfb3duZXIsDQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBzdHJ1Y3QgcnRfbXV0ZXggKmxvY2spDQorew0KKwlT TVBfVFJBQ0VfQlVHX09OX0xPQ0tFRCghc3Bpbl9pc19sb2NrZWQoJmxvY2st PndhaXRfbG9jaykpOw0KKwlTTVBfVFJBQ0VfQlVHX09OX0xPQ0tFRChzcGlu X2lzX2xvY2tlZCgmb2xkX293bmVyLT50YXNrLT5waV9sb2NrKSk7DQorCVNN UF9UUkFDRV9CVUdfT05fTE9DS0VEKHNwaW5faXNfbG9ja2VkKCZ0YXNrLT5w aV9sb2NrKSk7DQorDQorCXJldHVybiAhb2xkX293bmVyIHx8DQorCQkoaXNf a2VybmVsX2xvY2sobG9jaykgICYmIGxvY2tfb3duZXIobG9jaykgPT0gdGkp IHx8DQorCQl0YXNrX2lzX3BlbmRpbmdfb3duZXIodGksbG9jaykgfHwgDQor CQlfX2dyYWJfbG9jayhsb2NrLCB0YXNrLCBvbGRfb3duZXItPnRhc2spOw0K K30NCisNCiAvKg0KICAqIGxvY2sgaXQgc2VtYXBob3JlLXN0eWxlOiBubyB3 b3JyaWVzIGFib3V0IG1pc3NlZCB3YWtldXBzLg0KICAqLw0KLXN0YXRpYyBp bmxpbmUgdm9pZA0KK3N0YXRpYyB2b2lkDQogX19fX2Rvd24oc3RydWN0IHJ0 X211dGV4ICpsb2NrIF9fRUlQX0RFQ0xfXykNCiB7DQogCXN0cnVjdCB0aHJl YWRfaW5mbyAqdGkgPSBjdXJyZW50X3RocmVhZF9pbmZvKCksICpvbGRfb3du ZXI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GFzay0+cGlfbG9jayk7DQorCQlnb3RvIHRyeV9hZ2Fp bjsNCisJfSAgICAgICANCisJb3duZXIgPSBsb2NrX293bmVyKGxvY2spOw0K KwlpZihvd25lcikNCisJCXJlcyA9IG93bmVyLT50YXNrLT5waWQ7DQorDQor CV9yYXdfc3Bpbl91bmxvY2soJnRhc2stPnBpX2xvY2spOw0KKwlfcmF3X3Nw aW5fdW5sb2NrKCZsb2NrLT53YWl0X2xvY2spOw0KKyAgICAgICAgDQorIG91 dDoNCisJcmV0dXJuIHJlczsNCisgICAgICAgICAgICAgICAgDQorfQ0KK0VY UE9SVF9TWU1CT0woZ2V0X2Jsb2NrZWRfb24pOw0K --202006529-1967741563-1138375101=:30636-- - 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/