[OpenAFS-devel] more PAGs

John S. Bucy bucy-openafs-devel@gloop.org
Tue, 14 Sep 2004 15:51:38 -0400


On Thu, Sep 09, 2004 at 05:01:04PM -0400, John S. Bucy wrote:

> 2: There seems to be a fairness problem with setpag.  If I start
> many of the following:
> 
>   for(i = 0; ; i++) {
>     k_setpag();
>     printf("pid %d, %d\n", getpid(), i);
>   }
> 
> once the throttling kicks in, I only see output (and kmsgs) from one
> of them.  If I stop the one that's making progress, another one will
> start again. 

I talked to Jeff about this a last night and we concluded the following:
1.  the Right Way(tm) to fix this is for AFS to have a "fair wait
queue" abstraction of some kind to make PAG allocation FIFO.
2.  It isn't worth spending a lot of time on this for linux since its
going to have new PAGs in the relatively near future.


It gets better: the sleep loop doesn't check for EINTR.  If I send a
signal to a process sleeping in k_setpag(), it will start spinning,
apparently because (at least on linux) schedule_timeout() is returning
immediately because there's a signal pending.  It seems like k_setpag()
needs to fail and return EINTR here...

I have a new patch coming that refactors the throttling logic out of
afs_setpag() and afs_setpag_val(), logs less often and will also deal
with signals.



john