From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619AbdKHOUq (ORCPT ); Wed, 8 Nov 2017 09:20:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:39209 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752361AbdKHOUp (ORCPT ); Wed, 8 Nov 2017 09:20:45 -0500 Date: Wed, 8 Nov 2017 15:20:43 +0100 From: Michal Hocko To: Vlastimil Babka Cc: Kees Cook , Andrew Morton , Jesper Dangaard Brouer , Dave Hansen , Ying Huang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm, vmstat: Make sure mutex is a global static Message-ID: <20171108142043.hipnymxez67mbyi5@dhcp22.suse.cz> References: <20171107213809.GA4314@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 08-11-17 08:43:44, Vlastimil Babka wrote: > On 11/07/2017 10:38 PM, Kees Cook wrote: [...] > > +static DEFINE_MUTEX(vm_numa_stat_lock); > > + > > int sysctl_vm_numa_stat_handler(struct ctl_table *table, int write, > > void __user *buffer, size_t *length, loff_t *ppos) > > { > > int ret, oldval; > > - DEFINE_MUTEX(vm_numa_stat_lock); > > Yeah it was Michal who suggested scoping the mutex here instead of > global scope, but I think he didn't mean to remove the 'static' > qualifier, and we both missed that in the review :( > So the scope under sysctl_vm_numa_stat_handler() should be okay, just > with the 'static' added. exactly! Sorry that I've missed the missing static and thanks for catching that Kees. -- Michal Hocko SUSE Labs