From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754804AbdKNPFe (ORCPT ); Tue, 14 Nov 2017 10:05:34 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:37776 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753177AbdKNPF2 (ORCPT ); Tue, 14 Nov 2017 10:05:28 -0500 Date: Tue, 14 Nov 2017 16:05:21 +0100 (CET) From: Thomas Gleixner To: Michal Hocko cc: Andrew Morton , Tejun Heo , Peter Zijlstra , Johannes Weiner , Mel Gorman , linux-mm@kvack.org, LKML Subject: Re: [PATCH] mm: drop hotplug lock from lru_add_drain_all In-Reply-To: <20171114143200.brmgskoqxjlrhrzx@dhcp22.suse.cz> Message-ID: References: <20171114135348.28704-1-mhocko@kernel.org> <20171114142347.syzyd6tlnpe2afur@dhcp22.suse.cz> <20171114143200.brmgskoqxjlrhrzx@dhcp22.suse.cz> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Nov 2017, Michal Hocko wrote: > On Tue 14-11-17 15:23:47, Michal Hocko wrote: > [...] > > +/* > > + * Doesn't need any cpu hotplug locking because we do rely on per-cpu > > + * kworkers being shut down before our page_alloc_cpu_dead callback is > > + * executed on the offlined cpu > > + */ > > void lru_add_drain_all(void) > > { > > static DEFINE_MUTEX(lock); > > Ble the part of the comment didn't go through Looks good. Thanks, tglx > diff --git a/mm/swap.c b/mm/swap.c > index 8bfdcab9f83e..1ab8122d2d0c 100644 > --- a/mm/swap.c > +++ b/mm/swap.c > @@ -688,6 +688,13 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy) > > static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work); > > +/* > + * Doesn't need any cpu hotplug locking because we do rely on per-cpu > + * kworkers being shut down before our page_alloc_cpu_dead callback is > + * executed on the offlined cpu. > + * Calling this function with cpu hotplug locks held can actually lead > + * to obscure indirect dependencies via WQ context. > + */ > void lru_add_drain_all(void) > { > static DEFINE_MUTEX(lock); > -- > Michal Hocko > SUSE Labs >