[prev in list] [next in list] [prev in thread] [next in thread] 

List:       evms-devel
Subject:    [Evms-devel] Re: [Re: [[Evms] evms race]]
From:       Mark Peloquin <markpeloquin () usa ! net>
Date:       2001-05-25 23:36:02
[Download RAW message or body]

Andi Kleen <ak@suse.de> wrote:

> Hallo,

> 0.0.4 contains this code in evms_handle_request:

> +        switch (rw) {
> +                case READ:
> +                case READA:
> +                        if (volume->quiesced)
> +                                sleep_on(&volume->wait_queue);
> +                        atomic_inc(&volume->requests_in_progress);
> +                        rc = node->plugin_id->function_table->
> +                                read(node, bh);
> +                        atomic_dec(&volume->requests_in_progress);
> +                        break;
> +
> +                case WRITE:
> +                        if (volume->quiesced)
> +                                sleep_on(&volume->wait_queue);


> This is racy: wakeups can easily get lost when a other CPU clears > quisced
and wakes up
> after the test but before the sleep_on is executed.  It should probably >
use the wait_event() 
> macros instead, which handle this case race free.

I knew what I had written wasn't SMP safe, but have gotten distracted in
other
areas and hadn't gotten back to it. I'll look at the wait_event() macro when
I
return to work on Tuesday. Thanks for the pointer and the reminder. :)

> Another nit: would it be possible to give even static functions unique
names? 
> That makes it 
> easier to use cross reference tools. Currently there are quite a lot of >
rt_writes all 
> over the source.

Sure it would be possible. I'm sure you'll find duplicate names across the
various plugins for most of the functions defined in the plugin function
table. I'll make them all unique, on Tuesday, as well.

Sorry for the late reply. Our email servers were down today due to some four
day maintenance occurring over the long holiday weekend, so I didn't see your
post until I was at my home this evening.

Thanks,
Mark


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
_______________________________________________
Evms mailing list
Evms@oss.software.ibm.com
http://oss.software.ibm.com/developerworks/opensource/mailman/listinfo/evms


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic