From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754737AbaG3DDk (ORCPT ); Tue, 29 Jul 2014 23:03:40 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:15423 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751895AbaG3DDj (ORCPT ); Tue, 29 Jul 2014 23:03:39 -0400 X-IronPort-AV: E=Sophos;i="5.00,992,1396972800"; d="scan'208";a="33941025" Message-ID: <53D860DB.40806@cn.fujitsu.com> Date: Wed, 30 Jul 2014 11:04:59 +0800 From: Lai Jiangshan User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc14 Thunderbird/3.1.4 MIME-Version: 1.0 To: Christoph Lameter CC: Frederic Weisbecker , , Gilad Ben-Yossef , Thomas Gleixner , Tejun Heo , John Stultz , Mike Frysinger , Minchan Kim , Hakan Akkan , Max Krasnyansky , "Paul E. McKenney" , , , , , , , Subject: Re: vmstat: On demand vmstat workers V8 References: <20140711132032.GB26045@localhost.localdomain> <20140711135854.GD26045@localhost.localdomain> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.103] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2014 11:17 PM, Christoph Lameter wrote: > On Fri, 11 Jul 2014, Frederic Weisbecker wrote: > >>> Converted what? We still need to keep a cpumask around that tells us which >>> processor have vmstat running and which do not. >>> >> >> Converted to cpumask_var_t. >> >> I mean we spent dozens emails on that... > > > Oh there is this outstanding fix, right. > > > Subject: on demand vmstat: Do not open code alloc_cpumask_var > > Signed-off-by: Christoph Lameter > > Index: linux/mm/vmstat.c > =================================================================== > --- linux.orig/mm/vmstat.c 2014-07-11 10:15:55.356856916 -0500 > +++ linux/mm/vmstat.c 2014-07-11 10:15:55.352856994 -0500 > @@ -1244,7 +1244,7 @@ > #ifdef CONFIG_SMP > static DEFINE_PER_CPU(struct delayed_work, vmstat_work); > int sysctl_stat_interval __read_mostly = HZ; > -struct cpumask *cpu_stat_off; > +cpumask_var_t cpu_stat_off; > > static void vmstat_update(struct work_struct *w) > { > @@ -1338,7 +1338,8 @@ > INIT_DEFERRABLE_WORK(per_cpu_ptr(&vmstat_work, cpu), > vmstat_update); > > - cpu_stat_off = kmalloc(cpumask_size(), GFP_KERNEL); > + if (!alloc_cpumask_var(&cpu_stat_off, GFP_KERNEL)) > + BUG(); BUG_ON(!alloc_cpumask_var(&cpu_stat_off, GFP_KERNEL)); > cpumask_copy(cpu_stat_off, cpu_online_mask); > > schedule_delayed_work(&shepherd, > -- > 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/ > . > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by kanga.kvack.org (Postfix) with ESMTP id 3F57A6B0036 for ; Tue, 29 Jul 2014 23:03:41 -0400 (EDT) Received: by mail-pa0-f45.google.com with SMTP id eu11so697162pac.18 for ; Tue, 29 Jul 2014 20:03:40 -0700 (PDT) Received: from heian.cn.fujitsu.com ([59.151.112.132]) by mx.google.com with ESMTP id fx12si388615pdb.502.2014.07.29.20.03.39 for ; Tue, 29 Jul 2014 20:03:40 -0700 (PDT) Message-ID: <53D860DB.40806@cn.fujitsu.com> Date: Wed, 30 Jul 2014 11:04:59 +0800 From: Lai Jiangshan MIME-Version: 1.0 Subject: Re: vmstat: On demand vmstat workers V8 References: <20140711132032.GB26045@localhost.localdomain> <20140711135854.GD26045@localhost.localdomain> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Lameter Cc: Frederic Weisbecker , akpm@linux-foundation.org, Gilad Ben-Yossef , Thomas Gleixner , Tejun Heo , John Stultz , Mike Frysinger , Minchan Kim , Hakan Akkan , Max Krasnyansky , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, hughd@google.com, viresh.kumar@linaro.org, hpa@zytor.com, mingo@kernel.org, peterz@infradead.org On 07/11/2014 11:17 PM, Christoph Lameter wrote: > On Fri, 11 Jul 2014, Frederic Weisbecker wrote: > >>> Converted what? We still need to keep a cpumask around that tells us which >>> processor have vmstat running and which do not. >>> >> >> Converted to cpumask_var_t. >> >> I mean we spent dozens emails on that... > > > Oh there is this outstanding fix, right. > > > Subject: on demand vmstat: Do not open code alloc_cpumask_var > > Signed-off-by: Christoph Lameter > > Index: linux/mm/vmstat.c > =================================================================== > --- linux.orig/mm/vmstat.c 2014-07-11 10:15:55.356856916 -0500 > +++ linux/mm/vmstat.c 2014-07-11 10:15:55.352856994 -0500 > @@ -1244,7 +1244,7 @@ > #ifdef CONFIG_SMP > static DEFINE_PER_CPU(struct delayed_work, vmstat_work); > int sysctl_stat_interval __read_mostly = HZ; > -struct cpumask *cpu_stat_off; > +cpumask_var_t cpu_stat_off; > > static void vmstat_update(struct work_struct *w) > { > @@ -1338,7 +1338,8 @@ > INIT_DEFERRABLE_WORK(per_cpu_ptr(&vmstat_work, cpu), > vmstat_update); > > - cpu_stat_off = kmalloc(cpumask_size(), GFP_KERNEL); > + if (!alloc_cpumask_var(&cpu_stat_off, GFP_KERNEL)) > + BUG(); BUG_ON(!alloc_cpumask_var(&cpu_stat_off, GFP_KERNEL)); > cpumask_copy(cpu_stat_off, cpu_online_mask); > > schedule_delayed_work(&shepherd, > -- > 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/ > . > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org