Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1479069rdb; Mon, 19 Feb 2024 18:20:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVgvQu/RzQ7lY65I2dKSzBiObdA0o29GE84RsQyZF+EWcojLhrNm0Ln+5xJtW7T+caLyavgsKPNG4lTz2Y2jSuagkOhgheAuUABn6wVTw== X-Google-Smtp-Source: AGHT+IGKC5OL5ySsh7I6OKlAtVKkyKuVjeqtABWG+pyA51v6ZD/CO96PLtti911cOKU7ltlg4y6b X-Received: by 2002:a05:620a:4496:b0:787:3c67:6d8c with SMTP id x22-20020a05620a449600b007873c676d8cmr16248518qkp.16.1708395646598; Mon, 19 Feb 2024 18:20:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708395646; cv=pass; d=google.com; s=arc-20160816; b=g6oMxhblnFxBy+FG0CFFXvlCC4vbG6f/LvxuvuJ9/FRxxx2vj3l7N53hzFMpBPi/0Q eAssBL8n5LPwxxeaoGMoI+evwRBLXd0kT5YTuXHoOBkrSGW4Utt4bHioMm6RCahWk8ih KikmEZhPFuXowcj2aBCA/2eJu3OFd/dHWZh55csoR1yfEBzE+4caLE2Y2FWO9+TQsIYD m1Ed4Oa3O73fvgVWmBjMlCkuULvGm0rHY7wYWvVtmymD9BrPY7ezKTf+OWP8yX2vouzk wHTMcVAZBKN3eUh5vvM1H5PVLxKJrdrsSzFHGkmVoh9umwsYZF7WAgA3bmd/Ah2rdn3i 4R7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=OLeXaVVMj3CAyWPynSowMBob8/77CE28trQ00f9Cmc0=; fh=T9EX0byRvw/QSxLhjqZCoIMwgIHvrr5VE8Qh69YAcas=; b=zp+rB9NUfiBnWd8WyP6/0meK+zLnfW3Te2Dwb8ETD0vLJn37K+7vC8NjYVaaAmbmhh cEQ5XJHXDa5KKJj1l4gGRdQJTnwym02q2XL1g2efR03tuZgrMIYT5UhyhlFuPaJWwwln QjbAfiWlNYBYO/eZcJD3kqlMXXsO+CXUEfFVXw+6y+AVoB2L1ab103XoJXatWbUU3kYq wewPGqU75PEofsM7QUS2cPYRAgFPO+ByS8qV6R7NP177De7L6qEyfF9Co0CKs7eO8u/g wEFbMOw5q1n2ulP8DTmMs15hDwcTcxW8C2DP8OGjFIICSDGHt2Suc7VG+QNh3mumB2d6 RGVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H9zlYGtk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-72208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72208-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pi5-20020a05620a378500b00785d5fb869asi7760456qkn.208.2024.02.19.18.20.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 18:20:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H9zlYGtk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-72208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72208-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5ABB01C218F8 for ; Tue, 20 Feb 2024 02:20:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D19941C66; Tue, 20 Feb 2024 02:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H9zlYGtk" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BEAF3E47F for ; Tue, 20 Feb 2024 02:20:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708395640; cv=none; b=pQ6+vHMpa3K5iOyyiVPspHQ0ZXDByGRds+NqxGfjrZ1+1DYBtQdJCbMTci0UDip1frLntqvfBZvbDw74QMM4JOcRtAwyGz0UppPIpx5tB//1gXlLZT1c2XblIa6Y4DLakFWOz8CJpybZ7IRm5SMw+OgX9VnPTm01yUnS1qrqC+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708395640; c=relaxed/simple; bh=XdmGftUgvdRWRE2HE9nGJXerV+xvznarJWKf1cokm1s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Y1g88ozAD081wwd6KPe5GOAb+uhntPg0WXT5LrY2isfvDhL8NwxCgA0rZ7msK7IdCjJfw6hvtk42eLXUqxwtKRttp3JYNvQcEgUOBnsnjL8kyAxq2NyMJ9L9jtOQwR74jWlC5nJ1CcWikgHYtWwEVlc0potjdVVAu9fJ4O12NJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H9zlYGtk; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708395638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OLeXaVVMj3CAyWPynSowMBob8/77CE28trQ00f9Cmc0=; b=H9zlYGtkGOYTLgtH4mo65wF7Ns/3TjmKgucdWmuFObnJwRrNoJIPCbHn/LLzQQ8RFOeCO4 UZc+oArsEFcPt0bnaP1piCk4eYOk3sg7QKZ+NAbwtJTSqGdVQBTEgdg9NE5PSGX7bED1SZ E0pxsT35I9oOIoW/tl4FfYTEda+15iI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558-paPtkcdCNX6qWmuYvLFQTg-1; Mon, 19 Feb 2024 21:20:32 -0500 X-MC-Unique: paPtkcdCNX6qWmuYvLFQTg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C52D185A780; Tue, 20 Feb 2024 02:20:32 +0000 (UTC) Received: from [10.22.18.9] (unknown [10.22.18.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC179C185C0; Tue, 20 Feb 2024 02:20:31 +0000 (UTC) Message-ID: <388686b2-5305-43d1-8edf-19ba66d52727@redhat.com> Date: Mon, 19 Feb 2024 21:20:31 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] clocksource: Scale the max retry number of watchdog read according to CPU numbers Content-Language: en-US To: Feng Tang , Thomas Gleixner Cc: John Stultz , Stephen Boyd , paulmck@kernel.org, Peter Zijlstra , linux-kernel@vger.kernel.org, Jin Wang References: <20240129134505.961208-1-feng.tang@intel.com> <87msrwadvu.ffs@tglx> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 On 2/19/24 09:37, Feng Tang wrote: > Hi Thomas, > > On Mon, Feb 19, 2024 at 12:32:05PM +0100, Thomas Gleixner wrote: >> On Mon, Jan 29 2024 at 21:45, Feng Tang wrote: >>> +static inline long clocksource_max_watchdog_read_retries(void) >>> +{ >>> + long max_retries = max_cswd_read_retries; >>> + >>> + if (max_cswd_read_retries <= 0) { >>> + /* santity check for user input value */ >>> + if (max_cswd_read_retries != -1) >>> + pr_warn_once("max_cswd_read_retries was set with an invalid number: %ld\n", >>> + max_cswd_read_retries); >>> + >>> + max_retries = ilog2(num_online_cpus()) + 1; >> I'm getting tired of these knobs and the horrors behind them. Why not >> simply doing the obvious: >> >> retries = ilog2(num_online_cpus()) + 1; >> >> and remove the knob alltogether? > Thanks for the suggestion! Yes, this makes sense to me. IIUC, the > 'max_cswd_read_retries' was introduced mainly to cover different > platforms' requirement, which could now be covered by the new > self-adaptive number. > > If there is no concern from other developers, I will send a new > version in this direction. I see no problem simplifying it. Cheers, Longman