Size: 2554
Comment: start out with a syscall problem statement
|
Size: 3326
Comment: move VFS contents to separate page
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= The year 2038 problem = | ''unfortunately this page got deleted by accident, this version is restored from https://web.archive.org/web/20150318062024/http://kernelnewbies.org/y2038, but most of the formatting is still missing. '' |
Line 3: | Line 3: |
== The year 2038 problem == | |
Line 5: | Line 6: |
== User space interfaces == |
=== User space interfaces === |
Line 9: | Line 9: |
=== System calls === | ==== System calls ==== System calls have been moved out [["y2038/syscalls"]], that page is rather outdated, newer information is available at https://lwn.net/Articles/643234/ |
Line 11: | Line 12: |
==== interfaces that uses relative time_t/timespec/timeval ==== | |
Line 13: | Line 13: |
These can stay compatible, but we'd have to use a different type if we change time_t. |
==== File systems ==== |
Line 16: | Line 15: |
* nanosleep * select/pselect/poll/ppoll/epoll * getrusage * sched_rr_get_interval * sigtimedwait * alarm |
Each file system stores its file modification times in its own format on disk, and a lot of them have the same problem. See also [["y2038/vfs"]]. |
Line 23: | Line 18: |
==== interfaces that don't make sense for times in the past ==== Here, we are relatively free to change the start of the epoch in the kernel but convert to something else on the user space boundary. One possibility is to scale them to boot time and use ktime_t in the kernel. |
=== Tasks === The task list is for people that want to get involved, there will be many more tasks over time, so this is just a starting point. In the end, we should remove all instances of 'time_t', 'timespec' and 'timeval' from the kernel. |
Line 29: | Line 21: |
* getitimer/setitimer * timer_settime/timer_gettime * gettimeofday/settimeofday * adjtimex * clock_gettime/clock_settime/clock_adjtime/clock_nanosleep * time/stime * sysv ipc (msg, sem, shm) * sysinfo |
==== Trivial tasks ==== Find a driver using time_t/timespec/timeval internally and convert it to ktime_t/timespec64, examples: |
Line 38: | Line 24: |
==== interfaces that require absolute times ==== These absolutely have to use something better than time_t both in user space and in the kernel so we can deal with old files. A lot of file systems need to be fixed as well so we can actually store the times, regardless of whether we are running a 32 or 64 bit kernel. |
* drivers/firewire/core-cdev.c * drivers/firewire/nosy.c * drivers/hv/hv_util.c * drivers/infiniband/hw/nes/ * drivers/misc/ibmasm/ibmasm.h * drivers/net/wireless/atmel.c * drivers/ide/pdc202xx_new.c * fs/fuse/dir.c * drivers/scsi/pmcraid.c |
Line 45: | Line 34: |
* stat/lstat/fstatat/ * utime/utimes/futimesat |
==== Small tasks ==== Find a driver using time_t/timespec/timeval internally and convert it to ktime_t/timespec64, examples: |
Line 48: | Line 37: |
=== ioctl === | * drivers/block/sx8.c * drivers/char/ipmi/ipmi_ssif.c * drivers/char/mmtimer.c * drivers/cpufreq/speedstep-lib.c * drivers/hsi/clients/cmt_speech.c * drivers/media/platform/vivid/ * drivers/net/hamradio/baycom_ser_fdx.c |
Line 50: | Line 45: |
There are numerous ioctl commands using a time argument. This list is incomplete | ==== Medium tasks ==== * Modify an ioctl interface in a driver to support both 32- and 64-bit time interfaces, examples: * drivers/usb/misc/usbtest.c |
Line 52: | Line 49: |
* audio time stamps * v4l time stamps * input event time stamps * socket time stamps * ... |
* Convert the internal timekeeping in fs/nfsd |
Line 58: | Line 51: |
=== memory mapped packet sockets === | * Convert all 'struct key' users (time_t) |
Line 60: | Line 53: |
Socket timestamps are exported to user space using a memory mapped interface defined in include/uapi/linux/if_packet.h. There are currently three versions of this interface, all use a 32-bit time type. We will likely need a version 4 to solve this. |
* fix all uses of timeval in drivers/scsi/bfa ==== Advanced tasks ==== * Change the on-disk layout of a broken file system to optionally support longer time stamps * Port a small C library (uClibc, newlib, ...) to optionally use 64-bit time_t and build an embedded distribution (openembedded, openwrt, buildroot, ...) with this. * start migrating the times in 'struct inode' and 'struct 'kstat' to separate 64-bit second + 32-bit nanosecond fields. ==== Tasks later in the project ==== * Hook up all 32-bit architectures to use the new system calls * Introduce a Kconfig symbol to disable all code that has not yet been converted at compile time. |
unfortunately this page got deleted by accident, this version is restored from https://web.archive.org/web/20150318062024/http://kernelnewbies.org/y2038, but most of the formatting is still missing.
The year 2038 problem
All 32-bit kernels to date use a signed 32-bit time_t type, which can only represent time until January 2038. Since embedded systems running 32-bit Linux are going to survive beyond that date, we have to change all current uses, in a backwards compatible way.
User space interfaces
We will likely keep the 32-bit time_t in all user space interfaces that currently use it, but add new interfaces with a 64-bit timespec or another type that can represent later times. Most importantly that impacts system calls, but also specific ioctl commands and a few other interfaces. User space programs have to be recompiled to use the new interfaces, and the policy whether to use the old or the time time is left to the C library. While that policy is a complex topic itself, we don't cover it here.
System calls
System calls have been moved out "y2038/syscalls", that page is rather outdated, newer information is available at https://lwn.net/Articles/643234/
File systems
Each file system stores its file modification times in its own format on disk, and a lot of them have the same problem. See also "y2038/vfs".
Tasks
The task list is for people that want to get involved, there will be many more tasks over time, so this is just a starting point. In the end, we should remove all instances of 'time_t', 'timespec' and 'timeval' from the kernel.
Trivial tasks
Find a driver using time_t/timespec/timeval internally and convert it to ktime_t/timespec64, examples:
- drivers/firewire/core-cdev.c
- drivers/firewire/nosy.c
- drivers/hv/hv_util.c
- drivers/infiniband/hw/nes/
- drivers/misc/ibmasm/ibmasm.h
- drivers/net/wireless/atmel.c
- drivers/ide/pdc202xx_new.c
- fs/fuse/dir.c
- drivers/scsi/pmcraid.c
Small tasks
Find a driver using time_t/timespec/timeval internally and convert it to ktime_t/timespec64, examples:
- drivers/block/sx8.c
- drivers/char/ipmi/ipmi_ssif.c
- drivers/char/mmtimer.c
- drivers/cpufreq/speedstep-lib.c
- drivers/hsi/clients/cmt_speech.c
- drivers/media/platform/vivid/
- drivers/net/hamradio/baycom_ser_fdx.c
Medium tasks
- Modify an ioctl interface in a driver to support both 32- and 64-bit time interfaces, examples:
- drivers/usb/misc/usbtest.c
- Convert the internal timekeeping in fs/nfsd
- Convert all 'struct key' users (time_t)
- fix all uses of timeval in drivers/scsi/bfa
Advanced tasks
- Change the on-disk layout of a broken file system to optionally support longer time stamps
- Port a small C library (uClibc, newlib, ...) to optionally use 64-bit time_t and build an embedded distribution (openembedded, openwrt, buildroot, ...) with this.
- start migrating the times in 'struct inode' and 'struct 'kstat' to separate 64-bit second + 32-bit nanosecond fields.
Tasks later in the project
- Hook up all 32-bit architectures to use the new system calls
- Introduce a Kconfig symbol to disable all code that has not yet been converted at compile time.