[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALAqxLXP0yDdpq_90M4Qg18WGJJELmmFBQjXCONC8tZLv-b6Mg@mail.gmail.com>
Date: Thu, 14 Oct 2021 17:05:05 -0700
From: John Stultz <john.stultz@...aro.org>
To: "Elliott, Robert (Servers)" <elliott@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
"sboyd@...nel.org" <sboyd@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Kani, Toshi" <toshi.kani@....com>
Subject: Re: Is CLOCKS_MASK macro obsolete?
On Thu, Oct 14, 2021 at 4:46 PM Elliott, Robert (Servers)
<elliott@....com> wrote:
>
> The CLOCKS_MASK macro in include/uapi/linux/time.h seems broken; it's ORing together
> two numbered values, one of which is 0. Perhaps these clock IDs started as a bitmask?
> CLOCKS_MASK doesn't appear to be used anywhere in the kernel; nor does the adjacent
> CLOCKS_MONO.
>
> Should those macros be deleted?
As for CLOCKS_MASK, the earliest reference I can find is here:
https://elixir.bootlin.com/linux/v2.5.69/source/include/linux/time.h#L246
Right before the 2.6 release. Seems to have come in with this patch:
https://lore.kernel.org/lkml/3E9B4DCD.3070204@mvista.com/
But even there, it doesn't make sense as a mask.
There was even a patch to remove it:
https://lore.kernel.org/lkml/20050113132641.GA4380@elf.ucw.cz/
Then it took its current form with this:
https://lore.kernel.org/lkml/20050919184842.2.patchmail@tglx.tec.linutronix.de/
So, yea, I suspect it can be dropped as it really doesn't make much
sense, so I don't think it's likely used anywhere in a useful way.
(Though it is referenced in some docs -
https://github.com/Abdullah-Younus/E-Project/blob/35e2d915dd17d7cd14618af8d727b2874c4cae37/doc-html/doc/rtl/linux/clocks_mask.html)
For CLOCKS_MONO, the main risk is breaking existing userland code that
uses it at build time. But as the fix changing to CLOCK_MONOTONIC
seems not too difficult, it's probably ok.
thanks
-john
Powered by blists - more mailing lists