Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3329731rwb; Fri, 16 Dec 2022 13:19:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXsU5rLRTs357hh1yvcKHiZvAY/nsC4Wkgxh+7W/6e2cFnhGeGIHQU4f699HHedseNJXJNzu X-Received: by 2002:a17:906:c0d3:b0:7fc:4242:fa1d with SMTP id bn19-20020a170906c0d300b007fc4242fa1dmr60883ejb.54.1671225582052; Fri, 16 Dec 2022 13:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671225582; cv=none; d=google.com; s=arc-20160816; b=TE3FFu0Op3lABaMkJ9DD8K5zkxXDShEdDGV2gT6JTemhZUZdc8gMQdOZBo4b9kvp2w 6b7NwKUQnPlPmXpl4IWJ0oGkOv+NoAcFRf63+LbfXOLjPCLVRU4ayWKLIFaNQURNtQ1r AtVHKgqdS8+ts919ALn2IuFyp3R4aDlUbGroQnGXJF748THETn0T+JZ4TGiK3VD4BXyw vEdcporL4Qur4omwslhiDXPf4OgC2f9c/UIDZhHFRqSSj5aaILxXJeam36R0y9BcN3va F6DJ4pk1IKXmFB+WG6dzC1MTZN0tfbovi8v2qQ0yjpYmlQKDox0qCjbqGo/s4s5ltkDh T+dg== 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=kO1kFNElmiazijaeVmClgAjGGa3reOuDHRabVz/YO1k=; b=JfA01MbHvXgo6BhhkCK+/1vCf2Rdcoz1Q3yCOeFz7wCLfDhb45gX4/8p3hPw64uREW KErw57OttDHNnT/9H6X44RDclKgbua75jSCAz/p990FBoYptwvnyrdmXa5IwVFquUak5 vgGrGUetc4AoLTUMzZv0ksq5SnV7Y+VcxAwgZ/ZreRfzPtlcdaWzXsDHDJYNNEGKy+gH hd5Wu+s+hLCIe5E11JoURRullrDfCObrdxMHsu7Qa6RlrS2Jp6+9fZsYeh+jjPQs8DN5 c0DG9GytdmRqtgK552rLA945i4th/aYxS1aMju0K9uWpc77YK6B66x0V9aVPRFCfyaBL PDmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IrUsxxSb; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy11-20020a170906fe0b00b007baa6e22740si3638326ejb.467.2022.12.16.13.19.25; Fri, 16 Dec 2022 13:19:42 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=IrUsxxSb; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231986AbiLPU0w (ORCPT + 68 others); Fri, 16 Dec 2022 15:26:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231958AbiLPU0t (ORCPT ); Fri, 16 Dec 2022 15:26:49 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CFF63945E for ; Fri, 16 Dec 2022 12:26:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671222361; 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: in-reply-to:in-reply-to:references:references; bh=kO1kFNElmiazijaeVmClgAjGGa3reOuDHRabVz/YO1k=; b=IrUsxxSbDP34wjTzqZztyrlrHUGE3rbIZaBjBwWTkppROKxDFaIgr4RozsVxV+WyS/WbNL rFUJVAJNCbKvn3h+wZP1Qpny4IR2jfCAzQc3ADHDE7SOCOQ0ftJHWI7Nu5dIZOeTblKSEy 9CUQ9QcgWSKj6hmGgfB149lk5L40xwY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-203-WLYL5WUlM4OrgTcuyZvtoA-1; Fri, 16 Dec 2022 15:25:56 -0500 X-MC-Unique: WLYL5WUlM4OrgTcuyZvtoA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B8B5C3815D38; Fri, 16 Dec 2022 20:25:55 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D27E40C6EC4; Fri, 16 Dec 2022 20:25:55 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id A290F403B5B80; Fri, 16 Dec 2022 17:24:08 -0300 (-03) Date: Fri, 16 Dec 2022 17:24:08 -0300 From: Marcelo Tosatti To: Guenter Roeck Cc: Fenghua Yu , linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Frederic Weisbecker Subject: [PATCH v3] hwmon: coretemp: avoid RDMSR interruptions to isolated CPUs Message-ID: References: <68f76ac7-5edd-d437-8bef-e233f2876660@roeck-us.net> <34dc4244-4e62-0b73-b6f9-430e4ee1a1e6@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34dc4244-4e62-0b73-b6f9-430e4ee1a1e6@roeck-us.net> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 The coretemp driver uses rdmsr_on_cpu calls to read MSR_IA32_PACKAGE_THERM_STATUS/MSR_IA32_THERM_STATUS registers, which contain information about current core temperature. For certain low latency applications, the RDMSR interruption exceeds the applications requirements. So do not create core files in sysfs, for CPUs which have isolation and nohz_full enabled. Temperature information from the housekeeping cores should be sufficient to infer die temperature. Signed-off-by: Marcelo Tosatti --- v3: do not create sysfs files for isolated CPUs (Guenter Roeck) v2: improve changelog to mention that an error is returned, and sysfs file is not disabled (Guenter Roeck) diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 9bee4d33fbdf..619dfde7a712 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -27,6 +27,7 @@ #include #include #include +#include #define DRVNAME "coretemp" @@ -458,6 +459,9 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu, u32 eax, edx; int err, index, attr_no; + if (!housekeeping_cpu(cpu, HK_TYPE_MISC)) + return 0; + /* * Find attr number for sysfs: * We map the attr number to core id of the CPU