Received: by 10.223.176.5 with SMTP id f5csp1134400wra; Wed, 31 Jan 2018 01:42:35 -0800 (PST) X-Google-Smtp-Source: AH8x225GFfS1pkmRpajihRLyOMv2V3Fx1JAhUC/Q4hXAJ3oQKn04MTYXPVfR7xwmU1b3YVdN+8cw X-Received: by 10.99.174.15 with SMTP id q15mr25624962pgf.265.1517391754898; Wed, 31 Jan 2018 01:42:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517391754; cv=none; d=google.com; s=arc-20160816; b=yrebs64TE3EyY2dWJUwML0nNpD5sIpR9fOQFKUgELXO7YMdO08kG/s4B1UQCA4ryw6 oEr/gQL0FnVNlKnzX5P5k87MM3IvaAIw5wTcenUM14tYrQQXf1n6GipLvpsq7DbV7oK7 wvexkO6AbqtEy3he3ruLBKywJjzINTkypEiDP9bL2raae3PnXJxMFVibvE7aHcmQCxUC LVe0tN2PV+tQoC4jS7bmzRZC+HFXXy3ckUe7Wu9nrDseh3HS1BPGKG4cDS7LX+nZWMql FA6la3GyG5MK45I+m7j/cfxGZwUa8d27SFCvFGRhwxeoS3oSi+lKaE47X6Q169cRNaxs 0MPg== 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=3MTz9pNk7ewby+i4eOa6Yl4LsgUxTL3KL4qKa2haex0=; b=R3KEFtvSEJu+wdnwe2knTCAW+tS3qqkmkdvh+lLp9iZ6mnjyUQlozWVj5zi24qB7SU sVlN1oac2LFPetVwJ/C+pXCBs8zMTEsWYJ+z4FZgZCm5paq6wEy0sXeJAEEYvrj0XzfY m/O5gr29Fh9v/uMrwYkNU/Wipk4XjR+/IL6iymldihZHWJyKOZsNx7LSzJXFucvj0Qo/ VYonVRnEh3TqsL9LE0F6qr5SNhR/LzAzwfYi3eQEH7Vyd29/QohN6GubVyGs1L04ajrI wIW5Pds/CNblgcUdkE4KiCxyc2cydAgtOe6R9r88450uTysG+JzQ2hQl2kpUM/soAD3e PBog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=irhO6IYA; 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 b17si3494827pfl.222.2018.01.31.01.42.20; Wed, 31 Jan 2018 01:42:34 -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=irhO6IYA; 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 S1753585AbeAaJeC (ORCPT + 99 others); Wed, 31 Jan 2018 04:34:02 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:35603 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbeAaJd7 (ORCPT ); Wed, 31 Jan 2018 04:33:59 -0500 Received: by mail-wm0-f44.google.com with SMTP id r78so6619079wme.0 for ; Wed, 31 Jan 2018 01:33:59 -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=3MTz9pNk7ewby+i4eOa6Yl4LsgUxTL3KL4qKa2haex0=; b=irhO6IYAXC51f4R71y2OmcsEL8vflmiZ+f9HYTneS5wHPkSQ5ZQndUWxRfu6ahzcD/ vg3L+IAAnTqVq1OXC1YdN2oDQEu9AiNxGnpiiZkkUHxTMCFAGrVuYfp0JRmwBF49zbk5 3eeTZno6R3OSMYrR8zRh4ttsZ65AH6n3afGtY= 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=3MTz9pNk7ewby+i4eOa6Yl4LsgUxTL3KL4qKa2haex0=; b=QKZyg5knazs9L1ypMHeUC/7PWTceL1h4EPfmzI5fgDKfWQP5Az/v7hg5sq18Eis53j 3v7ihdWLGUUDPpFEdVtT4c61SwYGXXAwAz8NJQXiWU5T5CCz1wX/gQhwSk/9CBvjzmEl DZkTecHJ2Tk1C6ghrXa77CtpBz4wCj1wrfMelXycweWFEVJ5poP/WgTrAhNw2SaW1pBc UP3+YE0t8T3XGj2iy6kBH6gLWfxw/skQneKLvqra0y3HRX2G/5RT97gRhely6ck1i25F t1I2E8XMUGYez0Xe6srISyVp5QP3X6Iu26HI/4oGjqIaTa84H2pWSq2sVf3RupuKThf7 pklg== X-Gm-Message-State: AKwxyteFZEN1gTjWbaiulvS4ex/l9m8/LVNdPqunf8L8WyFS1W59haqZ 3JO6DgSzQM2OgR3476ESZ5QS7w== X-Received: by 10.80.215.222 with SMTP id m30mr55660259edj.296.1517391238214; Wed, 31 Jan 2018 01:33:58 -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 z12sm8975980edm.0.2018.01.31.01.33.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 01:33:57 -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> From: Daniel Lezcano Message-ID: <11334876-ef8c-58fa-5e32-ab8499eebd7e@linaro.org> Date: Wed, 31 Jan 2018 10:33:55 +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: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. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog