Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757777AbbGGOe7 (ORCPT ); Tue, 7 Jul 2015 10:34:59 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:32972 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757653AbbGGOet (ORCPT ); Tue, 7 Jul 2015 10:34:49 -0400 Date: Tue, 7 Jul 2015 20:04:43 +0530 From: Viresh Kumar To: Pan Xinhui Cc: "linux-kernel@vger.kernel.org" , linux-pm@vger.kernel.org, rjw@rjwysocki.net, "mnipxh@163.com" , "yanmin_zhang@linux.intel.com" Subject: Re: [PATCH V2] acpi-cpufreq: replace per_cpu with driver_data of policy Message-ID: <20150707143443.GT14598@linux> References: <559BC96E.8020804@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <559BC96E.8020804@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1308 Lines: 34 On 07-07-15, 20:43, Pan Xinhui wrote: > > Drivers can store their internal per-policy information in > policy->driver_data, lets use it. > > we have benefits after this replacing. > 1) memory saving. > 2) policy is shared by several cpus, per_cpu seems not correct. using > *driver_data* is more reasonable. > 3) fix a memory leak in acpi_cpufreq_cpu_exit. as policy->cpu might > change during cpu hotplug. So sometimes we cant't free *data*, use > *driver_data* to fix it. > 4) fix a zero return value of get_cur_freq_on_cpu. Only per_cpu of > policy->cpu is set to *data*, if we try to get cpufreq on other cpus, we > get zero instead of correct values. Use *driver_data* to fix it. > > Signed-off-by: Pan Xinhui > --- > Changes from V1: > codes style fix, comments update > move cpufreq_cpu_put(policy) after we get *driver_data* > --- > drivers/cpufreq/acpi-cpufreq.c | 40 ++++++++++++++++++++++------------------ > 1 file changed, 22 insertions(+), 18 deletions(-) Acked-by: Viresh Kumar -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/