US 11,720,416 B2
Adaptive synchronization for redo writing to persistent memory storage
Graham Ivey, Hook (GB); and Yunrui Li, Los Altos, CA (US)
Assigned to Oracle International Corporation, Redwood Shores (CA)
Filed by Oracle International Corporation, Redwood Shores, CA (US)
Filed on Sep. 13, 2019, as Appl. No. 16/570,895.
Prior Publication US 2021/0081242 A1, Mar. 18, 2021
Int. Cl. G06F 9/52 (2006.01); G06F 9/48 (2006.01); G06F 9/46 (2006.01); G06F 9/50 (2006.01); G06F 16/25 (2019.01); G06F 9/54 (2006.01); G06F 9/4401 (2018.01)
CPC G06F 9/522 (2013.01) [G06F 9/4418 (2013.01); G06F 9/46 (2013.01); G06F 9/465 (2013.01); G06F 9/466 (2013.01); G06F 9/467 (2013.01); G06F 9/48 (2013.01); G06F 9/485 (2013.01); G06F 9/4806 (2013.01); G06F 9/4812 (2013.01); G06F 9/4843 (2013.01); G06F 9/4887 (2013.01); G06F 9/50 (2013.01); G06F 9/52 (2013.01); G06F 9/524 (2013.01); G06F 9/526 (2013.01); G06F 9/544 (2013.01); G06F 16/252 (2019.01)] 20 Claims
OG exemplary drawing
 
1. A method of implementing processes or threads or processes and threads in a computer that includes main memory and persistent memory and one or more processors coupled to the main memory and to the persistent memory, the method comprising:
specifying a current value of sleep duration;
generating and storing log records of a database into a log buffer in the main memory by multiple processes or threads or processes and threads executing in the one or more processors, wherein the database issues an instruction to write the log records from a first type of computer memory to a second type of computer memory, the first type corresponds to a volatile memory embodied as the main memory, and the second type corresponds to a nonvolatile memory embodied as a persistent memory;
waiting, by at least one process or thread, for respective log records to be written to the persistent memory by a different process, wherein
the waiting comprises a sleep phase and a spin phase after the sleep phase;
in the sleep phase, at least sleeping by the current value of sleep duration;
after awakening from the sleeping, checking if the respective log records have been written to the persistent memory; and
in response to finding, by the checking after awakening, that the respective log records have not been written to the persistent memory,
executing the spin phase by repeatedly performing at least the checking, wherein the current value of sleep duration is determined automatically, based at least partially on previous results of performing the checking after awakening; and
updating the current value of the sleep duration with a new value of the sleep duration based at least in part a result of repeatedly checking whether the respective log records have been persisted.