Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3124962pxb; Mon, 6 Sep 2021 13:00:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjiC8gDA/afnq3s3joluyq+WSgWY0vU/iBOebCjaR3Vv3WlNbJtJMYsNfoqslPdOi3BeEn X-Received: by 2002:a02:b183:: with SMTP id t3mr12194384jah.93.1630958437345; Mon, 06 Sep 2021 13:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630958437; cv=none; d=google.com; s=arc-20160816; b=bx1+IC2DJi8siw7yJNP4mx+LHTRKpVCEmiF0NdCffXl7PmelcrgBl1U5WDV0ptC8pk oNIHqIbVJMQSfWVXV0cJkBqYi0dQn32FOzr79hOR+teUAwLbi+7QhNuaIGL0QRIALjQ0 YR7JTauhn3DYCO0F4PLY5iewKNrt4M/NrieW6HD+YF2ZOAoVa72QuogGxOsVH3ziTh0R P2Dv6P/HvvCsNn7l8igTLddprnIdgM2MApNzlxOaChtEDaHHvxPGGgJO4+2LjSb1o2Se h84yCgmjlA3ujhYeuQYCiWqsGs0KTYawAr3k53lTyYrv0eMGm2XE/tDxnmcH1u4tcCt4 ScDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=4HrvuKhb03GqyNrtJhqh/7uF+joxz7vQYG/MrhQcYBc=; b=tbqyhjnMo5LtaJHgxhq9kreH4ZanPe8s6MyWUCYCYlBMe/OHl+/ZKOECAQQA/Pr760 jfRe7dqaBgFp2NWshV1qZsBJyye9xzRK8aNwTXlj5pXSJ+gB7ipjuJpfl4PnP7TlSf/r LslFZaGLeDg/Sy+f76Y9nWY4Nrb7XYn+W0ChqkicBRat+YzK0NBXC4ez/OpOiq2xur8g ParRpL0d1x2CrKOrY6jHzAWYHLQb43OKjBHPsaIBz6i4IAL6sfgyRPNBy8hWwmsYBnfw FQfN5K0nIl7+ABkWhMGSAHKM3eapheNVzoZ/iiKZn+maMb7APxtKivFG3jvQzRZ0IOi1 RcJw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si7857588ioj.101.2021.09.06.13.00.26; Mon, 06 Sep 2021 13:00:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243929AbhIFT6M (ORCPT + 99 others); Mon, 6 Sep 2021 15:58:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:49114 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231432AbhIFT6F (ORCPT ); Mon, 6 Sep 2021 15:58:05 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="219723931" X-IronPort-AV: E=Sophos;i="5.85,273,1624345200"; d="scan'208";a="219723931" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 12:57:00 -0700 X-IronPort-AV: E=Sophos;i="5.85,273,1624345200"; d="scan'208";a="579729714" Received: from ibelagox-mobl1.gar.corp.intel.com ([10.213.76.130]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 12:56:56 -0700 Message-ID: <980bc41a8bedbd81c199a78ce9f2ab2ef7b9341f.camel@linux.intel.com> Subject: Re: [PATCH] cpufreq: intel_pstate: Fix for HWP interrupt before driver is ready From: Srinivas Pandruvada To: "Rafael J. Wysocki" Cc: Jens Axboe , "Rafael J. Wysocki" , Len Brown , Viresh Kumar , Linux PM , Linux Kernel Mailing List Date: Mon, 06 Sep 2021 12:56:53 -0700 In-Reply-To: References: <20210904053703.581297-1-srinivas.pandruvada@linux.intel.com> <926ac4b9-1bb5-e96e-ded3-6461f7a215b7@kernel.dk> <8dc57921f157b154e4af2dba26ce697dc4d4fcc2.camel@linux.intel.com> <584a4fad09048e3ea0dbc3515b2e909b745177dd.camel@linux.intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-09-06 at 20:25 +0200, Rafael J. Wysocki wrote: > On Mon, Sep 6, 2021 at 8:14 PM Srinivas Pandruvada > wrote: > > > > On Mon, 2021-09-06 at 19:54 +0200, Rafael J. Wysocki wrote: > > > [...] > > > > > We are handling offline for other thermal interrupt sources from > > same > > interrupt in therm-throt.c, where we do similar in offline path (by > > TGLX). If cpufreq offline can cause such issue of changing CPU, > > This is not cpufreq offline, but intel_pstate_update_status() which > may be triggered via sysfs.  And again, the theoretically problematic > thing is dereferencing cpudata (which may be cleared by a remote CPU) > from the interrupt handler without protection. This will be a problem. > > > I can call intel_pstate_disable_hwp_interrupt() via override from > > https://elixir.bootlin.com/linux/latest/C/ident/thermal_throttle_offline > > after masking APIC interrupt. > > But why would using RCU be harder than this? I think, this will require all_cpu_data and cpu_data to be rcu protected. This needs to be well tested. I think better to revert the patch for the next release. Thanks, Srinivas > > Also please note that on RT kernels interrupt handlers are run in > threads.