From: Michal Hocko <mhocko@kernel.org> To: Kees Cook <keescook@chromium.org> Cc: Vlastimil Babka <vbabka@suse.cz>, Andrew Morton <akpm@linux-foundation.org>, Jesper Dangaard Brouer <brouer@redhat.com>, Dave Hansen <dave.hansen@intel.com>, Ying Huang <ying.huang@intel.com>, LKML <linux-kernel@vger.kernel.org> Subject: Re: [PATCH] mm, vmstat: Make sure mutex is a global static Date: Thu, 9 Nov 2017 08:50:16 +0100 [thread overview] Message-ID: <20171109075016.ufgjvegqghjus3wc@dhcp22.suse.cz> (raw) In-Reply-To: <CAGXu5jKiGLAcL4QG2BoAms+JaHH-4piVe--YF3X9RhXZN53Z8Q@mail.gmail.com> On Wed 08-11-17 07:21:20, Kees Cook wrote: > On Tue, Nov 7, 2017 at 11:43 PM, Vlastimil Babka <vbabka@suse.cz> 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. > > That part is a matter of taste, I guess. :) But yes, static is important. The primary reason I prefer function scope lock is that it is less tempting to reuse the lock for something else that way. But this is hardly something to insist on. So I am ok with the file scope as well. -- Michal Hocko SUSE Labs
next prev parent reply other threads:[~2017-11-09 7:50 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-11-07 21:38 Kees Cook 2017-11-08 7:43 ` Vlastimil Babka 2017-11-08 14:20 ` Michal Hocko 2017-11-08 15:21 ` Kees Cook 2017-11-09 7:50 ` Michal Hocko [this message] 2017-11-09 1:10 ` kemi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20171109075016.ufgjvegqghjus3wc@dhcp22.suse.cz \ --to=mhocko@kernel.org \ --cc=akpm@linux-foundation.org \ --cc=brouer@redhat.com \ --cc=dave.hansen@intel.com \ --cc=keescook@chromium.org \ --cc=linux-kernel@vger.kernel.org \ --cc=vbabka@suse.cz \ --cc=ying.huang@intel.com \ --subject='Re: [PATCH] mm, vmstat: Make sure mutex is a global static' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.