From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755474AbdBGU2J (ORCPT ); Tue, 7 Feb 2017 15:28:09 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36282 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753915AbdBGU2G (ORCPT ); Tue, 7 Feb 2017 15:28:06 -0500 From: Michal Hocko To: Andrew Morton , Mel Gorman Cc: Vlastimil Babka , Hillf Danton , , LKML , Michal Hocko Subject: [PATCH] mm-page_alloc-use-static-global-work_struct-for-draining-per-cpu-pages-fix Date: Tue, 7 Feb 2017 21:27:55 +0100 Message-Id: <20170207202755.24571-1-mhocko@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170207201950.20482-1-mhocko@kernel.org> References: <20170207201950.20482-1-mhocko@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Hocko there is no need to have both pcpu_drain and pcpu_drain_mutex visible outside of drain_all_pages. This might just attract abuse. Signed-off-by: Michal Hocko --- Hi Andrew, Mel, I think this would be a good cleanup to be folded into mm-page_alloc-use-static-global-work_struct-for-draining-per-cpu-pages.patch. mm/page_alloc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b6411816787a..6c48053bcd81 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -92,10 +92,6 @@ EXPORT_PER_CPU_SYMBOL(_numa_mem_); int _node_numa_mem_[MAX_NUMNODES]; #endif -/* work_structs for global per-cpu drains */ -DEFINE_MUTEX(pcpu_drain_mutex); -DEFINE_PER_CPU(struct work_struct, pcpu_drain); - #ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY volatile unsigned long latent_entropy __latent_entropy; EXPORT_SYMBOL(latent_entropy); @@ -2364,6 +2360,8 @@ static void drain_local_pages_wq(struct work_struct *work) */ void drain_all_pages(struct zone *zone) { + static DEFINE_PER_CPU(struct work_struct, pcpu_drain); + static DEFINE_MUTEX(pcpu_drain_mutex); int cpu; /* -- 2.11.0