Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2413304imm; Wed, 16 May 2018 12:28:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoAVKwh5nloQk/izeD0s9HXcEfUQUmrFjtyKjeP5mA1c6FbjcgBU+CCJsyG8Fs9cARzrqUf X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr2279494plg.38.1526498917753; Wed, 16 May 2018 12:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526498917; cv=none; d=google.com; s=arc-20160816; b=XD85B9OF6WxzpwF16dAsGHlceqeEqNB4AHRndc4wBXYuYo4+UNKRZ5cU5U3BWc6Z3w VecdA4/wCbMcFt11zeLAnAIk8nuEFSCYiAlPqAplVFS+U+zG30cl+ssI9hxsreCCOSOM 4z5vrv3JzCsMWzO/uOghYZ8kr/efMq/dVixWADc/F6SRSGzt8j620KThk8k9tna/2HbB 3hL421ve/VGyQz6vQctEmYNLSl2wbibqm+I53iIlJFJBnnGUeRKY9M45u+PLeOmY2ToL cTdW7h8FdC3iqfkyx08fBlXmM2IM1hzMmbK70KddlsgFwgcC94WCwi9RjBmauwdNIT7+ G6dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=L2Bf7KGi0xQtPikh1qXJ2uPmsFlygX2pXRivOuMwiKI=; b=K4IOfwCtYpeYfCTFAnwkgm2O42OXVg5/2nZ1dibPGXp/gGBnJ8fHbbOFaPU9qZ6Szl 7bO7na7B60KUM+jgm6YR/AKKMMiSvxa81qFQnjIh8tLPvHfsaFRmxpmAQQgwEHsQcbeX 2CyQ7KUba4WmbYVusY4Dmr0r83qE9KDnYPydDipokpv7EYUluJ8hdhH2mnv3e82Wxdwy lixbnRTUWg+DPr0x3kzM3M4yAJPp5sPPAoE16kRAoDCszx1I3ouoRcLGwu+RT2h9f+JQ wUcdLJX5YrUFSvZQpIj6CM5kr3F6CUUOkaei9ZrZYIKQVVKN6ZpIN6WvqpsTBXmiiYrH ErVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v66-v6si2597347pgv.344.2018.05.16.12.28.21; Wed, 16 May 2018 12:28:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1751130AbeEPT2M (ORCPT + 99 others); Wed, 16 May 2018 15:28:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:47048 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbeEPT2K (ORCPT ); Wed, 16 May 2018 15:28:10 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2018 12:28:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,406,1520924400"; d="scan'208";a="51431372" Received: from spandruv-desk.jf.intel.com ([10.54.75.31]) by orsmga003.jf.intel.com with ESMTP; 16 May 2018 12:28:09 -0700 Message-ID: <1526498889.61700.82.camel@linux.intel.com> Subject: Re: [RFC/RFT] [PATCH 05/10] cpufreq: intel_pstate: HWP boost performance on IO Wake From: Srinivas Pandruvada To: "Rafael J. Wysocki" Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Borislav Petkov , Len Brown , "Rafael J. Wysocki" , Mel Gorman , the arch/x86 maintainers , Linux PM , Viresh Kumar , Juri Lelli , Linux Kernel Mailing List Date: Wed, 16 May 2018 12:28:09 -0700 In-Reply-To: References: <20180516044911.28797-1-srinivas.pandruvada@linux.intel.com> <20180516044911.28797-6-srinivas.pandruvada@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.6 (3.24.6-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-05-16 at 11:45 +0200, Rafael J. Wysocki wrote: [...] > > > + if (time_before64(time, cpu->last_io_update + 2 * > > TICK_NSEC) && > > + intel_pstate_check_boost_threhold(cpu)) > > + cpu->iowait_boost = true; > > + > > + cpu->last_io_update = time; > > + cpu->last_update = time; > > This is a shared data structure and it gets updated without > synchronization, unless I'm missing something. Good point. > > How much does the cross-CPU case matter? I was under impression that IOWAIT flag is set on local CPU calls only, but I see IOWAIT flags set for remote CPU all the time. So we will miss if we don't take care of cross CPU calls. But I can lump them as part of smp async call for all cross cpu updates to avoid sync issue. > > > + } > > > > + /* > > + * If the boost is active, we will remove it after timeout > > on local > > + * CPU only. > > + */ > > + if (cpu->hwp_boost_active) { > > + if (smp_processor_id() == cpu->cpu) { > > + bool expired; > > + > > + expired = time_after64(time, cpu- > > >last_update + > > + (hwp_boost_hold_time > > _ms * NSEC_PER_MSEC)); > > + if (expired) { > > + intel_pstate_hwp_boost_down(cpu); > > + cpu->hwp_boost_active = false; > > + cpu->iowait_boost = false; > > + } > > + } > > + return; > > + } > > + > > + cpu->last_update = time; > > + > > + if (cpu->iowait_boost) { > > + cpu->hwp_boost_active = true; > > + if (smp_processor_id() == cpu->cpu) > > + intel_pstate_hwp_boost_up(cpu); > > + else > > + smp_call_function_single_async(cpu->cpu, > > &cpu->csd); > > + } > > } > > > > static inline void intel_pstate_calc_avg_perf(struct cpudata *cpu) > > -- > > 2.9.5 > >