From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753588AbeAaJeC (ORCPT ); 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 X-Google-Smtp-Source: AH8x226s/lvF0cgHeN/hR0C07bAB/3HzYNWSlcbNjsKGzCeKCyC8OQRcAMbDQQPkJGmVut01J47Bag== 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 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