Received: by 10.223.176.5 with SMTP id f5csp1141386wra; Wed, 31 Jan 2018 01:50:30 -0800 (PST) X-Google-Smtp-Source: AH8x226kfHMmOvCN+2tn43Oyk5BWOJKzPN0onkik5BwJ8YsBnMiOt/MYae9AclxcJD6heNS63mJV X-Received: by 2002:a17:902:ab85:: with SMTP id f5-v6mr28491045plr.199.1517392230217; Wed, 31 Jan 2018 01:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517392230; cv=none; d=google.com; s=arc-20160816; b=AHw3G5EjvwbVZGlwuNMo5W1kxitF2/hPOQaSSTd0L1UJ53P9yNLF7K4jGAU+DBbHMD 2XNfznzF26ftqlPJ8s/FUEv10lkm/wi/PZbRGmG9QTsqpspKyaGjLtGsYPJ5tn8+cBTc D4BepdOicjYftIa0mUduCC+ENr3PPU+6rMlJv1f6jd5sV+IlebNvcN5/kpVjNObHhXyT gsnmUszJ25Du6xKA59csmc91cEezKW/RGxl39aawzpt28EydSiH9rcKPNldBdrkYyCVo oG3nQLCBgItoeFIFvNUq7wL/ucYvrKP6scW6hEXZ1abi14s+2nc9KcWh6pa/ARMtkmk2 AmgQ== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=AEwozwnsIUsCM931t7H8tjma8SvJZ2OuHMZ9Q/sB6SU=; b=pC26cP9kazgzulwP6A5PRMDzwhKOgT/Hu1fYLps7VGlC6ijqWBx6dg9iADLEQOdJmF UMekH40ZZ6MqIadKQ4GLqqFaTNnKCiT6crJTWv0VbYDbTAKsSUnIZCZ/XBtnrf7GaZQc 41GMaddEoRwLik9iqlNvEFI2534vRf5esJGLeAHYos1azWf/k6kV5b6wb0edU4mrpgTF ki2hcaTIQDu2SwonvljEo48k0T0zXJET1C9LX0Bly+LgQ5DMhSBFqLuaNdrKjg4xXhLK +dF5+eJePDGMfuNYmgWPKSvbpnWUZmnfqPP5m6vHcZyPgpDRTkCdmLI7DQNHHGSiWUfW XLBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UN7kxt2+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj3-v6si5698036plb.85.2018.01.31.01.50.15; Wed, 31 Jan 2018 01:50:30 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=UN7kxt2+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753496AbeAaJq1 (ORCPT + 99 others); Wed, 31 Jan 2018 04:46:27 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:43457 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753290AbeAaJqW (ORCPT ); Wed, 31 Jan 2018 04:46:22 -0500 Received: by mail-io0-f196.google.com with SMTP id 72so14511237iom.10 for ; Wed, 31 Jan 2018 01:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AEwozwnsIUsCM931t7H8tjma8SvJZ2OuHMZ9Q/sB6SU=; b=UN7kxt2+DEGGTZhD+X41utMnNrkq/SWz5Qx/xB2fJXQ8tRe6MpaXVa0oq/SiTDpCcy XGn4brelaswpe1TKwtE1nhbH5a3+bPxb+armtxwLZ71rVtRiJ2e3sFLBddK7vrPQ7TWI /I2a6fGn5UvVUCJGuGcXqO2DtXaaMJ677jqy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AEwozwnsIUsCM931t7H8tjma8SvJZ2OuHMZ9Q/sB6SU=; b=q+TMu8fgx1BDB9psuUsNDGS5np3sysTpCBobc4bQpZnW/mI5tyHil5gGJN8S9CdWt1 RPyscsHg7UItkAlpXja4AJNxivfm+/qsgzda5eTi0YxvefhRi1J8BCGOJP+2ugto+TZb BvHsylxIxBI9T9FUfLtq6wD9XLsWUCI2tkqQ1onahxSb4fTlCJQA/IBq6ZV3jXxl1rxH ibg9cfZRlEEvHzafaOFPS93FPVaQI6H8L3Soq3WS+b+BOvuNFbljpLXr6O5owFIsEmfi w60qQjAoQwjCyei23tuMbPLWdJmUMh7agXi+UVmv80mcqKOPgyiM3b0dvQxniVCBsy4w t3Bw== X-Gm-Message-State: AKwxytdhCIpTf82igvFuGtO0AzeYjUaHjqucfPZCIM+NoK2ZCwLAEyK0 ncmGQ0Wdbe6xX24Ead3S+yfhd551OK93gaLp3eo/4g== X-Received: by 10.107.19.140 with SMTP id 12mr35427468iot.31.1517391981999; Wed, 31 Jan 2018 01:46:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.50.198 with HTTP; Wed, 31 Jan 2018 01:46:01 -0800 (PST) In-Reply-To: <11334876-ef8c-58fa-5e32-ab8499eebd7e@linaro.org> References: <1516721671-16360-1-git-send-email-daniel.lezcano@linaro.org> <1516721671-16360-6-git-send-email-daniel.lezcano@linaro.org> <11334876-ef8c-58fa-5e32-ab8499eebd7e@linaro.org> From: Vincent Guittot Date: Wed, 31 Jan 2018 10:46:01 +0100 Message-ID: Subject: Re: [PATCH 5/8] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver To: Daniel Lezcano Cc: Eduardo Valentin , Kevin Wangtao , Leo Yan , Amit Kachhap , viresh kumar , linux-kernel , Zhang Rui , Javi Merino , "open list:THERMAL" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31 January 2018 at 10:33, Daniel Lezcano wro= te: > On 31/01/2018 10:01, Vincent Guittot wrote: >> Hi Daniel, >> >> On 23 January 2018 at 16:34, Daniel Lezcano = wrote: > > [ ... ] (please trim :) > >>> + /* >>> + * Each cooling device is per package. Each package >>> + * has a set of cpus where the physical number is >>> + * duplicate in the kernel namespace. We need a way to >>> + * address the waitq[] and tsk[] arrays with index >>> + * which are not Linux cpu numbered. >>> + * >>> + * One solution is to use the >>> + * topology_core_id(cpu). Other solution is to use the >>> + * modulo. >>> + * >>> + * eg. 2 x cluster - 4 cores. >>> + * >>> + * Physical numbering -> Linux numbering -> % nr_cpus >>> + * >>> + * Pkg0 - Cpu0 -> 0 -> 0 >>> + * Pkg0 - Cpu1 -> 1 -> 1 >>> + * Pkg0 - Cpu2 -> 2 -> 2 >>> + * Pkg0 - Cpu3 -> 3 -> 3 >>> + * >>> + * Pkg1 - Cpu0 -> 4 -> 0 >>> + * Pkg1 - Cpu1 -> 5 -> 1 >>> + * Pkg1 - Cpu2 -> 6 -> 2 >>> + * Pkg1 - Cpu3 -> 7 -> 3 >> >> >> I'm not sure that the assumption above for the CPU numbering is safe. >> Can't you use a per cpu structure to point to resources that are per >> cpu instead ? so you will not have to rely on CPU ordering > > Can you elaborate ? I don't get the part with the percpu structure. Something like: struct cpuidle_cooling_cpu { struct task_struct *tsk; wait_queue_head_t waitq; }; DECLARE_PER_CPU(struct cpuidle_cooling_cpu *, cpu_data); > > > -- > Linaro.org =E2=94=82 Open source software for A= RM SoCs > > Follow Linaro: Facebook | > Twitter | > Blog >