Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp66611pxb; Tue, 2 Nov 2021 23:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcGfUpynHQRWl+5zE/MUpGi7B9hfm7LR/cnwJqlhUq42CEFrSp796YzwaPyL62/Kyq2eZW X-Received: by 2002:a17:906:e0cf:: with SMTP id gl15mr23670779ejb.448.1635921290138; Tue, 02 Nov 2021 23:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635921290; cv=none; d=google.com; s=arc-20160816; b=KCIJMgs4waALOYShimHClrwzWQrWxDnAFlxyISssF8bT7kLWbsg7Sd783G7pvrM38p oDbO+wNSyYaUGlLDenylXnzdF69Fipt7Y4qLO1WnKn903+P8yAK3+WyG8qXqHlfsOe/U GqIf2hAZWfd2tOskpIom2ohqXmTD6bmPfNe9exUvtLPSSPslvzFHSRy1dJmc60eOnehJ +7HfFXWINR25LDT6q6T3T5p/wniW2lDlLOLxTo7sEwlWRzQbdlpruVctWieQh/Y5P0mT WFqisWdVZ9VYhwJCLfXCy8sHt78x4D4QraX3nk8vIV6KAqviXyX0EUNeHuvdTPfsxtWh YH+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0/gxtL6FrtGTCFAfjjV+PVOa6vPjzhTYCyYMAG8va/A=; b=MH3R2fONQwx2w7Rdp9GotwEe3hs+ebWc154k5+SmikWwNLb8I8WME2Fi3KwBAY/4F/ qqYQlpNNXAR1M/TD2D86/B4dW5CfjhbOw1Zz3sKMlMHe5ymE34C1gA9BMIn5iWXM40rs WHR3MlMeJHhDb05Vmn0tSxlHetmU6mmoh5AvraBbzHeJa8338jCZ64Ov/ASbGOR7xcJ6 VknQnuQDks4YU2+sTrPUHJ1wa+Ppu8twxDBaebEEJ+BGV0yJ0sDXp2TPohTXTzJhP0Nk TGeCo+hbN4mCgsq0K+/nB4RO1HTtOFt+esWXPh4bs5DaNUxCyGI4cLB+MSEE5/5mq7mJ +9bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QHMozCwA; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si1992561ejf.406.2021.11.02.23.34.23; Tue, 02 Nov 2021 23:34:50 -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=@kernel.org header.s=k20201202 header.b=QHMozCwA; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231740AbhKCGeg (ORCPT + 99 others); Wed, 3 Nov 2021 02:34:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:60512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230152AbhKCGeg (ORCPT ); Wed, 3 Nov 2021 02:34:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5E9EA60EBD; Wed, 3 Nov 2021 06:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635921120; bh=0/4Wgsk93+KWlRX08PMIJHSrYsiPmuR9EejBTVK1I8I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QHMozCwAF95VCs5PF3Ske428uDi8+AuOiHIdRzBV+AeDlTK5+hriBq8C3hJEsTBp6 7tGRj4yAIBN1u30vJC0a0E6qALvuWJWyYYRX/t+nijBEQenKZt1cXV4qXRNEoXUKKC 8gKBBrAyzmdiR2PzG59LuyeNp+f1gnQYp6tdp+Pptj3IJkPkA9cmJN73Q3ps3Eqjgp 3NS7vGM3B/E9zVb1wqTjMzM4ZKkmwhM3IjzuHyTgUU5d8PMrW7CIjLl9kAq9Pn3Yrh fGRljPmJweP8YqQLY6h2QC06/2kCYnK4WiXjcDsqIuKOzZtFVZRScisdPhQPHnuacv wjVdbrwcSavYw== Date: Wed, 3 Nov 2021 08:31:53 +0200 From: Mike Rapoport To: Jonathan Corbet Cc: linux-kernel@vger.kernel.org, Nicolas Pitre , Arnd Bergmann Subject: Re: [PATCH 3/9] Remove unused header Message-ID: References: <20211102220203.940290-1-corbet@lwn.net> <20211102220203.940290-4-corbet@lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211102220203.940290-4-corbet@lwn.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 02, 2021 at 04:01:57PM -0600, Jonathan Corbet wrote: > Commit fb37409a01b0 ("arch: remove unicore32 port) deleted the last file > that included , but left that header file behind. > Nothing uses it, delete it now. > > Cc: Nicolas Pitre > Cc: Mike Rapoport > Cc: Arnd Bergmann > Signed-off-by: Jonathan Corbet Acked-by: Mike Rapoport > --- > include/linux/cnt32_to_63.h | 104 ------------------------------------ > 1 file changed, 104 deletions(-) > delete mode 100644 include/linux/cnt32_to_63.h > > diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h > deleted file mode 100644 > index 064428479f2d..000000000000 > --- a/include/linux/cnt32_to_63.h > +++ /dev/null > @@ -1,104 +0,0 @@ > -/* SPDX-License-Identifier: GPL-2.0-only */ > -/* > - * Extend a 32-bit counter to 63 bits > - * > - * Author: Nicolas Pitre > - * Created: December 3, 2006 > - * Copyright: MontaVista Software, Inc. > - */ > - > -#ifndef __LINUX_CNT32_TO_63_H__ > -#define __LINUX_CNT32_TO_63_H__ > - > -#include > -#include > -#include > - > -/* this is used only to give gcc a clue about good code generation */ > -union cnt32_to_63 { > - struct { > -#if defined(__LITTLE_ENDIAN) > - u32 lo, hi; > -#elif defined(__BIG_ENDIAN) > - u32 hi, lo; > -#endif > - }; > - u64 val; > -}; > - > - > -/** > - * cnt32_to_63 - Expand a 32-bit counter to a 63-bit counter > - * @cnt_lo: The low part of the counter > - * > - * Many hardware clock counters are only 32 bits wide and therefore have > - * a relatively short period making wrap-arounds rather frequent. This > - * is a problem when implementing sched_clock() for example, where a 64-bit > - * non-wrapping monotonic value is expected to be returned. > - * > - * To overcome that limitation, let's extend a 32-bit counter to 63 bits > - * in a completely lock free fashion. Bits 0 to 31 of the clock are provided > - * by the hardware while bits 32 to 62 are stored in memory. The top bit in > - * memory is used to synchronize with the hardware clock half-period. When > - * the top bit of both counters (hardware and in memory) differ then the > - * memory is updated with a new value, incrementing it when the hardware > - * counter wraps around. > - * > - * Because a word store in memory is atomic then the incremented value will > - * always be in synch with the top bit indicating to any potential concurrent > - * reader if the value in memory is up to date or not with regards to the > - * needed increment. And any race in updating the value in memory is harmless > - * as the same value would simply be stored more than once. > - * > - * The restrictions for the algorithm to work properly are: > - * > - * 1) this code must be called at least once per each half period of the > - * 32-bit counter; > - * > - * 2) this code must not be preempted for a duration longer than the > - * 32-bit counter half period minus the longest period between two > - * calls to this code; > - * > - * Those requirements ensure proper update to the state bit in memory. > - * This is usually not a problem in practice, but if it is then a kernel > - * timer should be scheduled to manage for this code to be executed often > - * enough. > - * > - * And finally: > - * > - * 3) the cnt_lo argument must be seen as a globally incrementing value, > - * meaning that it should be a direct reference to the counter data which > - * can be evaluated according to a specific ordering within the macro, > - * and not the result of a previous evaluation stored in a variable. > - * > - * For example, this is wrong: > - * > - * u32 partial = get_hw_count(); > - * u64 full = cnt32_to_63(partial); > - * return full; > - * > - * This is fine: > - * > - * u64 full = cnt32_to_63(get_hw_count()); > - * return full; > - * > - * Note that the top bit (bit 63) in the returned value should be considered > - * as garbage. It is not cleared here because callers are likely to use a > - * multiplier on the returned value which can get rid of the top bit > - * implicitly by making the multiplier even, therefore saving on a runtime > - * clear-bit instruction. Otherwise caller must remember to clear the top > - * bit explicitly. > - */ > -#define cnt32_to_63(cnt_lo) \ > -({ \ > - static u32 __m_cnt_hi; \ > - union cnt32_to_63 __x; \ > - __x.hi = __m_cnt_hi; \ > - smp_rmb(); \ > - __x.lo = (cnt_lo); \ > - if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \ > - __m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \ > - __x.val; \ > -}) > - > -#endif > -- > 2.31.1 > -- Sincerely yours, Mike.