Hello, Lai. On Tue, Sep 25, 2012 at 05:02:31PM +0800, Lai Jiangshan wrote: > I found the flush_workqueue() is not nature for me, especially I don't think it's natural for anybody. I'm not a big fan of that code either. > the usage of the colors and flush_workqueue_prep_cwqs(). > so I try to improve it without change too much things/behavior. > > (These patchset delay other simple patches, I think I should > send simple patches at first.) Yes, please do so. > I always check the code by hard reviewing the code. I always try to image > there are many thread run in my brain orderless and I write all possible > transitions in paper. This progress is the most important, no test can > replace it. > > Human brain can wrong, the attached patch is my testing code. > It verify flush_workqueue() by cookie number. Sure, nothing beats careful reviews but then again it's difficult to have any level of confidence without actually excercising and verifying each possible code path. For tricky changes, it helps a lot if you describe how the code was verified and why and how much you feel confident about the change. > I also need your testing code for workqueue. ^_^ Heh, you asked for it. Attached. It's a scenario based thing and I use different scenarios usually in combination with some debug printks to verify things are behaving as I think they should. Thanks. -- tejun