Received: by 10.223.176.5 with SMTP id f5csp1143374wra; Wed, 31 Jan 2018 01:52:54 -0800 (PST) X-Google-Smtp-Source: AH8x227klnWFMbwFtLOLd+mA2r4mbavUo3ZNXE2Hbp9i2ZM9rC1l18XgLt9p0nWi3fvonQSFZmex X-Received: by 10.98.149.21 with SMTP id p21mr33539834pfd.106.1517392374268; Wed, 31 Jan 2018 01:52:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517392374; cv=none; d=google.com; s=arc-20160816; b=kWsXPGfa6A4wpg8bVmKmFKWdT7Rwe2HBxAzfzjsGLFuLx43o4BgKks9JJTheEGFy/4 XXcl7HH7cYrxUzoNuXAxFrrcV6/Rboq6X1N7VE5Rv/w56jDWd0+bCh/C5npJzF4Sbzi4 awRl3bxE6A076TkDmZJdsN7tGd4RAx+naFzNyqabwcbwpX+AsGwMkr+1Z7VY1nvx/PuE wiDibtEAdbSYX2rffxSlo11a3tl+sb0kfXHRfsLaHcDHcTDcVNF2FbX5A7645xYNf5E7 K28wzQgAiwCNcwQ/uRzXn9uoawTDY9X1Semn0NJRjc+2ttHUbjz3NGWfk/9/S4wLo+uq cvXQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=4VFX/uT7Kjq2re+T3Qh+Ywu1rJsqFr3LkZd8uabTzbQ=; b=xsKDUZrk8cz2UiatqdupCqUBUm1FQB6oNt8orgiKS2ftTGI8LEm0deZcVjn2Wu0PKn DOB6Dwg5jvx1A1IetX4TftTXEnv7HlqqCi2YUhXPuMMA7/w4NzQJpP9jGuosZ7nU50LZ L2OCDqISx4dS0f8ciS+4cN986lD5LKFISaTUw4cWkUGvVEEW6+sONIO9UReRw9jMioiH R3GOpSfkwkMKytt9qqSZ7sd736x6Zh+WCU/04q5KN52tyWfXgcUuEca1dLqQjbiRR2mS 24WhJNSdf+trQYqO8NlKaNE7wDj1VE33kQTiuThkOrxmSytTqnxuSVmg7ceSuOr6eF5F JXKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VcLZMV+S; 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 z21si1302194pge.348.2018.01.31.01.52.39; Wed, 31 Jan 2018 01:52:54 -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=VcLZMV+S; 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 S1753622AbeAaJuc (ORCPT + 99 others); Wed, 31 Jan 2018 04:50:32 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:56126 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753459AbeAaJu0 (ORCPT ); Wed, 31 Jan 2018 04:50:26 -0500 Received: by mail-wm0-f66.google.com with SMTP id 143so6737020wma.5 for ; Wed, 31 Jan 2018 01:50:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4VFX/uT7Kjq2re+T3Qh+Ywu1rJsqFr3LkZd8uabTzbQ=; b=VcLZMV+SNkPQJmHNYNmqWVJIymfQAXP2d/hOff41l7knCDrfDdQj4Av5bbnRLvLBxa EbwRaX3/NDUVD+5hlqLP2kzwudD4vw/nlgpwOBLe6uWpJwoXtTH7Jo521SF53slJB2y+ WUN8I54n77rT+IPyK0w9V8dxKno/AAijuCnrY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4VFX/uT7Kjq2re+T3Qh+Ywu1rJsqFr3LkZd8uabTzbQ=; b=U2CXqUxkahliztltHsdK43IPOvYYhy0M8HKTbEbeDNqnxalkmnP58ClUun3pIF9Wna d2S2lR9XSIQYwz1QtaFCnHDu+ZNemCChZovUN0ITfe3ZA2rsJEgqKFkTsxpbRrl8Qaz5 CR2rnQQr8PQkhID3qx3QhGo6vKrSypvou5NfigH38oLA+8ns6XyLscZdqqAWyw4tzmBj IiBZX0D/udQTZf+lcVnwEqEsk9yBHZ/iwKkocB1CuxPzCimf1g4NBni5JZS4bjUbgnzq dTuSDK+BLEobcnMdNg8FJ1VvVD7e1U9Ce2X/OMVwx4Us0Bw5a+cF0YtUB6HkSsAX8MHQ VqGA== X-Gm-Message-State: AKwxytcxdY6vxrmPatAP9sFcnYA78drdm/30YXvGwDSzN7euuUtooT1W twZcoxEXW5k53fPUWg5JS86NBQ== X-Received: by 10.80.211.7 with SMTP id g7mr56893295edh.76.1517392225276; Wed, 31 Jan 2018 01:50:25 -0800 (PST) Received: from ?IPv6:2001:41d0:fe90:b800:81e6:679:450f:9963? ([2001:41d0:fe90:b800:81e6:679:450f:9963]) by smtp.googlemail.com with ESMTPSA id b46sm8918474edd.73.2018.01.31.01.50.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 01:50:23 -0800 (PST) Subject: Re: [PATCH 5/8] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver To: Vincent Guittot Cc: Eduardo Valentin , Kevin Wangtao , Leo Yan , Amit Kachhap , viresh kumar , linux-kernel , Zhang Rui , Javi Merino , "open list:THERMAL" 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: Daniel Lezcano Message-ID: <6e776e6c-6f1e-b33b-58b7-b95410ca1f95@linaro.org> Date: Wed, 31 Jan 2018 10:50:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/01/2018 10:46, Vincent Guittot wrote: > On 31 January 2018 at 10:33, Daniel Lezcano wrote: >> 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); I got this part but I don't get how that fixes the ordering thing. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog