Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1056506rwl; Wed, 29 Mar 2023 12:01:11 -0700 (PDT) X-Google-Smtp-Source: AKy350ZPjHIRON8VNgca2UvNZS9aw1YdX4OsjOA6XGoyNujpq6BcetCUUWPPo27cJa+LcyWpp0it X-Received: by 2002:a17:903:1c6:b0:1a1:d366:b085 with SMTP id e6-20020a17090301c600b001a1d366b085mr20151561plh.21.1680116471624; Wed, 29 Mar 2023 12:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680116471; cv=none; d=google.com; s=arc-20160816; b=Qe4BLcdsmR+gvJ8DyHPkF+EL9La2uNSxCya110HmkV2kROlLia7/tMCEscDITkODQA 1cX4OibxULcmCENZBBdeODDmL412A0kYFvgzE2mKCVGdivBBGE3VfCytiZGtQGC53ARr J7vSFZodhB6DVAC6ovNfGmNI/agEYZ751okfCQarFKnASMn6Um3r4+zUpba4UzFdjlba PZjPZFaNrlndvpxKntrlmH2UECZyKg+9tqWB7pcWvJE9UxScRzWaPbXy+9qGC5k3GeRq JWTwsrL3AcZHR4gQK7GpVP3xvsFbbqokYnmbksAlYTDcxvQbslpGyzxJFU8LYo15P2Sj y6rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=dV6zayjgZMuIPrwem1Ziq3l3A+7tMStcvlAeBVJqLAQ=; b=Cr2vPNJ5zDrjSw5/wL+wcBY25H0gAEaDPacdjlVZZb+WzxkOpTQLj3hRuU6Te9nxVB fA+1D647IjzhWu+7lxAHP8QnLvp8lCz6PrzfOvVfLeBL3lvL9cxSIuUozI6AFagpby+c jgIdy3LhizNCkpotPu4w5sbsD1kuLxTbMrPhKWH7vQaC39XxYFQvQsC3WKAY1tf2vATY fNEup17LzxnKzALw8Z4uwXX/0zTSUDprw3yLBJ5z5tdRRMgBzTS5ylVKhwF1XpUcbKKX /svjp34k+UoSr2RWL4u9+1DvcDqQeXjLWER0Htln+RwHNBgoD4vwzmYaqiye5SPR4bCk Q8iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EZs+gNu1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o15-20020a170902d4cf00b001a1b776489dsi83553plg.300.2023.03.29.12.01.00; Wed, 29 Mar 2023 12:01:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EZs+gNu1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbjC2Sxb (ORCPT + 99 others); Wed, 29 Mar 2023 14:53:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbjC2Sx2 (ORCPT ); Wed, 29 Mar 2023 14:53:28 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 015B065A4; Wed, 29 Mar 2023 11:53:22 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id r11so67279528edd.5; Wed, 29 Mar 2023 11:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680116001; x=1682708001; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dV6zayjgZMuIPrwem1Ziq3l3A+7tMStcvlAeBVJqLAQ=; b=EZs+gNu1TJYockxfTUjTJEf18qWEfIP4gTkb7ZSOBePNhP7JTHXm/5YPjfINIBcekw aFaTgZFEQZRf39YUGZlwODA6Frk+FGZ7rXC3nf/qnzVgKmdr0wIH3vALzh1IesI8DfTm 1i89L/8qL8bb1sLZ/ewg8CurozpRptwoAsn1ZdRBPsJEZ+B6nKoIvn35/LiHhYUZ9h0e fd8K4Srbumbz+BtoeskbFUXTOHu4wUNro+rFLCD4can421iy39B9TCoSAbdIS6C+oA1r THPg8nMH9Ej5XSs5eMFqLLJS4Kdxt2UBamSlryPuZDfOqU/1Y0CHhFFb7XH8/s3rslSO /D9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680116001; x=1682708001; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dV6zayjgZMuIPrwem1Ziq3l3A+7tMStcvlAeBVJqLAQ=; b=QilTdjnIYWO+WI8CYXmhPCmT0UtXkail2ZPX4c3NrEEgf7d8RLUzI5bsgN2ZHGRx68 Irhu+cqtw4QUbYuWn6fWaAP74UsGsHLd9rJ4E6PeGS035I2nLqM0o7LWArGGVLIGysYS JlrrKKFKdLWnmwKGtWYOaOAppOJIEhRtxgsGtyeYDIvRU0Vr1L7Eu3CpPy3FGnEQsZQx 4rPbDzvEm01HBNyEPLdzNOfzEP5F47xRgiKYjQUQxC1jwVeVKyjgRQ2bKRFQiLjULBkg sHTHaBwYX3WcoSPeCwnBYeBdfqnWt8tUVgtyFnZtybR/xwqPnPY+firWNvRj5xe0mdkF 6HCA== X-Gm-Message-State: AAQBX9cmmTYL0nzMyn13j45hAuXNZkJxYvyTE+bXBQ4E5OlmbUcM4c6p 6Hm90sRfoHi1E2z4nL4YCQA= X-Received: by 2002:a05:6402:42c2:b0:502:ffd:74a1 with SMTP id i2-20020a05640242c200b005020ffd74a1mr21089909edc.2.1680116001431; Wed, 29 Mar 2023 11:53:21 -0700 (PDT) Received: from [10.0.7.20] (ip-084-119-241-109.um24.pools.vodafone-ip.de. [84.119.241.109]) by smtp.gmail.com with ESMTPSA id m27-20020a170906259b00b0093a3a663ebdsm11529380ejb.154.2023.03.29.11.53.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Mar 2023 11:53:20 -0700 (PDT) Message-ID: <881c4859-db85-b36c-de11-1552ba7e6ff4@gmail.com> Date: Wed, 29 Mar 2023 20:53:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 0/4] coretemp: Fix spamming of ring buffer Content-Language: en-US To: "Zhang, Rui" , "linux@roeck-us.net" Cc: "linux-hwmon@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <7e821f80b7700fcf1fb26f40bde8397f0e5e6d7e.camel@intel.com> <51b2d540c174690a8e460ecba53b0195c4b01294.camel@intel.com> From: Peter Ganzhorn In-Reply-To: <51b2d540c174690a8e460ecba53b0195c4b01294.camel@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/29/23 16:11, Zhang, Rui wrote: > On Wed, 2023-03-29 at 05:47 -0700, Guenter Roeck wrote: >> On Wed, Mar 29, 2023 at 03:43:58AM +0000, Zhang, Rui wrote: >>> Hi, Peter, >>> >>> CC the list. >>> >>> On Tue, 2023-03-28 at 22:37 +0200, Peter Ganzhorn wrote: >>>> Dear Mr. Rui, >>>> Dear Mr. Roeck, >>>> >>>> please consider accepting the attached patches or >>>> modifying the coretemp code to stop spamming my syslog. >>>> I would appreciate it very much if you can accept the patches. >>>> >>>> coretemp: Improve dynamic changes of TjMax >>>> After introduction of dynamic TjMax changes in commit >>>> c0c67f8761cec1fe36c21d85b1a5400ea7ac30cd >>>> my syslog gets spammed with "TjMax is ... degrees C" >>>> messages. >>>> If TjMax is subject to change at any time, it won't be >>>> set in tdata anymore and re-read every time from MSR. >>>> This causes quite a lot of dev_dbg() messages to be issued. >>>> >>>> The following patches change the code to read TjMax >>>> from the MSRs into tdata->tjmax (again) but allow for a >>>> dynamic update at any time as well. (Patches 1 and 2) >>>> This way a message will only be issued after actual changes. >>>> Also I replaced the dev_dbg() with dev_notice (Patch 3) and >>>> added a additional dev_notice for the case where TjMax is >>>> set based on assumptions. (Patch 4) >>>> >>>> >>>> If you do not want to accept my patches, removing the >>>> dev_dbg() in get_tjmax() would be the most simple >>>> solution I guess. >>>> >>> Please check if below patch solves your problem or not. >>> >>> From 9370ee5163a85f65230b5222f1f4dece59ce078a Mon Sep 17 00:00:00 >>> 2001 >>> From: Zhang Rui >>> Date: Wed, 29 Mar 2023 11:35:18 +0800 >>> Subject: [PATCH] hwmon: (coretemp) Avoid duplicate debug messages >>> >>> Avoid duplicate dev_dbg messages when tjmax value retrieved from >>> MSR >>> does not change. >>> >>> Signed-off-by: Zhang Rui >>> --- >>> drivers/hwmon/coretemp.c | 6 +++++- >>> 1 file changed, 5 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c >>> index 30d77f451937..809456967b50 100644 >>> --- a/drivers/hwmon/coretemp.c >>> +++ b/drivers/hwmon/coretemp.c >>> @@ -267,6 +267,7 @@ static int get_tjmax(struct temp_data *tdata, >>> struct device *dev) >>> int err; >>> u32 eax, edx; >>> u32 val; >>> + static u32 tjmax; >> That would apply to every instance of this driver, meaning to every >> CPU core. Is that really appropriate ? >> >> Guenter >> > Good point. > > MSR_IA32_TEMPERATURE_TARGET is package scope, and the cached tjmax > should also be package scope, or else this message is shown for each > cpu when tjmax changes in one package. > > Previously, the message is printed only once during driver probing time > thus I'm wondering how useful this is. > > Maybe we can just delete it? > > thanks, > rui The proposed patch from Rui Zhang does solve the issue of spamming the syslog. I only get one message at boot: [    1.370790] platform coretemp.0: TjMax is 96 degrees C But if different packages have different tjmax values I guess the spamming issue may return. Personally I'd prefer to get a message once if tjmax changes for any package. Thank you both for the quick reaction. Peter