Re: s/Mutex/ceph::mutex/, lockdep

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

 



On 13/03/2018, Jason Dillaman wrote:
> While fixing a bug in the fio RBD engine last week, I spent some time
> generating and looking at perf on and off CPU flamegraphs for small IO
> workloads. I never saw "nlock" taking up any time in the graphs for
> librbd/librados, but for librbd::AioCompletion and
> librados::AioCompletion, I did see ~5% of the time being wasted on
> string constructors for the lock name. I have a branch where I
> switched just librbd::AioCompletion and librados::AioCompletion to use
> std::mutex since the value of lockdep seemed pretty minimal (if not
> non-existent) for those two cases.

We could kill off the string constructor overhead.

Just have Mutex (or mutex_debug) store a std::string_view instead of a
string. The caller would be RESPONSIBLE FOR MAKING SURE IT NEVER GOES
AWAY (at least not within the lifetime of the mutex) but in most cases
where we're just passing in a static string "foo"sv would do
that. Basically a more C++ friendly/idiomatic way for storing a const
char* and passing a string literal.

We could also just store a const char* and pass a string
literal. Whichever people think will be less error prone.


-- 
Senior Software Engineer           Red Hat Storage, Ann Arbor, MI, US
IRC: Aemerson@OFTC, Actinic@Freenode
0x80F7544B90EDBFB9 E707 86BA 0C1B 62CC 152C  7C12 80F7 544B 90ED BFB9
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux