[OSy] PyJaMaS - zaplaty - oprava cond.c a nova obsluha casovacu

Jiri Svoboda jirik.svoboda at seznam.cz
Sun Nov 19 11:36:36 CET 2006


Zdravim vsechny,

Vsem, co si vybrali nas kernel PyJaMaS s potesenim posilam zaplaty odstranujici jeho nejvetsi nedostatky. Bud si jenom stahnete cond.c.diff ktery spravi chybku v cond.c (pouzijite "patch cond.c cond.c.diff"), nebo, jeste lepe si stahnete pyjamas-1.0_to_1.1.tar.gz, ktery udela totez a navic obsahuje zlepsenou obsluhu casovacu.

Casovace se nyni obsluhuji v kontextu vlakna, ktere je vytvorilo, cimz se zaruci, ze se casovace jednotlivych vlaken navzajem nezdrzuji. Pokud vlaknu jeste nebezi obsluha zadneho casovace, je obsluha casovace spustena nejpozdeji do dvou planovacich otocek (2x naplanovani vsech vlaken) - 1 otocka, nez se detekuje vyprseni, 2. otocka - nez se naplanuje vlakno.

Obe zaplaty, a mozna casem dalsi, tez najdete na webu (nadrazeny adresar vzhledem k nasi referencni dokumentaci) - URL zde neuvadim, pry sem zadne nemame davat ;)

Dalsi zaplaty (snad) budou, a pripominam, ze rad poradim s cimkoliv tykajicim se naseho jadra.

S pozdravem
    Jirka
-------------- next part --------------
--- cond.c	2006-11-10 00:29:36.000000000 +0100
+++ cond.c	2006-11-18 12:53:57.000000000 +0100
@@ -237,17 +237,21 @@
 
 	}
 	else
-	{	//If usec is nonzero then we will wait, if we will be awaken
-		//and the time limit is still available then sleep again :)
-		while( usec_left > 0 )
+	{	
+		//Insert current thread to the waiting queue
+		list_insert_back(&cvar->waiting,
+			&(current_thread->sync_queue),
+			(void*)current_thread);
+			
+		//Wait for timeout or a signal/broadcast. If, after falling
+		//out of thread_wait_usec, we're still in the queue,
+		//then it's a false revival so sleep again. (shouldn't happen)
+		while( usec_left > 0 &&
+			list_entry_is_used (&current_thread->sync_queue) )
 		{
 			#ifdef DEBUG
 			printk("SLEEP\n");
 			#endif
-			
-			list_insert_back(&cvar->waiting,
-					&(current_thread->sync_queue),
-					(void*)current_thread);
 
 			usec_left = thread_wait_usec(usec_left);
 		}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyjamas-1.0_to_1.1.tar.gz
Type: application/gzip
Size: 32123 bytes
Desc: not available
URL: <http://d3s.mff.cuni.cz/pipermail/nswi004/attachments/20061119/c1eb79d7/attachment.gz>


More information about the NSWI004 mailing list