[rfc] use ext3 instead of ext2

Ian Molton spyro at f2s.com
Sat Jul 17 02:48:09 PDT 2004


On Fri, 16 Jul 2004 17:35:04 -0400
Bryan Kadzban <bryan at kadzban.is-a-geek.net> wrote:

> OK.  So it does help, even with preempt -- without those patches, the
> driver holding the lock would prevent other tasks from getting it, even
> with a preemptible kernel.

Yep.

>  Well, no, only with a preemptible kernel

You could run a non-preemptable SMP kernel...

> (assuming the driver lets the lock go when the syscall is finished) 

Locks arent (necessarily) held for the duration of a syscall. the code path could involve the taking and releasing of several locks (possibly several at once) before the syscall returns. only code that accesses data which is shared (global) needs locking, for example:

int some_driver_func(int ben) {
	int john, bob;
	john = ben + (bob=ben-289);
	
	ben = foo(john, bob);
	
	return ben;
}

requires no locking at all (provided foo doesnt or provides its own)

wheras

static int global_driver_thing:

int driver_op(int foo){
	global_driver_thing++;
}

probably requires locking around the global_driver_thing++ operation. (certainly if anything else happens to that value other than increment_by_one... and possibly even then, for some applications)


> I think I get it now.  ;-)

:-)



More information about the lfs-dev mailing list