From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbdGDMgD (ORCPT ); Tue, 4 Jul 2017 08:36:03 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:48028 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751536AbdGDMgD (ORCPT ); Tue, 4 Jul 2017 08:36:03 -0400 Date: Tue, 4 Jul 2017 14:35:59 +0200 (CEST) From: Thomas Gleixner To: Vlastimil Babka cc: LKML , linux-mm@kvack.org, Andrey Ryabinin , Michal Hocko , Andrew Morton , Vladimir Davydov , Peter Zijlstra Subject: Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked() In-Reply-To: Message-ID: References: <20170704093232.995040438@linutronix.de> <20170704093421.419329357@linutronix.de> 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, 4 Jul 2017, Vlastimil Babka wrote: > > > > -void lru_add_drain_all(void) > > +void lru_add_drain_all_cpuslocked(void) > > { > > static DEFINE_MUTEX(lock); > > static struct cpumask has_work; > > @@ -701,7 +701,6 @@ void lru_add_drain_all(void) > > return; > > > > mutex_lock(&lock); > > - get_online_cpus(); > > Is there a an assertion check that we are locked, that could be put in > e.g. VM_WARN_ON_ONCE()? There is a lockdep assertion lockdep_assert_cpus_held() which could be used. Forgot to add it. Thanks, tglx From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id D502A6B0279 for ; Tue, 4 Jul 2017 08:36:04 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id g15so7585596wmi.11 for ; Tue, 04 Jul 2017 05:36:04 -0700 (PDT) Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id 199si20680516wml.90.2017.07.04.05.36.03 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 04 Jul 2017 05:36:03 -0700 (PDT) Date: Tue, 4 Jul 2017 14:35:59 +0200 (CEST) From: Thomas Gleixner Subject: Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked() In-Reply-To: Message-ID: References: <20170704093232.995040438@linutronix.de> <20170704093421.419329357@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka Cc: LKML , linux-mm@kvack.org, Andrey Ryabinin , Michal Hocko , Andrew Morton , Vladimir Davydov , Peter Zijlstra On Tue, 4 Jul 2017, Vlastimil Babka wrote: > > > > -void lru_add_drain_all(void) > > +void lru_add_drain_all_cpuslocked(void) > > { > > static DEFINE_MUTEX(lock); > > static struct cpumask has_work; > > @@ -701,7 +701,6 @@ void lru_add_drain_all(void) > > return; > > > > mutex_lock(&lock); > > - get_online_cpus(); > > Is there a an assertion check that we are locked, that could be put in > e.g. VM_WARN_ON_ONCE()? There is a lockdep assertion lockdep_assert_cpus_held() which could be used. Forgot to add it. Thanks, tglx -- 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