On Tue, Oct 03, 2017 at 10:11:20AM -0600, Jens Axboe wrote: > On 10/03/2017 10:06 AM, Matthew Wilcox wrote: > > test_and_test_and_set_bit()? It's an unusual name, so when either > > reading it or writing it, people are going to say "something unusual > > here", rather than "That Jens Axboe is such a n00b, he doesn't know how > > to use test_and_set_bit()". There are a few references out on the web > > to test-and-test-and-set already, so it's not entirely unique to Linux. > > I like that suggestion, but would suggest we make it > test_then_test_and_set_bit() since the 'then' naming would work for > having similar test_then_clear_bit() and not clash with > test_and_set_bit(). 'test-then-test-and-set' has the disadvantage of not being readily searchable ... if you search for 'test-and-test-and-set', you find discussions about why you might want to use this technique. Also, I don't like having set use a different name from clear; either we want 'test_and_test_and_(set|clear)_bit()' or 'test_then_(set|clear)_bit()'. Usually I'd be in favour of the shorter name, but this should be a rare thing for people to use, and if you search for test-then-clear you get a lot of results about pregnancy tests ...