Redis already has the function dictRehashMilliseconds which is called by databasesCron in eventLoop. But why does Redis call the static function _dictRehashSetp(dict *d) in dictAddRaw or dictFind? I don't know what the significance of this design is.

Comment From: WiFeng

AFAIK, databasesCron processes the dict of server.db[dbid].dict, however _dictRehashSetp(dict *d) processes the dict of hash structure , set structure and so on.

Comment From: madolson

Redis incrementally rehashes dictionaries, instead of doing it all at once. This is an attempt to limit latency spikes.