Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp74585pxb; Fri, 15 Oct 2021 00:36:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3vPcYwTHzhxgfdRohU3GcKXyOGopk4veBUxfah9CBMq3u6slTcNZZdZlGzYKVbPrGXENk X-Received: by 2002:a17:90a:62ca:: with SMTP id k10mr11841863pjs.38.1634283374288; Fri, 15 Oct 2021 00:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634283374; cv=none; d=google.com; s=arc-20160816; b=F6NxKwvMKD68wEPzyC72EigPJY2R/mYHhtSduj+GjqV6xQZnXFXW8rO5U4w9zTx1af g8FdomiUsiVaBD52X3TJvGu6k02qdXm1ZkK3PXed71J6Mi5p2RYJ3oHwyT2QCTEVRETB k/ppIL9uoZ2Hs+PDCnBXJ8W2mY7Rn30lHRjx8UjMeIWF3cZYEipUXyOrX02olSuQ3BOy vYW78VCUFoK+djDilQGJHWxD5gIYKENRrzzcIggU0DtQmt66V61+cEIzSSPpAXlaI398 7adEEbV9pUZ+nSQZK2iHAZHRQHshrRKn+cTnjiTRFcmDiCItF9YZZMK38vjz2Rd7em89 S/yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uyeBxkJaDbc+4fPGxJhXcqmLf5DNIy9LiPlsBIJe85g=; b=W8VcHwDoQa6NZTV2WIMXzuBhEfKQialozBOu7CxD8bLLkxs3XZPruJyfj6aFApjnOl 8txQtQ5Q6xXYaGv22L6P14wBaH7KmVvzqyqcSLrVE/1sI5IUEV2j8aLBZ2wYzcJk6iGM aBYtUtgL0gynKXUE2rnb3VpFwEWgcc3U+Yg75dFWXhQueyfAnwR7tHZ0lZZlyITewqKI jku0UjVg/AcNe98T4fPM/y1J7QJkKFXeFXl9E3qaoB9rqAiEClyqw21x8Wrkh6CAtwuC cepMwoXwj/Rmp3+NyRyNvNrt+SospJ3psAqotQNwRefNiAwy0cwW7JsQVNXHmu5A+FOf t4ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fimni7tE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si16389530pjg.134.2021.10.15.00.35.46; Fri, 15 Oct 2021 00:36:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fimni7tE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234306AbhJOAHa (ORCPT + 99 others); Thu, 14 Oct 2021 20:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234352AbhJOAHX (ORCPT ); Thu, 14 Oct 2021 20:07:23 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FD01C061570 for ; Thu, 14 Oct 2021 17:05:18 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id x27so34339468lfu.5 for ; Thu, 14 Oct 2021 17:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uyeBxkJaDbc+4fPGxJhXcqmLf5DNIy9LiPlsBIJe85g=; b=Fimni7tEOV364jXYswz7+nOWndf8KSQUiv90DX1/pfZFbM2foqRbU/zhX+5Hs6wOQc sBLkm/YRLMmYkVr5PjRQ2rrJ6LCkNPwMqGEBQwGm/uP/M2vUv/BF4K9eL/kbKaiz4DnB IS2MbTs7x8eJsq13nU6Y9lHmwEeWveINWhaN6FqDVJUNXNkPOH4Kol2JTU9r3SjDNlzI mPuRw5DEY9js4aA48QYoSjxrQmsuEDJq/FXveH/VC2PDfWHGf7aALL0Lm1bwduscBl7m lGubJCfevKNowAo4H2ecAdqI1gdxIdDNiQEkMXy204qHFBKDlCxbT4eSs77f4GopQrUt af8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uyeBxkJaDbc+4fPGxJhXcqmLf5DNIy9LiPlsBIJe85g=; b=ViYJKn+gWHl9xgHHr+bPYy4b4FoFPSkAE0dRigD8B9eEeoQbI94jKX8IkcYUBm6M5P ojZa2Nwn0SiRO13JsmiEqJAibYBYuWhEDoU13jgVxCsHzjBGSJ0K7MvIH627etML+fv5 +A0UZ1B7FOcGXEtJjAHcK3clc1dmYPYbNf1fxACqcY/G0si1Nupgr7VMq3f1Wd/UtHlg gZZ1gacrfVL9mdFub9NMPhUZb5odQIhvDmX9dE+ClJZL65CDA8gRp7r1cmYjAoh41K14 u9R/EOOlCjK6B0+POZVtB8qV7D3RJmHCVuU85ngrz+VxrO+JN3fTQYLbmPOqC8Z6/W4T kceA== X-Gm-Message-State: AOAM532zBk2yMWhSBEtXXk7E1mOd7Ib2IDxrfXm2gudWg0bTflhiRisM dv4ePv+JsRq4R5eRimKiBfqBOVVKxmPMjmxPTpvZHA5oRIRmeg== X-Received: by 2002:a05:651c:b08:: with SMTP id b8mr3425936ljr.515.1634256316386; Thu, 14 Oct 2021 17:05:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: John Stultz Date: Thu, 14 Oct 2021 17:05:05 -0700 Message-ID: Subject: Re: Is CLOCKS_MASK macro obsolete? To: "Elliott, Robert (Servers)" Cc: Thomas Gleixner , "sboyd@kernel.org" , "linux-kernel@vger.kernel.org" , "Kani, Toshi" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 14, 2021 at 4:46 PM Elliott, Robert (Servers) 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