Name ---- Timezone cache renewal in ctime(3C) (aka No reboot on timezone update) Background ---------- Timezone patches contain the updates of the zoneinfo database files. Internally libc caches the timezone information and never rereads it. This means that when the timezone patches are applied and updates are made to the zoneinfo database, files they are not activated until the system is rebooted or the various process that use the timezone information are restarted. The impact of a reboot for the changes in the timezone is significant especially for those customers with many Sun servers running many domains. Customers have requested that when applying timezone patches, a reboot is not required. To satisfy the requirement, the timezone code could check if the zoneinfo database files have been updated since the last time by issuing the stat(2) system call. However, as stat() is an expensive system call, the addition of the stat() call would result in a great performance regression in the timezone code in libc. Therefore, a more efficient method that notifies libc that the zoneinfo database has been updated needs to be introduced. Proposal -------- All the ctime(3C) and mktime(3C) functions will use a semaphore on per zone shared memory pages. The semaphore can be attached to process by using mmap(2) to a software driver. The software driver allows mmap() to attach the shared memory page for semaphore, and also allows a privileged ioctl (requires PRIV_PROC_OWNER) to modify the memory contents(semaphore) for the zone. The software driver also allows to modify the memory contents for all zones (additionally requires PRIV_PROC_ZONE). The reason for using a software driver is solely to protect the shared memory from being released, invalidated or corrupted. The ctime(3C) and mktime(3C) functions will test the semaphore before using cache'd timezone information and, if it has changed, purge the cache and re-read the zoneinfo file. No privilege is required to test the semaphore. If the libc failed to open the device file, ctime(3C) and mktime(3C) will not cache the timezone information. When zoneinfo database files are updated, a new utility tzreload(1M) can be executed, by a privileged user, to propagate the change (update the semaphore status on the shared memory). All subsequent calls to ctime(3C) functions from any processes within the system will reread the updated zoneinfo database file. tzreload command will be added to the "Process Management" RBAC profile. Interfaces ---------- NAME STABILITY DESCRIPTION ------------------------------------------------------------------- TZSYNCIOC_INC Consolidation Private ioctl to increment semaphore value. TZSYNCIOC_INC_ALL_ZONES Consolidation Private ioctl to increment semaphore value in all zones. /dev/tzsync Uncommitted A device driver file to be used to mmap the semaphore memory. /usr/sbin/tzreload Committed man page tzreload(1M) Release ------- A patch binding is requested. Bug/RFEs ------- 6751272 RFE: Solaris timezone patches should not require reboot