Re: [patch 1/3] raid5: offload stripe handle to workqueue

From: Tejun Heo
Date: Thu Aug 01 2013 - 08:15:15 EST


Hello,

On Thu, Aug 01, 2013 at 10:01:01AM +0800, Shaohua Li wrote:
> It does have lock, but when a stripe is queued to handle, no lock is required.

Hmmmm.... sorry but can you please explain it a bit further? Why
wouldn't it require a lock? Perhaps because it has to be on some
queue already?

> So the workqueue lock will be high contended.

I still don't follow how it'd be more contended than the presumably
single lock that you'd have to use for queueing.

> > Also, can you please
> > elaborate the block plug part?
>
> Basically I do:
>
> blk_start_plug()
> handle_stripe() //may dispatch request
> blk_end_plug()
>
> If only handle one stripe between block plug, the plug is useless, so I need
> handle several stripes.

Ah, right, plugging is tied to the current context, so yeap that makes
sense.

The only thing which may actually matter is freezer handling as direct
freezer handling tends to be pretty tricky. If the work item
processing doesn't need freezing (which should be the case, I think),
it's all good. If it does, it'd probably be best to make the
workqueue freezable and breakout of the loop if freezing.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/