Re: [PATCH RFC 0/8] RPC service thread scheduler optimizations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 30 Jun 2023, NeilBrown wrote:
> 
>  I agree that an a priori cap on number of threads is not ideal.
>  Have you considered using the xarray to only store busy threads?
>  I think its lookup mechanism mostly relies on a bitmap of present
>  entries, but I'm not completely sure.

It might be event better to use xa_set_mark() and xa_clear_mark() to
manage the busy state.
These are not atomic so you would need an atomic operation in the rqst.

#define XA_MARK_IDLE XA_MARK_1

do {
 rqstp = xa_find(xa, ..., XA_MARK_IDLE);
 if (test_and_set_bit(RQ_BUSY, &rqstp->rq_flags)) {
     xa_clear_mark(xa, rqstp->xa_index, XA_MARK_IDLE);
     break;
 }
} while {rqstp);

xa_find() should be nearly as fast at find_next_bit()
  
NeilBrown




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux