proposition for fixing Y292B bug
Hello dear developers and enthusiasts.
My name is David and recently I wrote a blog post about "necessity" of fixing 64-bit signed integer overflow of time_t, sometime in year 292 billion. I proposed this to simply have software complete solution for timekeeping. The blog had somewhat nice feedback and few people told me to write to your mailing list.
As I mention in the list, I am no way experienced enough in kernel space to turn this into full merge request, so I post it to you and if anyone would like to build on this idea, it is GPLd for your convenience.
Any feedback is highly appreciated so please, include me in CC's.
The blog is written with funny attitude, but it is in no way meant to be joke, parody or insult.
https://dpolakovic.space/blogs/y292b
The source code can be found here.
https://git.dpolakovic.space/?p=unix-time-fix;a=summary
Thank you for your time.
dpo
Quoted 12 lines · David Polakovic
Hello dear developers and enthusiasts.
My name is David and recently I wrote a blog post about "necessity" of fixing 64-bit signed integer overflow of
time_t, sometime in year 292 billion. I proposed this to simply have software complete solution for timekeeping. The blog had somewhat nice feedback and few people told me to write to your mailing list.As I mention in the list, I am no way experienced enough in kernel space to turn this into full merge request, so I post it to you and if anyone would like to build on this idea, it is GPLd for your convenience.
Quoted 5 lines
Any feedback is highly appreciated so please, include me in CC's.
The blog is written with funny attitude, but it is in no way meant to be joke, parody or insult.
https://dpolakovic.space/blogs/y292b
Reading your paper, it seems like the userspace solution is to introduce bigger int type (i.e. int128/bigint); and you want the same to apply to kernel, right? Also, if that happens, I think C also needs built-in bigint type.
Confused...
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Thanks for reply.
My proposed solution was to create this BigInt datatype, which stores the value in array. The functions for division, multiplication, addition, subtraction and comparison could be stored in separate ".h" library for manipulation with BigInt datatype. The paper speaks more in detail.
And yes, this truly is an userspace solution, but for kernel space implementation I have zero to none experience. Therefore I wrote here.
dpo
Quoted 24 lines · Bagas Sanjaya
Quoted 12 lines · David Polakovic
Hello dear developers and enthusiasts.
My name is David and recently I wrote a blog post about "necessity" of fixing 64-bit signed integer overflow of
time_t, sometime in year 292 billion. I proposed this to simply have software complete solution for timekeeping. The blog had somewhat nice feedback and few people told me to write to your mailing list.As I mention in the list, I am no way experienced enough in kernel space to turn this into full merge request, so I post it to you and if anyone would like to build on this idea, it is GPLd for your convenience.
Quoted 5 lines
Any feedback is highly appreciated so please, include me in CC's.
The blog is written with funny attitude, but it is in no way meant to be joke, parody or insult.
https://dpolakovic.space/blogs/y292bReading your paper, it seems like the userspace solution is to introduce bigger int type (i.e. int128/bigint); and you want the same to apply to kernel, right? Also, if that happens, I think C also needs built-in bigint type.
Confused...
Quoted 1 line · David Polakovic
Thanks for reply.
Please don't top-post on LKML, reply inline with appropriate context instead.
Quoted 10 lines
My proposed solution was to create this BigInt datatype, which stores the value in array. The functions for division, multiplication, addition, subtraction and comparison could be stored in separate ".h" library for manipulation with BigInt datatype. The paper speaks more in detail.
And yes, this truly is an userspace solution, but for kernel space implementation I have zero to none experience. Therefore I wrote here.
There was a proposal for adding 128-bit unsigned integer (see [1]). The signed counterpart should be analogous.
Thanks.
[1]: https://lore.kernel.org/lkml/[email protected]/
Signature · 1 line
An old man doll... just what I always wanted! - Clara
From: Bagas Sanjaya <[email protected]>
Date: Mon, 1 Jul 2024 16:07:48 +0700
Quoted 12 lines · David Polakovic
Quoted 1 line
Thanks for reply.
Please don't top-post on LKML, reply inline with appropriate context instead.
Quoted 6 lines
My proposed solution was to create this BigInt datatype, which stores the value in array. The functions for division, multiplication, addition, subtraction and comparison could be stored in separate ".h" library for manipulation with BigInt datatype. The paper speaks more in detail.
IRRC there is big integer type somewhere in either lib/ or crypto/, I don't remember exactly. It's used only for crypto tho.
Quoted 7 lines
Quoted 4 lines
And yes, this truly is an userspace solution, but for kernel space implementation I have zero to none experience. Therefore I wrote here.
There was a proposal for adding 128-bit unsigned integer (see [1]). The signed counterpart should be analogous.
I have generic 128-bit integer API/infra for the kernel in my internal repo. I've been planning to upstream it for a couple years already, but every time couldn't find a slot to do that.
I can upload it to my open GitHub, so that maybe someone else who needs it could pick it up?
Quoted 4 lines
Thanks.
Thanks,
Olek
Quoted 27 lines · Alexander Lobakin
From: Bagas Sanjaya <[email protected]>
Date: Mon, 1 Jul 2024 16:07:48 +0700Quoted 10 lines · David Polakovic
Quoted 1 line
Thanks for reply.
Please don't top-post on LKML, reply inline with appropriate context instead.
Quoted 5 lines
My proposed solution was to create this BigInt datatype, which stores the value in array. The functions for division, multiplication, addition, subtraction and comparison could be stored in separate ".h" library for manipulation with BigInt datatype. The paper speaks more in detail.
IRRC there is big integer type somewhere in either
lib/orcrypto/, I don't remember exactly. It's used only for crypto tho.Quoted 5 lines
Quoted 3 lines
And yes, this truly is an userspace solution, but for kernel space implementation I have zero to none experience. Therefore I wrote here.
There was a proposal for adding 128-bit unsigned integer (see [1]). The signed counterpart should be analogous.
I have generic 128-bit integer API/infra for the kernel in my internal repo. I've been planning to upstream it for a couple years already, but every time couldn't find a slot to do that.
I can upload it to my open GitHub, so that maybe someone else who needs it could pick it up?
Quoted 5 lines
Quoted 3 lines
Thanks.
Thanks,
Olek
I am not sure if I don't understand your solution, but extending the memory designation from 64 to 128 bits, is another temporary solution, which will again overflow one day.
The sole reason why I was proposing the new "BigInt" type was to store each digit of the time_c as separate element of array, which could be resized (added one digit) as needed. The only limit would then be the physical amount of memory in the machine.
dpo
Quoted 9 lines · David Polakovic
I am not sure if I don't understand your solution, but extending the memory designation from 64 to 128 bits, is another temporary solution, which will again overflow one day.
The sole reason why I was proposing the new "BigInt" type was to store each digit of the
time_cas separate element of array, which could be resized (added one digit) as needed. The only limit would then be the physical amount of memory in the machine.
You state that you're not experienced enough to be able to send "a merge request". Fair enough; you also apparently don't know that github merges is not how kernel patches are submitted, reviewed, and integrated.
What you apparently don't appreciate it is that performance is something that is critically important for the Linux kernel, and using multiple precision integers is not really compatible with the best and highest performance. Computer Science is an engineering discipline, and it's all about tradeoffs. You could enginere a plane that can travel faster than the speed of sound, but if that compromises fuel efficiency and annoying people who are below its flight path, pursuing speed at all costs is not going to lead to commercial success. (Exhibit 1: The Concorde).
Similarly, trying to make sure that software will work in the year 292 Billion AD might not be all something that most people would consider high priority. After all, it's.... unlikely... that the x86_64 architecture will still be what we will be using 290 billion years from now. So if we need recompile the kernel sometime in the next 100 billion years for some new CPU architecture, and if it's unlikely that hard drives brought brand new are likely to be still in operation a decade or two from now --- there is plenty of time to evolve the on-disk format before a billion years go by, let alone 100 billion or 200 billion years.
Finally, kernel development is driven by people who are willing to do the work. If you want to demonstrate that it's possible to use MP integer mathematicswithout horribly comprmising performance, then you need to do the work. (BTW, if you don't know what the term "cache line" means, then I encourage that you understand that first.) But dropping a pointer to a blog post and expecting that people to do your homework for you is not really realistic.
Cheers,
- Ted
Quoted 43 lines · Theodore Ts'o
Quoted 8 lines · David Polakovic
I am not sure if I don't understand your solution, but extending the memory designation from 64 to 128 bits, is another temporary solution, which will again overflow one day.
The sole reason why I was proposing the new "BigInt" type was to store each digit of the
time_cas separate element of array, which could be resized (added one digit) as needed. The only limit would then be the physical amount of memory in the machine.You state that you're not experienced enough to be able to send "a merge request". Fair enough; you also apparently don't know that github merges is not how kernel patches are submitted, reviewed, and integrated.
What you apparently don't appreciate it is that performance is something that is critically important for the Linux kernel, and using multiple precision integers is not really compatible with the best and highest performance. Computer Science is an engineering discipline, and it's all about tradeoffs. You could enginere a plane that can travel faster than the speed of sound, but if that compromises fuel efficiency and annoying people who are below its flight path, pursuing speed at all costs is not going to lead to commercial success. (Exhibit 1: The Concorde).
Similarly, trying to make sure that software will work in the year 292 Billion AD might not be all something that most people would consider high priority. After all, it's.... unlikely... that the
x86_64architecture will still be what we will be using 290 billion years from now. So if we need recompile the kernel sometime in the next 100 billion years for some new CPU architecture, and if it's unlikely that hard drives brought brand new are likely to be still in operation a decade or two from now --- there is plenty of time to evolve the on-disk format before a billion years go by, let alone 100 billion or 200 billion years.Finally, kernel development is driven by people who are willing to do the work. If you want to demonstrate that it's possible to use MP integer mathematicswithout horribly comprmising performance, then you need to do the work. (BTW, if you don't know what the term "cache line" means, then I encourage that you understand that first.) But dropping a pointer to a blog post and expecting that people to do your homework for you is not really realistic.
Quoted 3 lines
Cheers,
- Ted
I appreciate your response, finally some thoughts on the proposition itself and please let me clear something up. It was exactly as you said, an tradeoff I considered worthy and I wasn't expecting anyone to do "my work". I thought that someone, experienced enough, might find this worthy of try.
However, I'll take your challenge, and I will try to do the work on my own, if no one else will. Let's see where it will lead me.
dpo
Quoted 11 lines · Theodore Ts'o
Quoted 9 lines · David Polakovic
I am not sure if I don't understand your solution, but extending the memory designation from 64 to 128 bits, is another temporary solution, which will again overflow one day.
The sole reason why I was proposing the new "BigInt" type was to store each digit of the
time_cas separate element of array, which could be resized (added one digit) as needed. The only limit would then be the physical amount of memory in the machine.
Quoted 4 lines
You state that you're not experienced enough to be able to send "a merge request". Fair enough; you also apparently don't know that github merges is not how kernel patches are submitted, reviewed, and integrated.
tl;dr: Documentation/process/submitting-patches.rst.
Quoted 11 lines
What you apparently don't appreciate it is that performance is something that is critically important for the Linux kernel, and using multiple precision integers is not really compatible with the best and highest performance. Computer Science is an engineering discipline, and it's all about tradeoffs. You could enginere a plane that can travel faster than the speed of sound, but if that compromises fuel efficiency and annoying people who are below its flight path, pursuing speed at all costs is not going to lead to commercial success. (Exhibit 1: The Concorde).
Quoted 10 lines
Similarly, trying to make sure that software will work in the year 292 Billion AD might not be all something that most people would consider high priority. After all, it's.... unlikely... that the
x86_64architecture will still be what we will be using 290 billion years from now. So if we need recompile the kernel sometime in the next 100 billion years for some new CPU architecture, and if it's unlikely that hard drives brought brand new are likely to be still in operation a decade or two from now --- there is plenty of time to evolve the on-disk format before a billion years go by, let alone 100 billion or 200 billion years.
That was what I thought when I first read this thread (good CS principle but questionable from engineering perspective).
Quoted 8 lines
Finally, kernel development is driven by people who are willing to do the work. If you want to demonstrate that it's possible to use MP integer mathematicswithout horribly comprmising performance, then you need to do the work. (BTW, if you don't know what the term "cache line" means, then I encourage that you understand that first.) But dropping a pointer to a blog post and expecting that people to do your homework for you is not really realistic.
Oh, I missed that "DIY" nature.
Thanks.
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 39 lines · David Polakovic
Quoted 27 lines · Alexander Lobakin
From: Bagas Sanjaya <[email protected]>
Date: Mon, 1 Jul 2024 16:07:48 +0700Quoted 10 lines · David Polakovic
Quoted 1 line
Thanks for reply.
Please don't top-post on LKML, reply inline with appropriate context instead.
Quoted 5 lines
My proposed solution was to create this BigInt datatype, which stores the value in array. The functions for division, multiplication, addition, subtraction and comparison could be stored in separate ".h" library for manipulation with BigInt datatype. The paper speaks more in detail.
IRRC there is big integer type somewhere in either
lib/orcrypto/, I don't remember exactly. It's used only for crypto tho.Quoted 5 lines
Quoted 3 lines
And yes, this truly is an userspace solution, but for kernel space implementation I have zero to none experience. Therefore I wrote here.
There was a proposal for adding 128-bit unsigned integer (see [1]). The signed counterpart should be analogous.
I have generic 128-bit integer API/infra for the kernel in my internal repo. I've been planning to upstream it for a couple years already, but every time couldn't find a slot to do that.
I can upload it to my open GitHub, so that maybe someone else who needs it could pick it up?Quoted 5 lines
Quoted 3 lines
Thanks.
Thanks,
OlekI am not sure if I don't understand your solution, but extending the memory designation from 64 to 128 bits, is another temporary solution, which will again overflow one day.
Quoted 7 lines
The sole reason why I was proposing the new "BigInt" type was to store each digit of the
time_cas separate element of array, which could be resized (added one digit) as needed. The only limit would then be the physical amount of memory in the machine.dpo
So now you are worried about the Y5e30 problem?!
You realize that you are now talking the orders of magnitude of time for which:
" The estimated time until most or all of the remaining 1–10% of stellar remnants not ejected from galaxies fall into their galaxies' central supermassive black holes. By this point, with binary stars having fallen into each other, and planets into their stars, via emission of gravitational radiation, only solitary objects (stellar remnants, brown dwarfs, ejected planetary-mass objects, black holes) will remain in the universe."
I genuinely thought this whole thread was a practical joke...
Quoted 13 lines · H. Peter Anvin
Quoted 11 lines · David Polakovic
I am not sure if I don't understand your solution, but extending the memory designation from 64 to 128 bits, is another temporary solution, which will again overflow one day.
The sole reason why I was proposing the new "BigInt" type was to store each digit of the
time_cas separate element of array, which could be resized (added one digit) as needed. The only limit would then be the physical amount of memory in the machine.dpo
Quoted 7 lines
So now you are worried about the Y5e30 problem?!
You realize that you are now talking the orders of magnitude of time for which:
" The estimated time until most or all of the remaining 1–10% of stellar remnants not ejected from galaxies fall into their galaxies' central supermassive black holes. By this point, with binary stars having fallen into each other, and planets into their stars, via emission of gravitational radiation, only solitary objects (stellar remnants, brown dwarfs, ejected planetary-mass objects, black holes) will remain in the universe."
I genuinely thought this whole thread was a practical joke...
And that's what I thought as unnecessary engineering churn...
Signature · 1 line
An old man doll... just what I always wanted! - Clara